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

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