]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Don't forward KILL commands for unknown clients
authorAlexander Barton <alex@barton.de>
Thu, 26 Sep 2013 00:58:01 +0000 (02:58 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 1 Oct 2013 10:20:23 +0000 (12:20 +0200)
src/ngircd/irc.c

index 74b8a018cf1a5d8dc3da0541964748f186928562..ee7972c215a7534519cea8759d4252341e80ef37 100644 (file)
@@ -346,18 +346,18 @@ IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reaso
        CONN_ID my_conn, conn;
        CLIENT *c;
 
-       /* Inform other servers */
-       IRC_WriteStrServersPrefix(From ? Client : NULL,
-                                 From ? From : Client_ThisServer(),
-                                 "KILL %s :%s", Nick, Reason);
-
-       /* Do we know such a client? */
+       /* Do we know such a client in the network? */
        c = Client_Search(Nick);
        if (!c) {
-               LogDebug("Client with nick \"%s\" is unknown here.", Nick);
+               LogDebug("Client with nick \"%s\" is unknown, not forwaring.", Nick);
                return CONNECTED;
        }
 
+       /* Inform other servers */
+       IRC_WriteStrServersPrefix(From ? Client : NULL,
+                                 From ? From : Client_ThisServer(),
+                                 "KILL %s :%s", Nick, Reason);
+
        if (Client_Type(c) != CLIENT_USER && Client_Type(c) != CLIENT_GOTNICK) {
                /* Target of this KILL is not a regular user, this is
                 * invalid! So we ignore this case if we received a