mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
isc-dhcpd: quote filenames for safety
Per best practices, we should protect against wildcards in variable expansions. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
@@ -638,7 +638,7 @@ start_service() {
|
||||
else
|
||||
. /lib/functions/network.sh
|
||||
|
||||
local dyn_file=$(mktemp -u /tmp/dhcpd.XXXXXX)
|
||||
local dyn_file="$(mktemp -u /tmp/dhcpd.XXXXXX)"
|
||||
|
||||
config_load dhcp
|
||||
|
||||
@@ -653,7 +653,7 @@ start_service() {
|
||||
general_config > $config_file
|
||||
|
||||
if [ $dynamicdns -eq 1 ]; then
|
||||
cat <<EOF > $dyn_file
|
||||
cat <<EOF > "$dyn_file"
|
||||
; Generated by /etc/init.d/dhcpd at $(date)
|
||||
|
||||
ttl $TTL
|
||||
@@ -681,11 +681,11 @@ EOF
|
||||
|
||||
no_ipv6 && args="-4"
|
||||
|
||||
nsupdate -l -v $args $dyn_file
|
||||
nsupdate -l -v $args "$dyn_file"
|
||||
|
||||
fi
|
||||
|
||||
rm -f $dyn_file
|
||||
rm -f "$dyn_file"
|
||||
|
||||
[ -z "$dhcp_ifs" ] && return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user