kernel: don't apply rules for permissive/disabled selinux

This commit is contained in:
weishu
2022-12-23 08:59:57 +07:00
parent fa59434753
commit 87d1158313
2 changed files with 12 additions and 0 deletions

View File

@@ -71,6 +71,12 @@ void setenforce(bool enforce) {
}
bool getenforce() {
#ifdef CONFIG_SECURITY_SELINUX_DISABLE
if (selinux_state.disabled) {
return false;
}
#endif
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
return selinux_state.enforcing;
#else