X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-oper.c;h=2baa6d3d5f811e6fe003f56b9be5023878ba9118;hp=8153e34db459d849e955bb83cf919e277f5d071d;hb=87f4b1c6f64f85556533f01d95da1cf83a91d4c6;hpb=74424cb1a557a4eb203296fdc015865f6260958e diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index 8153e34d..2baa6d3d 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-oper.c,v 1.21 2005/06/12 17:18:27 fw Exp $"; +static char UNUSED id[] = "$Id: irc-oper.c,v 1.25 2006/04/23 10:37:27 fw Exp $"; #include "imp.h" #include @@ -38,18 +38,19 @@ static char UNUSED id[] = "$Id: irc-oper.c,v 1.21 2005/06/12 17:18:27 fw Exp $"; static bool -bad_operpass(CLIENT *Client, char *errtoken, char *errmsg) +Bad_OperPass(CLIENT *Client, char *errtoken, char *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 )); + 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 )); } GLOBAL bool IRC_OPER( CLIENT *Client, REQUEST *Req ) { - int i; + unsigned int i; assert( Client != NULL ); assert( Req != NULL ); @@ -63,15 +64,15 @@ IRC_OPER( CLIENT *Client, REQUEST *Req ) if( Conf_Oper[i].name[0] && Conf_Oper[i].pwd[0] && ( strcmp( Conf_Oper[i].name, Req->argv[0] ) == 0 )) break; } if( i >= Conf_Oper_Count ) - return bad_operpass(Client, Req->argv[0], "not configured"); + return Bad_OperPass(Client, Req->argv[0], "not configured"); /* Stimmt das Passwort? */ 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"); /* Authorized Mask? */ if( Conf_Oper[i].mask && (! Match( Conf_Oper[i].mask, Client_Mask( Client ) ))) - return bad_operpass(Client, Conf_Oper[i].mask, "hostmask check failed" ); + return Bad_OperPass(Client, Conf_Oper[i].mask, "hostmask check failed" ); if( ! Client_HasMode( Client, 'o' )) { @@ -207,7 +208,7 @@ IRC_DISCONNECT(CLIENT *Client, REQUEST *Req ) if( ! Conf_DisableServer( Req->argv[0] )) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] ); /* Are we still connected or were we killed, too? */ - if( Client_GetFromConn( my_conn )) return CONNECTED; + if( Conn_GetClient( my_conn )) return CONNECTED; else return DISCONNECTED; } /* IRC_CONNECT */