diff options
| author | Alexander Barton <alex@barton.de> | 2002-12-27 13:17:04 +0000 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2002-12-27 13:17:04 +0000 |
| commit | 01bec0daa2c010f6b4c8bac230edd4565ee03894 (patch) | |
| tree | 5f30f06389b20c48d22d549261b89324487ab7e4 | |
| parent | d19813cc4becd530897df834de2ef6847a4b68d4 (diff) | |
| download | ngircd-01bec0daa2c010f6b4c8bac230edd4565ee03894.tar.gz ngircd-01bec0daa2c010f6b4c8bac230edd4565ee03894.zip | |
- KILL can't kill server-links any more.
| -rw-r--r-- | src/ngircd/irc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index 56070951..0f24ae6e 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -14,7 +14,7 @@ #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.111 2002/12/27 13:17:04 alex Exp $"; #include "imp.h" #include <assert.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( prefix, ERR_CANTKILLSERVER_MSG, Client_ID( prefix )); + else if( Client_Type( c ) != CLIENT_USER )IRC_WriteStrClient( prefix, ERR_NOPRIVILEGES_MSG, Client_ID( prefix )); + 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] ); |