From 64aaddf70f2076cfb005f4e2aa1881957c52f704 Mon Sep 17 00:00:00 2001 From: Jeb Campbell Date: Thu, 7 Jul 2005 15:38:30 +0000 Subject: [PATCH] Sanity checks (ie. is_ipaddr() ) when generating resolv.conf. Specifically this fixes importing nameserver.conf from the dhclient-script. --- etc/inc/system.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 60082e4a69..f4b7c9fbba 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -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; }