diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-24 20:51:22 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-24 20:51:22 +0000 |
commit | a7091e0ea47de0ac6ef716d527a3606b5a03492f (patch) | |
tree | c407ca2ca0bf6e7cceb52acd72728d895a4e03df /src | |
parent | 5758cbbd8ed4e8a3c0a1e4844b009457c7f38206 (diff) |
Fix undocumented windows behaviour where multiple dns servers are packed into one registry key seperated by commas
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7408 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 35d8bc927..88b8a9af3 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -225,6 +225,11 @@ bool ValidateDnsServer(ServerConfig* conf, const char* tag, const char* value, V #ifdef WINDOWS conf->GetInstance()->Log(DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in the registry..."); nameserver = FindNameServerWin(); + /* Windows stacks multiple nameservers in one registry key, seperated by commas. + * Spotted by Cataclysm. + */ + if (nameserver.find(',') != std::string::npos) + nameserver = nameserver.substr(0, nameserver.find(',')); data.Set(nameserver.c_str()); conf->GetInstance()->Log(DEFAULT,"<dns:server> set to '%s' as first active resolver in registry.", nameserver.c_str()); #else |