]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Forward-port of r12333, clone-counting fix for m_cgiirc
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 30 Jan 2010 23:03:59 +0000 (23:03 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 30 Jan 2010 23:03:59 +0000 (23:03 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12335 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_cgiirc.cpp

index 996ba7199a17ca4204fa7dcb1b613fb496edb9c4..45447148bcde234da90f29ed3708f7631eaf9c26 100644 (file)
@@ -119,9 +119,6 @@ class CGIResolver : public Resolver
 
                        them->host.assign(result,0, 64);
                        them->dhost.assign(result, 0, 64);
-                       if (querytype)
-                               them->SetClientIP(result.c_str());
-                       them->ident.assign("~cgiirc", 0, 8);
                        them->InvalidateCache();
                        them->CheckLines(true);
                }
@@ -288,35 +285,24 @@ public:
                        user->dhost.assign(user->password, 0, 64);
                        user->InvalidateCache();
 
-                       bool valid = false;
                        ServerInstance->Users->RemoveCloneCounts(user);
-                       valid = user->SetClientIP(user->password.c_str());
+                       user->SetClientIP(user->password.c_str());
                        ServerInstance->Users->AddLocalClone(user);
                        ServerInstance->Users->AddGlobalClone(user);
                        user->SetClass();
                        user->CheckClass();
 
-                       if (valid)
+                       try
                        {
-                               /* We were given a IP in the password, we don't do DNS so they get this is as their host as well. */
-                               if(NotifyOpers)
-                                       ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick.c_str(), user->host.c_str(), user->password.c_str());
+
+                               bool cached;
+                               CGIResolver* r = new CGIResolver(this, NotifyOpers, user->password, false, user, user->GetFd(), "PASS", cached);
+                               ServerInstance->AddResolver(r, cached);
                        }
-                       else
+                       catch (...)
                        {
-                               /* We got as resolved hostname in the password. */
-                               try
-                               {
-
-                                       bool cached;
-                                       CGIResolver* r = new CGIResolver(this, NotifyOpers, user->password, false, user, user->GetFd(), "PASS", cached);
-                                       ServerInstance->AddResolver(r, cached);
-                               }
-                               catch (...)
-                               {
-                                       if (NotifyOpers)
-                                               ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host.c_str());
-                               }
+                               if (NotifyOpers)
+                                       ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host.c_str());
                        }
 
                        user->password.clear();