chiark / gitweb /
condition, man: Add support for ConditionSecurity=smack
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 7 May 2013 11:21:46 +0000 (13:21 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 9 May 2013 02:24:37 +0000 (22:24 -0400)
According to Documentation/security/Smack.txt:
  In keeping with the intent of Smack, configuration data is minimal
  and not strictly required. The most important configuration step is
  mounting the smackfs pseudo filesystem.
This means that checking the mount point should be enough.

man/systemd.unit.xml
src/core/condition.c

index 49103dad56d8610e1d3f20feb0f50a51c9d14a9c..c56837a6e53c0650645ed1d035ba132882372c90 100644 (file)
                                 may be used to check whether the given
                                 security module is enabled on the
                                 system.  Currently the only recognized
-                                values are <varname>selinux</varname>
-                                and <varname>apparmor</varname>.
+                                values are <varname>selinux</varname>,
+                                <varname>apparmor</varname>, and
+                                <varname>smack</varname>.
                                 The test may be negated by prepending
                                 an exclamation
                                 mark.</para>
index 4aa5530c3645b8ba7ddc9f01789d7e73182da366..16cae6d23b6555a734e903b81fac9091ef251822 100644 (file)
@@ -164,6 +164,8 @@ static bool test_security(const char *parameter) {
 #endif
        if (streq(parameter, "apparmor"))
                return access("/sys/kernel/security/apparmor/", F_OK) == 0;
+       if (streq(parameter, "smack"))
+               return access("/sys/fs/smackfs", F_OK) == 0;
         return false;
 }