skeleton: make /run a proper directory/filesystem
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Thu, 27 Nov 2014 22:41:49 +0000 (19:41 -0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 3 Feb 2015 14:58:03 +0000 (15:58 +0100)
Making /var/run and /run symlinks to /tmp is bad since the underlying
tmpfs filesystem is mode 1777 which leads to possible security attack
vectors via badly owned/mask-mode pidfiles and state files residing there.

So make /run a proper directory with /var/run symlinked to it.
Eventually all startup scripts and state info should be pointed to /run
directly as per the linux fhs and good practice.

Add a tmpfs filesystem entry for /run so that busybox inittab, systemv
inittab and systemd automount mounts it there to avoid breaking the
system.

While at it fix inconsistent spacing in /etc/fstab by using tabs and
drop the "static file system information" header whatever that means.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
system/skeleton/etc/fstab
system/skeleton/run [deleted symlink]
system/skeleton/run/.empty [new file with mode: 0644]
system/skeleton/var/run

index e000aadc361c1a14faaa7cbec6a8bb152b86fc3a..2b418a0eb6ea7b869fad3deaf61006c2b3d4a775 100644 (file)
@@ -1,9 +1,8 @@
-# /etc/fstab: static file system information.
-#
-# <file system> <mount pt>     <type>  <options>         <dump> <pass>
-/dev/root       /              ext2    rw,noauto         0      1
-proc           /proc          proc     defaults          0      0
-devpts         /dev/pts       devpts   defaults,gid=5,mode=620   0      0
-tmpfs           /dev/shm       tmpfs    mode=0777         0      0
-tmpfs           /tmp           tmpfs    mode=1777         0      0
-sysfs          /sys           sysfs    defaults          0      0
+# <file system>        <mount pt>      <type>  <options>       <dump>  <pass>
+/dev/root      /               ext2    rw,noauto       0       1
+proc           /proc           proc    defaults        0       0
+devpts         /dev/pts        devpts  defaults,gid=5,mode=620 0       0
+tmpfs          /dev/shm        tmpfs   mode=0777       0       0
+tmpfs          /tmp            tmpfs   mode=1777       0       0
+tmpfs          /run            tmpfs   mode=0755,nosuid,nodev  0       0
+sysfs          /sys            sysfs   defaults        0       0
diff --git a/system/skeleton/run b/system/skeleton/run
deleted file mode 120000 (symlink)
index 1c2f433..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tmp
\ No newline at end of file
diff --git a/system/skeleton/run/.empty b/system/skeleton/run/.empty
new file mode 100644 (file)
index 0000000..e69de29
index 1431b0e43235bbb3d2034a7b9c9cf7952a7443de..9ab376ec39f976935d084d59de7da35f59a44e87 120000 (symlink)
@@ -1 +1 @@
-../tmp
\ No newline at end of file
+../run