Blame SOURCES/shadow-4.6-getenforce.patch

9f13c6
diff -up shadow-4.6/lib/selinux.c.getenforce shadow-4.6/lib/selinux.c
9f13c6
--- shadow-4.6/lib/selinux.c.getenforce	2018-05-28 15:10:15.870315221 +0200
9f13c6
+++ shadow-4.6/lib/selinux.c	2018-05-28 15:10:15.894315731 +0200
9f13c6
@@ -75,7 +75,7 @@ int set_selinux_file_context (const char
9f13c6
 	}
9f13c6
 	return 0;
9f13c6
     error:
9f13c6
-	if (security_getenforce () != 0) {
9f13c6
+	if (security_getenforce () > 0) {
9f13c6
 		return 1;
9f13c6
 	}
9f13c6
 	return 0;
9f13c6
@@ -95,7 +95,7 @@ int reset_selinux_file_context (void)
9f13c6
 		selinux_checked = true;
9f13c6
 	}
9f13c6
 	if (selinux_enabled) {
9f13c6
-		if (setfscreatecon (NULL) != 0) {
9f13c6
+		if (setfscreatecon (NULL) != 0 && security_getenforce () > 0) {
9f13c6
 			return 1;
9f13c6
 		}
9f13c6
 	}