diff options
-rw-r--r-- | etc/inc/services.inc | 2 | ||||
-rw-r--r-- | usr/local/www/services_dnsmasq.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 3b24e3a..239e9cb 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1826,7 +1826,7 @@ function services_dnsmasq_configure() { if ($config['dnsmasq']['custom_options']) foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c) { - $args .= " --$c"; + $args .= " " . escapeshellarg("--{$c}"); $p = explode('=', $c); if (array_key_exists($p[0], $standard_args)) unset($standard_args[$p[0]]); diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php index 5c39178..7733f00 100644 --- a/usr/local/www/services_dnsmasq.php +++ b/usr/local/www/services_dnsmasq.php @@ -101,7 +101,7 @@ if ($_POST) { if ($config['dnsmasq']['custom_options']) { $args = ''; foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c) - $args .= "--$c "; + $args .= escapeshellarg("--{$c}") . " "; exec("/usr/local/sbin/dnsmasq --test $args", $output, $rc); if ($rc != 0) $input_errors[] = gettext("Invalid custom options"); |