diff --git a/src/www/services_dnsmasq.php b/src/www/services_dnsmasq.php index 0d8a51ff9..a833c57de 100644 --- a/src/www/services_dnsmasq.php +++ b/src/www/services_dnsmasq.php @@ -70,7 +70,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext('Unbound is still active on the same port. Disable it before enabling Dnsmasq.'); } - if (!empty($pconfig['custom_options'])) { + $prev_opt = !empty($config['dnsmasq']['custom_options']) ? $config['dnsmasq']['custom_options'] : ""; + if ($prev_opt != str_replace("\r\n", "\n", $pconfig['custom_options']) && !userIsAdmin($_SESSION['Username'])) { + $input_errors[] = gettext("Advanced options may only be edited by admins (role page-all), due to the increased possibility of privilege escalation."); + } + if (!empty($pconfig['custom_options']) && userIsAdmin($_SESSION['Username'])) { $args = ''; foreach (preg_split('/\s+/', str_replace("\r\n", "\n", $pconfig['custom_options'])) as $c) { if (!empty($c)) { @@ -386,6 +390,7 @@ $( document ).ready(function() {
> +