diff options
Diffstat (limited to 'src/modules/m_cgiirc.cpp')
-rw-r--r-- | src/modules/m_cgiirc.cpp | 32 |
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(); |