From 80f53eb59516f87e26e3afa405c61b4eed9ffe30 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 9 Apr 2013 18:30:24 +0530 Subject: 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 --- src/core/condition.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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; } -- cgit v1.2.3-54-g00ecf