Blame SOURCES/shadow-4.6-getenforce.patch

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