summaryrefslogtreecommitdiffstats
path: root/src/core/condition.c
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@collabora.co.uk>2013-04-09 15:00:24 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-06 21:17:37 +0200
commit80f53eb59516f87e26e3afa405c61b4eed9ffe30 (patch)
tree5d27b74325f58c694224a789d8caab8e268099c3 /src/core/condition.c
parentquota: use QUOTACHECK path correctly as tested in configure.ac (diff)
downloadsystemd-80f53eb59516f87e26e3afa405c61b4eed9ffe30.tar.xz
systemd-80f53eb59516f87e26e3afa405c61b4eed9ffe30.zip
condition, man: Add support for ConditionSecurity=apparmor
Checking for the apparmor directory in securityfs means the apparmor module is loaded and enabled, and hence should suffice as a test. https://bugs.freedesktop.org/show_bug.cgi?id=63312
Diffstat (limited to '')
-rw-r--r--src/core/condition.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/condition.c b/src/core/condition.c
index 30199c10e3..4aa5530c36 100644
--- a/src/core/condition.c
+++ b/src/core/condition.c
@@ -162,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;
}