]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Add comments around some IRC_SetPenalty() calls
authorFederico G. Schwindt <fgsch@lodoss.net>
Thu, 7 Nov 2013 18:17:58 +0000 (18:17 +0000)
committerFederico G. Schwindt <fgsch@lodoss.net>
Thu, 7 Nov 2013 18:17:58 +0000 (18:17 +0000)
src/ngircd/irc-info.c
src/ngircd/irc-oper.c

index f1d02711b35cfba3de103bfa836c366a40ad21c8..56cae2acd973d238f01add89ed0c86fa6e2ea6da 100644 (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)
                IRC_SetPenalty(Client, 1);
 
        if (count > MAX_RPL_WHO)
                IRC_SetPenalty(Client, 1);
 
@@ -1233,6 +1233,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
                        continue;
                }
                got_wildcard = true;
                        continue;
                }
                got_wildcard = true;
+               /* Increase penalty for wildcard queries */
                IRC_SetPenalty(Client, 3);
 
                for (c = Client_First(); c; c = Client_Next(c)) {
                IRC_SetPenalty(Client, 3);
 
                for (c = Client_First(); c; c = Client_Next(c)) {
index 0b50bca659e40c3f89ed217c00d0ccf1de060be1..ab4023ac9c964471aa4e6b025d80a19221978c93 100644 (file)
@@ -50,6 +50,7 @@ Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg)
 {
        Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s",
            Client_Mask(Client), errtoken, errmsg);
 {
        Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s",
            Client_Mask(Client), errtoken, errmsg);
+       /* Increase penalty to slow down possible brute force attacks */
        IRC_SetPenalty(Client, 10);
        return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
                                  Client_ID(Client));
        IRC_SetPenalty(Client, 10);
        return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
                                  Client_ID(Client));