aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-04-25 18:56:52 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2022-05-01 13:23:12 +0200
commit946f60aaebc6ecb069696d0375a5cb1e2f80658b (patch)
tree963d5f0d5d5e0c6411320b5e34d7a561ce3bf695 /package
parent6d5a097232b0e98413b11011efbcad26e7792e6b (diff)
downloadupstream-946f60aaebc6ecb069696d0375a5cb1e2f80658b.tar.gz
upstream-946f60aaebc6ecb069696d0375a5cb1e2f80658b.tar.bz2
upstream-946f60aaebc6ecb069696d0375a5cb1e2f80658b.zip
dnsmasq: add logfacility file to jail mounts
If logfacility is a path to a file it needs to be r/w mounted in the sandbox as well for dnsmasq to work. Reported-by: @iointerrupt Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 2b5fa44f60165d66d74131778df0b64b706887e2)
Diffstat (limited to 'package')
-rwxr-xr-xpackage/network/services/dnsmasq/files/dnsmasq.init8
1 files changed, 6 insertions, 2 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index d95502c0da..040ceaea2f 100755
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -820,7 +820,7 @@ dnsmasq_ipset_add() {
dnsmasq_start()
{
local cfg="$1"
- local disabled user_dhcpscript
+ local disabled user_dhcpscript logfacility
local resolvfile resolvdir localuse=0
config_get_bool disabled "$cfg" disabled 0
@@ -933,7 +933,7 @@ dnsmasq_start()
append_bool "$cfg" scriptarp "--script-arp"
append_parm "$cfg" logfacility "--log-facility"
-
+ config_get logfacility "$cfg" "logfacility"
append_parm "$cfg" cachesize "--cache-size"
append_parm "$cfg" dnsforwardmax "--dns-forward-max"
append_parm "$cfg" port "--port"
@@ -1167,6 +1167,10 @@ dnsmasq_start()
procd_add_jail_mount $dnsmasqconffile $dnsmasqconfdir $resolvdir $user_dhcpscript
procd_add_jail_mount /etc/passwd /etc/group /etc/TZ /etc/hosts /etc/ethers
procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
+ case "$logfacility" in */*)
+ [ ! -e "$logfacility" ] && touch "$logfacility"
+ procd_add_jail_mount_rw "$logfacility"
+ esac
procd_close_instance
}