Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa12a0f

Browse files
committed
dnsmasq: add option to expose additional paths to jail
Add new UCI list 'addn_mount' allowing the expose additional filesystem paths to the jailed dnsmasq process. This is useful e.g. in case of manually configured includes to the configuration file or symlinks pointing outside of the exposed paths as used by e.g. the safe-search package in the packages feed. Signed-off-by: Daniel Golle <[email protected]>
1 parent d4c4606 commit aa12a0f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package/network/services/dnsmasq/files/dhcp.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ config dnsmasq
2323
option ednspacket_max 1232
2424
option filter_aaaa 0
2525
option filter_a 0
26+
#list addnmount /some/path # read-only mount path to expose it to dnsmasq
2627

2728
config dhcp lan
2829
option interface lan

package/network/services/dnsmasq/files/dnsmasq.init

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,12 @@ ismounted() {
204204
return 1
205205
}
206206

207-
append_addnhosts() {
207+
append_extramount() {
208208
ismounted "$1" || append EXTRA_MOUNT "$1"
209+
}
210+
211+
append_addnhosts() {
212+
append_extramount "$1"
209213
xappend "--addn-hosts=$1"
210214
}
211215

@@ -1186,6 +1190,8 @@ dnsmasq_start()
11861190
done
11871191
}
11881192

1193+
config_list_foreach "$cfg" addnmount append_extramount
1194+
11891195
procd_open_instance $cfg
11901196
procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq."${cfg}".pid
11911197
procd_set_param file $CONFIGFILE

0 commit comments

Comments
 (0)