Sanity checks (ie. is_ipaddr() ) when generating resolv.conf.

Specifically this fixes importing nameserver.conf from the
dhclient-script.
This commit is contained in:
Jeb Campbell 2005-07-07 15:38:30 +00:00
parent 984a5853ec
commit 64aaddf70f

View File

@ -53,7 +53,9 @@ function system_resolvconf_generate($dynupdate = false) {
if ($nfd) {
while (!feof($nfd)) {
$dnss = trim(fgets($nfd));
if ($dnss) {
if ( preg_match('/^(nameserver )(.*)/',$dnss, $catch) )
$dnss = $catch[2];
if (is_ipaddr($dnss)) {
$resolvconf .= "nameserver $dnss\n";
$havedns = true;
}