From a7091e0ea47de0ac6ef716d527a3606b5a03492f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Jun 2007 20:51:22 +0000 Subject: 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 --- src/configreader.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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: 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," set to '%s' as first active resolver in registry.", nameserver.c_str()); #else -- cgit v1.2.3