dnsmasq: fix jail_mount for serversfile
authorBruno Victal <brunovictal@outlook.com>
Fri, 15 Apr 2022 14:30:01 +0000 (15:30 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 2 May 2022 17:57:49 +0000 (18:57 +0100)
Fix 'serversfile' option not being jail_mounted by the init script.

Signed-off-by: Bruno Victal <brunovictal@outlook.com>
package/network/services/dnsmasq/files/dnsmasq.init

index 040ceaea2fea1879f8693b69c4175ef0ce1edd5a..c4ca3eb2db39d08355ec82904456a54fa8648003 100755 (executable)
@@ -972,7 +972,14 @@ dnsmasq_start()
        config_list_foreach "$cfg" "addnhosts" append_addnhosts
        config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
        append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases"
-       append_parm "$cfg" "serversfile" "--servers-file"
+
+       local serversfile
+       config_get serversfile "$cfg" "serversfile"
+       [ -n "$serversfile" ] && {
+               xappend "--servers-file=$serversfile"
+               append EXTRA_MOUNT "$serversfile"
+       }
+
        append_parm "$cfg" "tftp_root" "--tftp-root"
        append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
        append_parm "$cfg" "local_ttl" "--local-ttl"