From e367d111e513a61495213028e8d4ab2e36775790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 9 Apr 2021 18:20:53 +0200 Subject: [PATCH] selinux.c:reset_selinux_file_context(): do not fail in permissive mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return 0 on setfscreatecon(3) failure, like set_selinux_file_context(). Signed-off-by: Christian Göttsche Acked-by: James Carter --- lib/selinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/selinux.c b/lib/selinux.c index e31a5f92..a2ea91c8 100644 --- a/lib/selinux.c +++ b/lib/selinux.c @@ -94,7 +94,7 @@ int reset_selinux_file_context (void) } if (selinux_enabled) { if (setfscreatecon_raw (NULL) != 0) { - return 1; + return security_getenforce () != 0; } } return 0;