Skip to content

Commit

Permalink
selinux.c:reset_selinux_file_context(): do not fail in permissive mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cgzones committed May 6, 2021
1 parent 95fd179 commit e367d11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/selinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e367d11

Please sign in to comment.