aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-02-25 09:24:31 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-02-25 09:24:31 +0000
commite24b47f3cd0c419100f7f29b5692868ff222f847 (patch)
tree486744b0c2620dd9d2b8517b0e14a6390a1a27e4 /package
parent7e0107c3ca760dce8f2ced55066f540a04191aac (diff)
downloadmaster-187ad058-e24b47f3cd0c419100f7f29b5692868ff222f847.tar.gz
master-187ad058-e24b47f3cd0c419100f7f29b5692868ff222f847.tar.bz2
master-187ad058-e24b47f3cd0c419100f7f29b5692868ff222f847.zip
dnsmasq: export tftp root to the procd jail
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48761 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init28
1 files changed, 17 insertions, 11 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 504c4acf4c..90e3dc4d39 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -220,6 +220,12 @@ dnsmasq() {
xappend "--conf-dir=/tmp/dnsmasq.d"
echo >> $CONFIGFILE
+
+ config_get_bool enable_tftp "$cfg" enable_tftp 0
+ [ "$enable_tftp" -gt 0 ] && {
+ config_get tftp_root "$cfg" tftp_root
+ append EXTRA_MOUNT $tftp_root
+ }
}
dhcp_subscrid_add() {
@@ -555,17 +561,6 @@ start_service() {
config_load dhcp
- procd_open_instance
- procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq.pid
- procd_set_param file $CONFIGFILE
- procd_set_param respawn
-
- procd_add_jail dnsmasq ubus log
- procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /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 $TIMESTAMPFILE
-
- procd_close_instance
-
# before we can call xappend
mkdir -p /var/run/dnsmasq/
mkdir -p $(dirname $CONFIGFILE)
@@ -643,6 +638,17 @@ start_service() {
for DNS_SERVER in $DNS_SERVERS ; do
echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
done
+
+ procd_open_instance
+ procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq.pid
+ procd_set_param file $CONFIGFILE
+ procd_set_param respawn
+
+ procd_add_jail dnsmasq ubus log
+ procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom /etc/dnsmasq.conf /tmp/dnsmasq.d /tmp/resolv.conf.auto /etc/hosts /etc/ethers $EXTRA_MOUNT
+ procd_add_jail_mount_rw /var/run/dnsmasq/ /tmp/dhcp.leases $TIMESTAMPFILE
+
+ procd_close_instance
}
reload_service() {