[source] dnsmasq: fix remove pidfile on shutdown regression

LEDE Commits lede-commits at lists.infradead.org
Tue Sep 6 02:26:30 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/9209f4304b0dd5e5a5337abd69a6dbf6a9cb782e

commit 9209f4304b0dd5e5a5337abd69a6dbf6a9cb782e
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Mon Sep 5 09:01:19 2016 +0100

    dnsmasq: fix remove pidfile on shutdown regression
    
    Regression introduced by 3481d0d dnsmasq: run as dedicated UID/GID
    
    dnsmasq is unable to remove its own pidfile as /var/run/dnsmasq is owned
    by root and now dnsmasq runs as dnsmasq:dnsmasq.  Change directory
    ownership to match.
    
    dnsmasq initially starts as root, creates the pidfile, then drops to
    requested non-root user.  Until this fix dnsmasq had insufficient
    privilege to remove its own pidfile.
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 2b81a61..4cd5f67 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -643,6 +643,7 @@ start_service() {
 	mkdir -p $(dirname $CONFIGFILE)
 	mkdir -p /var/lib/misc
 	touch /tmp/dhcp.leases
+	chown dnsmasq:dnsmasq /var/run/dnsmasq
 
 	[ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE"
 



More information about the lede-commits mailing list