diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-04-10 08:07:07 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-04-10 08:07:07 -0300 |
commit | 8543a5bbe2037c9214f967806f417c7c4ba3b062 (patch) | |
tree | 8841722ca000796f3066d58f230059d89159eff6 /usr/local/www/firewall_aliases_edit.php | |
parent | 87f611017953aadb5db66ded7d27724786b0d118 (diff) | |
download | pfsense-8543a5bbe2037c9214f967806f417c7c4ba3b062.zip pfsense-8543a5bbe2037c9214f967806f417c7c4ba3b062.tar.gz |
Prohibit adding aliases containing FQDNs in static routes. Fixes #2941
Diffstat (limited to 'usr/local/www/firewall_aliases_edit.php')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index ca5fd9e..a41770c 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -254,6 +254,15 @@ if ($_POST) { } } else { /* item is a normal alias type */ + $used_for_routes = 0; + if (isset($config['staticroutes']['route']) && is_array($config['staticroutes']['route'])) { + foreach($config['staticroutes']['route'] as $route) { + if ($route['network'] == $_POST['origname']) { + $used_for_routes = 1; + break; + } + } + } $wrongaliases = ""; for($x=0; $x<4999; $x++) { if($_POST["address{$x}"] <> "") { @@ -272,6 +281,11 @@ if ($_POST) { && !is_hostname($_POST["address{$x}"]) && !is_iprange($_POST["address{$x}"])) $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s alias.'), $_POST["address{$x}"], $_POST['type']); + if (($used_for_routes === 1) + && !is_ipaddr($_POST["address{$x}"]) + && !is_iprange($_POST["address{$x}"]) + && is_hostname($_POST["address{$x}"])) + $input_errors[] = gettext('This alias is used on a static route and cannot contain FQDNs.'); } if (is_iprange($_POST["address{$x}"])) { list($startip, $endip) = explode('-', $_POST["address{$x}"]); |