diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2008-11-11 23:04:22 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2008-11-11 23:04:22 +0000 |
commit | c98d28e12ec6df36ac0165051ca678ef0b7ab69a (patch) | |
tree | 6271fc20adb5c0469f5903ecbaf1db10d02dac89 /usr/local/www/system.php | |
parent | 5aaf13c4370d9f48834cb503da4fe4391c7d406d (diff) | |
download | pfsense-c98d28e12ec6df36ac0165051ca678ef0b7ab69a.zip pfsense-c98d28e12ec6df36ac0165051ca678ef0b7ab69a.tar.gz |
Add input validation so users do not add gateways to local dns servers
Diffstat (limited to 'usr/local/www/system.php')
-rwxr-xr-x | usr/local/www/system.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php index e58e4b3..3f42f22 100755 --- a/usr/local/www/system.php +++ b/usr/local/www/system.php @@ -121,6 +121,21 @@ if ($_POST) { $input_errors[] = "A valid TCP/IP port must be specified for the webConfigurator port."; } + $direct_networks_list = explode(" ", get_direct_networks_list()); + for ($dnscounter=1; $dnscounter<5; $dnscounter++) { + $dnsitem = "dns{$dnscounter}"; + $dnsgwitem = "dns{$dnscounter}gwint"; + if ($_POST[$dnsgwitem]) { + if(interface_has_gateway($_POST[$dnsgwitem])) { + foreach($direct_networks_list as $direct_network) { + if(ip_in_subnet($_POST[$dnsitem], $direct_network)) { + $input_errors[] = "You can not assign a gateway to DNS '{$_POST[$dnsitem]}' server which is on a directly connected network."; + } + } + } + } + } + $t = (int)$_POST['timeupdateinterval']; if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) { $input_errors[] = "The time update interval must be either 0 (disabled) or between 6 and 1440."; |