diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-23 14:51:43 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-23 14:51:43 +0000 |
commit | fea69b05696db26abef5a113b0868034e4370338 (patch) | |
tree | 5ab2b86100a60478de939b84311101f394b6605c /src | |
parent | 5a8d1f3298512a37e0b5e628da9113ba9bc8ab63 (diff) |
Fix CommandFloodPenalty overflow on connect
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12659 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_cloaking.cpp | 9 | ||||
-rw-r--r-- | src/users.cpp | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 8021fcbd4..5b485704b 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -56,11 +56,11 @@ class CloakUser : public ModeHandler return MODEACTION_ALLOW; } - /* don't allow this user to spam modechanges */ - IS_LOCAL(dest)->CommandFloodPenalty += 5000; - if (adding && !dest->IsModeSet('x')) { + /* don't allow this user to spam modechanges */ + IS_LOCAL(dest)->CommandFloodPenalty += 5000; + std::string* cloak = ext.get(dest); if (!cloak) @@ -78,6 +78,9 @@ class CloakUser : public ModeHandler } else if (!adding && dest->IsModeSet('x')) { + /* don't allow this user to spam modechanges */ + IS_LOCAL(dest)->CommandFloodPenalty += 5000; + /* User is removing the mode, so restore their real host * and make it match the displayed one. */ diff --git a/src/users.cpp b/src/users.cpp index b188eaaed..f6010bf38 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -835,6 +835,8 @@ void LocalUser::FullConnect() this->GetServerPort(), this->nick.c_str(), this->ident.c_str(), this->host.c_str(), this->GetIPString(), this->fullname.c_str()); ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding NEGATIVE hit for %s", this->GetIPString()); ServerInstance->BanCache->AddHit(this->GetIPString(), "", ""); + // reset the flood penalty (which could have been raised due to things like auto +x) + CommandFloodPenalty = 0; } void User::InvalidateCache() |