Blame SOURCES/0023-policycoreutils-fixfiles-Force-full-relabel-when-SEL.patch

60475e
From 9bcf8ad7b9b6d8d761f7d097196b2b9bc114fa0a Mon Sep 17 00:00:00 2001
60475e
From: Petr Lautrbach <plautrba@redhat.com>
60475e
Date: Tue, 2 Jul 2019 17:12:07 +0200
c33c08
Subject: [PATCH] policycoreutils/fixfiles: Force full relabel when SELinux is
c33c08
 disabled
60475e
60475e
The previous check used getfilecon to check whether / slash contains a label,
60475e
but getfilecon fails only when SELinux is disabled. Therefore it's better to
60475e
check this using selinuxenabled.
60475e
60475e
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
60475e
---
60475e
 policycoreutils/scripts/fixfiles | 4 ++--
60475e
 1 file changed, 2 insertions(+), 2 deletions(-)
60475e
60475e
diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
60475e
index 9dd44213..a9d27d13 100755
60475e
--- a/policycoreutils/scripts/fixfiles
60475e
+++ b/policycoreutils/scripts/fixfiles
60475e
@@ -314,8 +314,8 @@ case "$1" in
60475e
 	> /.autorelabel || exit $?
60475e
 	[ -z "$FORCEFLAG" ] || echo -n "$FORCEFLAG " >> /.autorelabel
60475e
 	[ -z "$BOOTTIME" ] || echo -N $BOOTTIME >> /.autorelabel
60475e
-	# Force full relabel if / does not have a label on it
60475e
-	getfilecon / > /dev/null 2>&1  || echo -F >/.autorelabel
60475e
+	# Force full relabel if SELinux is not enabled
60475e
+	selinuxenabled || echo -F > /.autorelabel
60475e
 	echo "System will relabel on next boot"
60475e
 	;;
60475e
     *)
60475e
-- 
c33c08
2.21.0
60475e