summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2014-08-06 15:26:41 -0400
committerjim-p <jimp@pfsense.org>2014-08-06 15:26:41 -0400
commit52c67bc2d2681b79e6f46979c62367c3af8602b7 (patch)
tree22753b4e08452c5068ea2e9bcddcba21fc4bf733
parent1de3a5dd51259be93371d6106f9f2ea689814d28 (diff)
downloadpfsense-52c67bc2d2681b79e6f46979c62367c3af8602b7.zip
pfsense-52c67bc2d2681b79e6f46979c62367c3af8602b7.tar.gz
Escape the individual dnsmasq advanced/custom options
-rw-r--r--etc/inc/services.inc2
-rwxr-xr-xusr/local/www/services_dnsmasq.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index a99cc4d..3a80c2a 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -1741,7 +1741,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 331aecf..603f6bd 100755
--- 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");
OpenPOWER on IntegriCloud