diff --git a/frox/save_acl.cgi b/frox/save_acl.cgi index 23be58bb5..d6207c9f2 100755 --- a/frox/save_acl.cgi +++ b/frox/save_acl.cgi @@ -69,14 +69,14 @@ return $_[0] =~ /^\d+$/ ? undef : $text{'acl_erate'}; sub check_ntp { -return $_[0] =~ /^(\S+):(\d+)$/ && gethostbyname($1) ? undef +return $_[0] =~ /^(\S+):(\d+)$/ && &to_ipaddress("$1") ? undef : $text{'acl_entp'}; } sub valid_srcdest { -return gethostbyname($_[0]) || +return &to_ipaddress($_[0]) || ($_[0] =~ /^([0-9\.]+)\/(\d+)$/ && &check_ipaddress($1) && $2 > 0 && $2 <= 32) || ($_[0] =~ /^([0-9\.]+)\/([0-9\.]+)$/ && diff --git a/frox/save_cache.cgi b/frox/save_cache.cgi index e106f6822..de869d69c 100755 --- a/frox/save_cache.cgi +++ b/frox/save_cache.cgi @@ -40,7 +40,7 @@ return $_[0] =~ /^\d+$/ ? undef : $text{'cache_esize'}; sub check_proxy { -return $_[0] =~ /^(\S+):(\d+)$/ && gethostbyname($1) ? +return $_[0] =~ /^(\S+):(\d+)$/ && &to_ipaddress($1) ? undef : $text{'cache_eproxy'}; } diff --git a/frox/save_iptables.cgi b/frox/save_iptables.cgi index 8f18e7ddd..f0af837ae 100755 --- a/frox/save_iptables.cgi +++ b/frox/save_iptables.cgi @@ -10,7 +10,7 @@ $port = &find_value("Port", $conf); # Validate inputs if ($in{'enabled'} == 1) { - gethostbyname($in{'net'}) || + &to_ipaddress($in{'net'}) || ($in{'net'} =~ /^([0-9\.]+)\/(\d+)$/ && &check_ipaddress($1) && $2 > 0 && $2 <= 32) || &error($text{'iptables_enet'}); diff --git a/frox/save_net.cgi b/frox/save_net.cgi index a34226056..13f30ea42 100755 --- a/frox/save_net.cgi +++ b/frox/save_net.cgi @@ -24,7 +24,7 @@ $conf = &get_config(); sub check_listen { -return gethostbyname($_[0]) ? undef : $text{'net_ehost'}; +return &to_ipaddress($_[0]) ? undef : $text{'net_ehost'}; } sub check_port @@ -39,7 +39,8 @@ return $_[0] =~ /^[a-z]+(\d*)(:\d+)?$/ ? undef : $text{'net_eiface'}; sub check_proxy { -return $_[0] =~ /^(\S+):(\d+)$/ && gethostbyname($1) ? undef : $text{'net_eproxy'}; +return $_[0] =~ /^(\S+):(\d+)$/ && &to_ipaddress($1) ? + undef : $text{'net_eproxy'}; } sub check_ip