X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-oper.c;h=b54dc592a4350664c90a2c13e03d058c7be1b794;hb=6725d7893ca62007ba828b9d8eb94e81f275a880;hp=ea64958aea93e734ce083b3b3f6a57e4e6563f88;hpb=d645ce86e9440a891b80bfd2907617e16aa799e8;p=ngircd-alex.git diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index ea64958a..b54dc592 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: irc-oper.c,v 1.6 2002/08/26 23:39:22 alex Exp $ + * $Id: irc-oper.c,v 1.11 2002/11/30 15:04:57 alex Exp $ * * irc-oper.c: IRC-Operator-Befehle */ @@ -44,8 +44,6 @@ IRC_OPER( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); - /* Falsche Anzahl Parameter? */ if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); @@ -88,8 +86,6 @@ IRC_DIE( CLIENT *Client, REQUEST *Req ) assert( Client != NULL ); assert( Req != NULL ); - if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); - /* Falsche Anzahl Parameter? */ if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); @@ -102,12 +98,28 @@ IRC_DIE( CLIENT *Client, REQUEST *Req ) GLOBAL BOOLEAN -IRC_RESTART( CLIENT *Client, REQUEST *Req ) +IRC_REHASH( CLIENT *Client, REQUEST *Req ) { assert( Client != NULL ); assert( Req != NULL ); - if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); + /* Falsche Anzahl Parameter? */ + if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + + if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); + + Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\", re-reading configuration ...", Client_Mask( Client )); + NGIRCd_Rehash( ); + + return CONNECTED; +} /* IRC_REHASH */ + + +GLOBAL BOOLEAN +IRC_RESTART( CLIENT *Client, REQUEST *Req ) +{ + assert( Client != NULL ); + assert( Req != NULL ); /* Falsche Anzahl Parameter? */ if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); @@ -123,16 +135,14 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) GLOBAL BOOLEAN IRC_CONNECT(CLIENT *Client, REQUEST *Req ) { - /* Vorlaeufige Version zu Debug-Zwecken ... */ + /* Vorlaeufige Version zu Debug-Zwecken: es wird einfach + * der "passive mode" aufgehoben, mehr passiert nicht ... */ assert( Client != NULL ); assert( Req != NULL ); - if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); - /* Falsche Anzahl Parameter? */ if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); - if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); Log( LOG_NOTICE|LOG_snotice, "Got CONNECT command from \"%s\".", Client_Mask( Client ));