summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorJeb Campbell <jeb-c4@pfsense.org>2005-07-07 15:38:30 +0000
committerJeb Campbell <jeb-c4@pfsense.org>2005-07-07 15:38:30 +0000
commit64aaddf70f2076cfb005f4e2aa1881957c52f704 (patch)
tree4c3c28d984b4415b773ca82d795d1a67c9e11230 /etc
parent984a5853eccfe4d78183d4f40f677c3c6add9e7a (diff)
downloadpfsense-64aaddf70f2076cfb005f4e2aa1881957c52f704.zip
pfsense-64aaddf70f2076cfb005f4e2aa1881957c52f704.tar.gz
Sanity checks (ie. is_ipaddr() ) when generating resolv.conf.
Specifically this fixes importing nameserver.conf from the dhclient-script.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/system.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 60082e4..f4b7c9f 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;
}
OpenPOWER on IntegriCloud