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>
Wed, 10 Aug 2022 13:06:30 +0000 (15:06 +0200)
Fix 'serversfile' option not being jail_mounted by the init script.

Signed-off-by: Bruno Victal <brunovictal@outlook.com>
(cherry picked from commit 0276fab64933dc42bad865974dc224e2672f99fe)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
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"