From a5da688e2bb2ba78298a26f14f6dde28e9c47894 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 12 Aug 2006 20:27:30 +0000 Subject: Make sure that the hostname isnt set after the timeout period git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4912 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/users.cpp b/src/users.cpp index 84bdbb9d6..84f762640 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -149,8 +149,12 @@ void UserResolver::OnLookupComplete(const std::string &result) this->bound_user->stored_host = result; try { - bound_user->res_forward = new UserResolver(this->ServerInstance, this->bound_user, result, true); - this->ServerInstance->AddResolver(bound_user->res_forward); + /* Check we didnt time out */ + if (this->bound_user->registered != REG_ALL) + { + bound_user->res_forward = new UserResolver(this->ServerInstance, this->bound_user, result, true); + this->ServerInstance->AddResolver(bound_user->res_forward); + } } catch (ModuleException& e) { @@ -165,14 +169,18 @@ void UserResolver::OnLookupComplete(const std::string &result) std::string hostname = this->bound_user->stored_host; if (hostname.length() < 65) { - /* Hostnames starting with : are not a good thing (tm) */ - if (*(hostname.c_str()) == ':') - hostname = "0" + hostname; - - this->bound_user->WriteServ("NOTICE Auth :*** Found your hostname (%s)", hostname.c_str()); - this->bound_user->dns_done = true; - strlcpy(this->bound_user->dhost, hostname.c_str(),64); - strlcpy(this->bound_user->host, hostname.c_str(),64); + /* Check we didnt time out */ + if (this->bound_user->registered != REG_ALL) + { + /* Hostnames starting with : are not a good thing (tm) */ + if (*(hostname.c_str()) == ':') + hostname = "0" + hostname; + + this->bound_user->WriteServ("NOTICE Auth :*** Found your hostname (%s)", hostname.c_str()); + this->bound_user->dns_done = true; + strlcpy(this->bound_user->dhost, hostname.c_str(),64); + strlcpy(this->bound_user->host, hostname.c_str(),64); + } } else { -- cgit v1.2.3