X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc.c;h=bd44f4674074f25c0c0ba66bf1d920c75bf12c96;hp=56070951cec17bcc8beeb722fbb755a1f5ac064b;hb=b8d7dcec7739aab840fc1ccae8e4dfaa8db330a1;hpb=4d2f279d2d4fdb6dca8ac0ec3abd79071c884d64 diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index 56070951..bd44f467 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -14,14 +14,14 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc.c,v 1.110 2002/12/26 18:41:00 alex Exp $"; +static char UNUSED id[] = "$Id: irc.c,v 1.113 2002/12/30 17:15:42 alex Exp $"; #include "imp.h" #include #include #include -#include "conn.h" +#include "conn-func.h" #include "client.h" #include "channel.h" #include "defines.h" @@ -84,10 +84,16 @@ IRC_KILL( CLIENT *Client, REQUEST *Req ) c = Client_Search( Req->argv[0] ); if( c ) { - /* Ja, wir haben einen solchen Client */ - conn = Client_Conn( c ); - Client_Destroy( c, NULL, reason, FALSE ); - if( conn != NONE ) Conn_Close( Client_Conn( c ), NULL, reason, TRUE ); + /* Yes, there is such a client -- but is it a valid user? */ + if( Client_Type( c ) == CLIENT_SERVER ) IRC_WriteStrClient( Client, ERR_CANTKILLSERVER_MSG, Client_ID( Client )); + else if( Client_Type( c ) != CLIENT_USER )IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); + else + { + /* Kill user NOW! */ + conn = Client_Conn( c ); + Client_Destroy( c, NULL, reason, FALSE ); + if( conn != NONE ) Conn_Close( Client_Conn( c ), NULL, reason, TRUE ); + } } else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );