chiark / gitweb /
condition, man: Add support for ConditionSecurity=apparmor
[elogind.git] / src / core / condition.c
index b3184922b8ecd6ed4c86a3d556996d00819e67e7..4aa5530c3645b8ba7ddc9f01789d7e73182da366 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,8 @@ 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;
         return false;
 }