about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-03-10 15:44:05 +0100
committerSören Tempel <soeren+git@soeren-tempel.net>2015-03-10 15:44:05 +0100
commit1ea8901a50ddeaaddf4ab069e3e34dd3d996c385 (patch)
tree0d2000196b63ea31cc078dbfa982264763a771df
parent54c677a1463ab6577ee812b99adbd8b63840db80 (diff)
downloadrunit-void-1ea8901a50ddeaaddf4ab069e3e34dd3d996c385.tar.gz
runit-void-1ea8901a50ddeaaddf4ab069e3e34dd3d996c385.tar.xz
runit-void-1ea8901a50ddeaaddf4ab069e3e34dd3d996c385.zip
Restrict access to /var/log/dmesg.log
-rwxr-xr-x15
1 files changed, 5 insertions, 0 deletions
diff --git a/1 b/1
index bba2dd3..9e9f413 100755
--- a/1
+++ b/1
@@ -16,6 +16,11 @@ for f in /etc/runit/core-services/*.sh; do
 done
 
 dmesg >/var/log/dmesg.log
+if [ $(sysctl -n kernel.dmesg_restrict 2>/dev/null) -eq 1 ]; then
+	chmod 0600 /var/log/dmesg.log
+else
+	chmod 0644 /var/log/dmesg.log
+fi
 
 mkdir -p /run/runit
 install -m100 /dev/null /run/runit/stopit