mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Fix CommandFloodPenalty overflow on connect
This commit is contained in:
parent
55a095e924
commit
70b8955adf
@ -56,11 +56,11 @@ class CloakUser : public ModeHandler
|
||||
return MODEACTION_ALLOW;
|
||||
}
|
||||
|
||||
if (adding && !dest->IsModeSet('x'))
|
||||
{
|
||||
/* don't allow this user to spam modechanges */
|
||||
IS_LOCAL(dest)->CommandFloodPenalty += 5000;
|
||||
|
||||
if (adding && !dest->IsModeSet('x'))
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
@ -863,6 +863,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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user