Add comments around some IRC_SetPenalty() calls

This commit is contained in:
Federico G. Schwindt 2013-11-07 18:17:58 +00:00
parent 344185b1bd
commit 9ee3760493
2 changed files with 3 additions and 1 deletions

View File

@ -189,7 +189,7 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
} }
} }
/* If there are a lot of clients, augment penalty a bit */ /* If there are a lot of clients, increase the penalty a bit */
if (count > MAX_RPL_WHO) if (count > MAX_RPL_WHO)
IRC_SetPenalty(Client, 1); IRC_SetPenalty(Client, 1);
@ -1233,6 +1233,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
continue; continue;
} }
got_wildcard = true; got_wildcard = true;
/* Increase penalty for wildcard queries */
IRC_SetPenalty(Client, 3); IRC_SetPenalty(Client, 3);
for (c = Client_First(); c; c = Client_Next(c)) { for (c = Client_First(); c; c = Client_Next(c)) {

View File

@ -50,6 +50,7 @@ Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg)
{ {
Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s", Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s",
Client_Mask(Client), errtoken, errmsg); Client_Mask(Client), errtoken, errmsg);
/* Increase penalty to slow down possible brute force attacks */
IRC_SetPenalty(Client, 10); IRC_SetPenalty(Client, 10);
return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG, return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
Client_ID(Client)); Client_ID(Client));