chiark / gitweb /
bus: properly unmap mapped area
[elogind.git] / src / core / condition.c
index b3184922b8ecd6ed4c86a3d556996d00819e67e7..4293d6d1f190e7b386d2fa4e0a61d6f669283756 100644 (file)
@@ -36,6 +36,7 @@
 #include "condition.h"
 #include "virt.h"
 #include "path-util.h"
+#include "fileio.h"
 
 Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate) {
         Condition *c;
@@ -161,6 +162,12 @@ static bool test_security(const char *parameter) {
         if (streq(parameter, "selinux"))
                 return is_selinux_enabled() > 0;
 #endif
+        if (streq(parameter, "apparmor"))
+                return access("/sys/kernel/security/apparmor/", F_OK) == 0;
+        if (streq(parameter, "ima"))
+                return access("/sys/kernel/security/ima/", F_OK) == 0;
+        if (streq(parameter, "smack"))
+                return access("/sys/fs/smackfs", F_OK) == 0;
         return false;
 }