aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/dnsmasq
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-10-31 12:54:06 +0000
committerDaniel Golle <daniel@makrotopia.org>2021-10-31 13:07:48 +0000
commita2fcd3900c0c7c168c4d3c04da189e408860483d (patch)
tree4b47f27c64b3b45169ffdf7b2216948178430972 /package/network/services/dnsmasq
parent61a36cefd67732c5d5e51fb3140c80aac3dda555 (diff)
downloadupstream-a2fcd3900c0c7c168c4d3c04da189e408860483d.tar.gz
upstream-a2fcd3900c0c7c168c4d3c04da189e408860483d.tar.bz2
upstream-a2fcd3900c0c7c168c4d3c04da189e408860483d.zip
dnsmasq: improve init script
* fix restart in LuCI (inherited umask was to restrictive) * make directory of hosts-file (!= /tmp) accessible in ujail Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network/services/dnsmasq')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 3250b2179b..19135af1c2 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -829,12 +829,14 @@ dnsmasq_start()
CONFIGFILE_TMP="${CONFIGFILE}.$$"
HOSTFILE="${BASEHOSTFILE}.${cfg}"
HOSTFILE_TMP="${HOSTFILE}.$$"
+ HOSTFILE_DIR="$(dirname "$HOSTFILE")"
BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}"
# before we can call xappend
+ umask u=rwx,g=rx,o=rx
mkdir -p /var/run/dnsmasq/
mkdir -p $(dirname $CONFIGFILE)
- mkdir -p $(dirname $HOSTFILE)
+ mkdir -p "$HOSTFILE_DIR"
mkdir -p /var/lib/misc
chown dnsmasq:dnsmasq /var/run/dnsmasq
@@ -1154,6 +1156,7 @@ dnsmasq_start()
procd_add_jail_mount $EXTRA_MOUNT $RFC6761FILE $TRUSTANCHORSFILE
procd_add_jail_mount $dnsmasqconffile $dnsmasqconfdir $resolvdir $user_dhcpscript
procd_add_jail_mount /etc/passwd /etc/group /etc/TZ /etc/hosts /etc/ethers
+ [ "$HOSTFILE_DIR" != "/tmp" ] && procd_add_jail_mount "$HOSTFILE_DIR"
procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
procd_close_instance