diff options
author | Steven Barth <cyrus@openwrt.org> | 2015-04-13 07:49:29 +0000 |
---|---|---|
committer | Steven Barth <cyrus@openwrt.org> | 2015-04-13 07:49:29 +0000 |
commit | 3633523ba653e8d50f5e51b0882e914bf638486e (patch) | |
tree | 778c54bfe4e1eef6f44a854c9fa626445da302f7 /package/network/services/dnsmasq/files/dnsmasq.init | |
parent | 33b93243ec1ee657b841a0741b46085a58cbe850 (diff) | |
download | upstream-3633523ba653e8d50f5e51b0882e914bf638486e.tar.gz upstream-3633523ba653e8d50f5e51b0882e914bf638486e.tar.bz2 upstream-3633523ba653e8d50f5e51b0882e914bf638486e.zip |
dnsmasq: fix dnssec timestamp logic, backport crashfix
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 45410
Diffstat (limited to 'package/network/services/dnsmasq/files/dnsmasq.init')
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index b2dfb979bc..b0a5fbc04f 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -15,6 +15,7 @@ ADD_LOCAL_HOSTNAME=1 CONFIGFILE="/var/etc/dnsmasq.conf" HOSTFILE="/tmp/hosts/dhcp" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" +TIMESTAMPFILE="/etc/dnsmasq.time" xappend() { local value="$1" @@ -205,7 +206,7 @@ dnsmasq() { [ "$dnssec" -gt 0 ] && { xappend "--conf-file=$TRUSTANCHORSFILE" xappend "--dnssec" - xappend "--dnssec-timestamp=/etc/dnsmasq.time" + xappend "--dnssec-timestamp=$TIMESTAMPFILE" append_bool "$cfg" dnsseccheckunsigned "--dnssec-check-unsigned" } @@ -556,7 +557,7 @@ start_service() { procd_add_jail dnsmasq ubus log procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /dev/urandom /etc/dnsmasq.conf /tmp/dnsmasq.d /tmp/resolv.conf.auto /etc/hosts /etc/ethers - procd_add_jail_mount_rw /var/run/dnsmasq/ /tmp/dhcp.leases /etc/dnsmasq.time + procd_add_jail_mount_rw /var/run/dnsmasq/ /tmp/dhcp.leases $TIMESTAMPFILE procd_close_instance @@ -566,9 +567,9 @@ start_service() { mkdir -p /var/lib/misc touch /tmp/dhcp.leases - if [ ! -f /etc/dnsmasq.time ]; then - touch -t 197001010000 /etc/dnsmasq.time - chmod 0777 /etc/dnsmasq.time + if [ ! -f "$TIMESTAMPFILE" ]; then + touch "$TIMESTAMPFILE" + chown nobody.nogroup "$TIMESTAMPFILE" fi echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE |