]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Make sure that the hostname isnt set after the timeout period
[user/henk/code/inspircd.git] / src / users.cpp
index 41d25cf53de8edc88b94f05604bbee5b63f4d5b8..84f762640d0bee014725444234267c03cdc0cbaf 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdarg.h>
 #include "inspstring.h"
 #include "commands.h"
-#include "helperfuncs.h"
+
 #include "typedefs.h"
 #include "socketengine.h"
 #include "hashcomp.h"
@@ -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
                        {