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

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