From d46783efbda0a89b92175120ed5249a3456e25ee Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 30 Jan 2010 23:03:59 +0000 Subject: [PATCH] Forward-port of r12333, clone-counting fix for m_cgiirc git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12335 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cgiirc.cpp | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 996ba7199..45447148b 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -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(); -- 2.39.5