units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled
authorSangjung Woo <sangjung.woo@samsung.com>
Wed, 14 Oct 2015 06:57:47 +0000 (15:57 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Thu, 15 Oct 2015 05:02:44 +0000 (14:02 +0900)
If SMACK is enabled, 'smackfsroot=*' option should be specified in
tmp.mount file since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.

Makefile.am
units/tmp.mount [deleted file]
units/tmp.mount.m4 [new file with mode: 0644]

index 8646e55450fb89005974226ed159707b2ec20732..889c03955aac695bbe9d26daa3f54e0e98932f24 100644 (file)
@@ -616,7 +616,8 @@ EXTRA_DIST += \
        units/initrd-udevadm-cleanup-db.service.in \
        units/initrd-switch-root.service.in \
        units/systemd-nspawn@.service.in \
-       units/systemd-update-done.service.in
+       units/systemd-update-done.service.in \
+       units/tmp.mount.m4
 
 if HAVE_SYSV_COMPAT
 nodist_systemunit_DATA += \
diff --git a/units/tmp.mount b/units/tmp.mount
deleted file mode 100644 (file)
index 00a0d28..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=Temporary Directory
-Documentation=man:hier(7)
-Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
-ConditionPathIsSymbolicLink=!/tmp
-DefaultDependencies=no
-Conflicts=umount.target
-Before=local-fs.target umount.target
-
-[Mount]
-What=tmpfs
-Where=/tmp
-Type=tmpfs
-Options=mode=1777,strictatime
diff --git a/units/tmp.mount.m4 b/units/tmp.mount.m4
new file mode 100644 (file)
index 0000000..d537746
--- /dev/null
@@ -0,0 +1,23 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Temporary Directory
+Documentation=man:hier(7)
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
+ConditionPathIsSymbolicLink=!/tmp
+DefaultDependencies=no
+Conflicts=umount.target
+Before=local-fs.target umount.target
+
+[Mount]
+What=tmpfs
+Where=/tmp
+Type=tmpfs
+m4_ifdef(`HAVE_SMACK',
+`Options=mode=1777,strictatime,smackfsroot=*',
+`Options=mode=1777,strictatime')