Projet

Général

Profil

« Précédent | Suivant » 

Révision 071f6059

Ajouté par jim-p il y a plus de 9 ans

Escape the individual dnsmasq advanced/custom options

Voir les différences:

etc/inc/services.inc
1826 1826

  
1827 1827
		if ($config['dnsmasq']['custom_options'])
1828 1828
			foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c) {
1829
				$args .= " --$c";
1829
				$args .= " " . escapeshellarg("--{$c}");
1830 1830
				$p = explode('=', $c);
1831 1831
				if (array_key_exists($p[0], $standard_args))
1832 1832
					unset($standard_args[$p[0]]);
usr/local/www/services_dnsmasq.php
101 101
	if ($config['dnsmasq']['custom_options']) {
102 102
		$args = '';
103 103
		foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
104
			$args .= "--$c ";
104
			$args .= escapeshellarg("--{$c}") . " ";
105 105
		exec("/usr/local/sbin/dnsmasq --test $args", $output, $rc);
106 106
		if ($rc != 0)
107 107
			$input_errors[] = gettext("Invalid custom options");

Formats disponibles : Unified diff