]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Bad_OperPass(): code cleanup.
authorAlexander Barton <alex@barton.de>
Sun, 13 Apr 2008 15:30:04 +0000 (17:30 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 30 Sep 2009 14:00:05 +0000 (16:00 +0200)
src/ngircd/irc-oper.c

index b0271df2576a99dff7f3d493034a0765e53b57e3..736163c107e6b6b135ddde4370b8eb720811f77d 100644 (file)
 #include "irc-oper.h"
 
 
+/**
+ * Handle invalid received OPER command.
+ * Log OPER attempt and send error message to client.
+ */
 static bool
 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);
        IRC_SetPenalty(Client, 3);
-       return IRC_WriteStrClient( Client, ERR_PASSWDMISMATCH_MSG, Client_ID( Client ));
-}
+       return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
+                                 Client_ID(Client));
+} /* Bad_OperPass */
 
 
 GLOBAL bool
@@ -63,7 +68,7 @@ IRC_OPER( CLIENT *Client, REQUEST *Req )
                return Bad_OperPass(Client, Req->argv[0], "not configured");
 
        if( strcmp( Conf_Oper[i].pwd, Req->argv[1] ) != 0 )
-               return Bad_OperPass(Client, Conf_Oper[i].name, "Bad password");
+               return Bad_OperPass(Client, Conf_Oper[i].name, "bad password");
 
        if( Conf_Oper[i].mask && (! Match( Conf_Oper[i].mask, Client_Mask( Client ) )))
                return Bad_OperPass(Client, Conf_Oper[i].mask, "hostmask check failed" );