mirror of
https://github.com/anope/anope.git
synced 2026-07-04 06:43:13 +02:00
Only bad-password users when the account theyre trying to identify for actually exists
This commit is contained in:
@@ -62,9 +62,14 @@ class NSGroupRequest : public IdentifyRequest
|
||||
if (!source.GetUser())
|
||||
return;
|
||||
|
||||
Log(LOG_COMMAND, source, cmd) << "failed group for " << target->nick;
|
||||
source.Reply(PASSWORD_INCORRECT);
|
||||
source.GetUser()->BadPassword();
|
||||
Log(LOG_COMMAND, source, cmd) << "and failed to group to " << target->nick;
|
||||
if (NickAlias::Find(GetAccount()) != NULL)
|
||||
{
|
||||
source.Reply(PASSWORD_INCORRECT);
|
||||
source.GetUser()->BadPassword();
|
||||
}
|
||||
else
|
||||
source.Reply(NICK_X_NOT_REGISTERED, GetAccount().c_str());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,8 +48,13 @@ class NSIdentifyRequest : public IdentifyRequest
|
||||
if (source.GetUser())
|
||||
{
|
||||
Log(LOG_COMMAND, source, cmd) << "and failed to identify";
|
||||
source.Reply(PASSWORD_INCORRECT);
|
||||
source.GetUser()->BadPassword();
|
||||
if (NickAlias::Find(GetAccount()) != NULL)
|
||||
{
|
||||
source.Reply(PASSWORD_INCORRECT);
|
||||
source.GetUser()->BadPassword();
|
||||
}
|
||||
else
|
||||
source.Reply(NICK_X_NOT_REGISTERED, GetAccount().c_str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -106,13 +106,18 @@ class NSRecoverRequest : public IdentifyRequest
|
||||
|
||||
void OnFail() anope_override
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
if (!GetPassword().empty())
|
||||
if (NickAlias::Find(GetAccount()) != NULL)
|
||||
{
|
||||
Log(LOG_COMMAND, source, cmd) << "with an invalid password for " << GetAccount();
|
||||
if (source.GetUser())
|
||||
source.GetUser()->BadPassword();
|
||||
source.Reply(ACCESS_DENIED);
|
||||
if (!GetPassword().empty())
|
||||
{
|
||||
Log(LOG_COMMAND, source, cmd) << "with an invalid password for " << GetAccount();
|
||||
if (source.GetUser())
|
||||
source.GetUser()->BadPassword();
|
||||
}
|
||||
}
|
||||
else
|
||||
source.Reply(NICK_X_NOT_REGISTERED, GetAccount().c_str());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user