]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
dns.cgi: Check for empty server address.
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 8 Jan 2020 11:12:29 +0000 (12:12 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 8 Jan 2020 11:12:29 +0000 (12:12 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/dns.cgi
langs/en/cgi-bin/en.pl

index 4fecd342c74f323f51e015d030f4e43709fa3036..4498a71a3eee00b9f57a03ce41e74fbed307a9f9 100755 (executable)
@@ -95,8 +95,13 @@ if (($cgiparams{'SERVERS'} eq $Lang::tr{'save'}) || ($cgiparams{'SERVERS'} eq $L
        # Read-in generic settings.
        &General::readhash("$settings_file", \%settings);
 
+       # Check if an IP-address has been given.
+       if ($cgiparams{"NAMESERVER"} eq "") {
+               $errormessage = "$Lang::tr{'dns no address given'}";
+       }
+
        # Check if the given DNS server is valid.
-       if(!&General::validip($cgiparams{"NAMESERVER"})) {
+       elsif(!&General::validip($cgiparams{"NAMESERVER"})) {
                $errormessage = "$Lang::tr{'invalid ip'}: $cgiparams{'NAMESERVER'}";
        }
 
index 4542cad163791ea4b8c00202a6c7fac7524267a0..fdfae843469dd1c55b64fe597b74182f602fc52a 100644 (file)
 'dns mode for qname minimisation' => 'QNAME Minimisation',
 'dns new 0' => 'New <strong>primary</strong> DNS server IP:',
 'dns new 1' => 'New <strong>secondary</strong> DNS server IP:',
+'dns no address given' => 'No IP Address given.',
 'dns no tls hostname given' => 'No TLS hostname given.',
 'dns proxy server' => 'DNS Proxy Server',
 'dns saved' => 'Successfully saved!',