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