summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/systemd.unit.xml3
-rw-r--r--src/core/condition.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 2f2d1a1d4a..3360a719a2 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -984,7 +984,8 @@
may be used to check whether the given
security module is enabled on the
system. Currently the only recognized
- value is <varname>selinux</varname>.
+ values are <varname>selinux</varname>
+ and <varname>apparmor</varname>.
The test may be negated by prepending
an exclamation
mark.</para>
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;
}