diff options
author | Ermal <eri@pfsense.org> | 2011-01-04 18:32:52 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-01-04 18:32:52 +0000 |
commit | 807fd6cd358c71dd48fb7766e49f05f86b93d3fb (patch) | |
tree | 8165871ccc86c8a58aeecdaf05d8806976ecd0ec /etc/inc/system.inc | |
parent | abe7607f691caeb40518c63eb8c9cc8a847af424 (diff) | |
download | pfsense-807fd6cd358c71dd48fb7766e49f05f86b93d3fb.zip pfsense-807fd6cd358c71dd48fb7766e49f05f86b93d3fb.tar.gz |
Unbreak dns server colletion. Pointyhat: myself
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index ad7a9ef..bdd8157 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -160,9 +160,14 @@ function get_searchdomains() { // Read in dhclient nameservers $search_list = glob("/var/etc/searchdomain_*"); if (is_array($search_lists)) { - foreach($search_lists as $dns) { - if(is_hostname($dns)) - $master_list[] = $dns; + foreach($search_lists as $fdns) { + $contents = file($fdns, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (!is_array($contents)) + continue; + foreach ($contents as $dns) { + if(is_hostname($dns)) + $master_list[] = $dns; + } } } @@ -176,9 +181,14 @@ function get_nameservers() { // Read in dhclient nameservers $dns_lists = glob("/var/etc/nameserver_*"); if (is_array($dns_lists)) { - foreach($dns_lists as $dns) { - if(is_ipaddr($dns)) - $master_list[] = $dns; + foreach($dns_lists as $fdns) { + $contents = file($fdns, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (!is_array($contents)) + continue; + foreach ($contents as $dns) { + if(is_ipaddr($dns)) + $master_list[] = $dns; + } } } |