summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-30 23:03:59 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-30 23:03:59 +0000
commitd46783efbda0a89b92175120ed5249a3456e25ee (patch)
treebceecd5feaf096459031693c384a1e637443a924 /src
parent6d3a59101ca5480af0a87735d5b90e5aa482f6de (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_cgiirc.cpp32
1 files 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();