Blame SOURCES/0015-Issue-5127-ds_selinux_restorecon.sh-always-exit-0.patch

b2bc38
From 0ed471bae52bb0debd23336cbc5f3f1d400cbbc9 Mon Sep 17 00:00:00 2001
b2bc38
From: Adam Williamson <awilliam@redhat.com>
b2bc38
Date: Thu, 27 Jan 2022 11:07:26 -0800
b2bc38
Subject: [PATCH] Issue 5127 - ds_selinux_restorecon.sh: always exit 0
b2bc38
b2bc38
Description:
b2bc38
b2bc38
We don't want to error out and give up on starting the service
b2bc38
if the restorecon fails - it might just be that the directory
b2bc38
doesn't exist and doesn't need restoring. Issue identified and
b2bc38
fix suggested by Simon Farnsworth
b2bc38
b2bc38
relates: https://github.com/389ds/389-ds-base/issues/5127
b2bc38
b2bc38
Reviewed by: adamw & mreynolds
b2bc38
---
b2bc38
 wrappers/ds_selinux_restorecon.sh.in | 5 +++--
b2bc38
 1 file changed, 3 insertions(+), 2 deletions(-)
b2bc38
b2bc38
diff --git a/wrappers/ds_selinux_restorecon.sh.in b/wrappers/ds_selinux_restorecon.sh.in
b2bc38
index 063347de3..2d7386233 100644
b2bc38
--- a/wrappers/ds_selinux_restorecon.sh.in
b2bc38
+++ b/wrappers/ds_selinux_restorecon.sh.in
b2bc38
@@ -29,5 +29,6 @@ then
b2bc38
     exit 0
b2bc38
 fi
b2bc38
 
b2bc38
-# Now run restorecon
b2bc38
-restorecon ${DS_HOME_DIR}
b2bc38
+# Now run restorecon, but don't die if it fails (could be that the
b2bc38
+# directory doesn't exist)
b2bc38
+restorecon ${DS_HOME_DIR} || :
b2bc38
-- 
b2bc38
2.31.1
b2bc38