[openwrt/openwrt] base-files: chmod 1777 /var/lock

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 6 15:48:56 PDT 2021


chunkeey pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/2f04012b20515eec74563de74d0528e603aa6f89

commit 2f04012b20515eec74563de74d0528e603aa6f89
Author: Deomid Ryabkov <rojer at rojer.me>
AuthorDate: Sat Oct 23 16:22:39 2021 +0300

    base-files: chmod 1777 /var/lock
    
    Per FHS 3.0, /var/lock is the location for lock files [1].
    However its current permissions (755) are too restrictive
    for use by unprivileged processes.
    Debian and Ubuntu set them to 1777, and now so do we.
    
    [1] <https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#varlockLockFiles>
    
    Signed-off-by: Deomid Ryabkov <rojer at rojer.me>
    [fixed typo in commit message, had to remove "rojer" due to git hooks]
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
    (cherry picked from commit 430f69194388ad6a7826a51e0e2b2dd478e27f0f)
---
 package/base-files/files/etc/init.d/boot | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index a1e8e828dd..e1c60c1c2f 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -21,9 +21,10 @@ boot() {
 	[ -f /proc/mounts ] || /sbin/mount_root
 	[ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
 
-	mkdir -p /var/run
-	mkdir -p /var/log
 	mkdir -p /var/lock
+	chmod 1777 /var/lock
+	mkdir -p /var/log
+	mkdir -p /var/run
 	mkdir -p /var/state
 	mkdir -p /var/tmp
 	mkdir -p /tmp/.uci



More information about the lede-commits mailing list