kernel: don't setenforce if kernel is already permissive

This commit is contained in:
weishu
2022-12-12 22:18:59 +07:00
parent 28f2217765
commit 84ebb6800a
3 changed files with 13 additions and 2 deletions
+8
View File
@@ -89,4 +89,12 @@ void setenforce(bool enforce) {
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
selinux_state.enforcing = enforce;
#endif
}
bool getenforce() {
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
return selinux_state.enforcing;
#else
return false;
#endif
}
+2
View File
@@ -5,4 +5,6 @@ void setup_selinux();
void setenforce(bool);
bool getenforce();
#endif