selinux: split up mac_selinux_have() from mac_selinux_use()
Let's distuingish the cases where our code takes an active role in selinux management, or just passively reports whatever selinux properties are set. mac_selinux_have() now checks whether selinux is around for the passive stuff, and mac_selinux_use() for the active stuff. The latter checks the former, plus also checks UID == 0, under the assumption that only when we run priviliged selinux management really makes sense. Fixes: #1941
This commit is contained in:
@@ -231,7 +231,7 @@ static int condition_test_security(Condition *c) {
|
||||
assert(c->type == CONDITION_SECURITY);
|
||||
|
||||
if (streq(c->parameter, "selinux"))
|
||||
return mac_selinux_use();
|
||||
return mac_selinux_have();
|
||||
if (streq(c->parameter, "smack"))
|
||||
return mac_smack_use();
|
||||
if (streq(c->parameter, "apparmor"))
|
||||
|
||||
Reference in New Issue
Block a user