mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 03:41:29 +00:00
net/nut: Fix '/var/run' world readable warning
Use /var/run/nut as statepath and set appropriate owner and permissions on /var/run/nut in order to avoid pidfile for nut being world-readable. Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
This commit is contained in:
@@ -143,9 +143,6 @@ nut_upsmon_add() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -d $RUN_D ] || mkdir -p $RUN_D
|
||||
mkdir -p /var/etc/nut
|
||||
chmod 640 /var/etc/nut
|
||||
rm -f $UPSMON_C
|
||||
|
||||
config_load nut_monitor
|
||||
@@ -159,6 +156,11 @@ start_service() {
|
||||
chmod 640 $UPSMON_C
|
||||
chmod 640 /var/etc/nut/nut.conf
|
||||
|
||||
[ -d /var/run/nut ] || {
|
||||
mkdir -m 0750 -p /var/run/nut
|
||||
chown ${runas:-root}:$(id -gn ${runas:-root}) /var/run/nut
|
||||
}
|
||||
|
||||
chown ${runas:-root}:$(id -gn ${runas:-root}) $UPSMON_C
|
||||
$DEBUG /usr/sbin/upsmon $UPSMON_OPTIONS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user