Skip to content
Snippets Groups Projects
Commit 9f7040d6 authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

Now searches a list of possible locations for resolv.conf.

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.28
parent 1bc9c53c
Branches
Tags
No related merge requests found
...@@ -285,7 +285,10 @@ class client { ...@@ -285,7 +285,10 @@ class client {
nameservers = ({ get_tcpip_param("NameServer") }); nameservers = ({ get_tcpip_param("NameServer") });
domains=get_tcpip_param("SearchList") / " "- ({""}); domains=get_tcpip_param("SearchList") / " "- ({""});
#else #else
string resolv_conf = Stdio.read_file("/etc/resolv.conf"); string resolv_conf;
foreach(({"/etc/resolv.conf", "/amitcp/db/resolv.conf"}), string resolv_loc)
if ((resolv_conf = Stdio.read_file(resolv_loc)))
break;
if (!resolv_conf) { if (!resolv_conf) {
throw(({ "Protocols.DNS.client(): No /etc/resolv.conf!\n", throw(({ "Protocols.DNS.client(): No /etc/resolv.conf!\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment