1
0
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:
Adam
2012-12-02 04:31:50 -05:00
parent faaaae365a
commit 7a865b6b28
3 changed files with 25 additions and 10 deletions
+8 -3
View File
@@ -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());
}
};
+7 -2
View File
@@ -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());
}
}
};
+10 -5
View File
@@ -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());
}
};