selinux.c:reset_selinux_file_context(): do not fail in permissive mode

Return 0 on setfscreatecon(3) failure, like set_selinux_file_context().

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2021-04-09 18:20:53 +02:00
parent 95fd179683
commit e367d111e5

View File

@ -94,7 +94,7 @@ int reset_selinux_file_context (void)
} }
if (selinux_enabled) { if (selinux_enabled) {
if (setfscreatecon_raw (NULL) != 0) { if (setfscreatecon_raw (NULL) != 0) {
return 1; return security_getenforce () != 0;
} }
} }
return 0; return 0;