about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJames Lu <james@overdrivenetworks.com>2017-09-26 13:50:20 -0700
committerAlexander Barton <alex@barton.de>2017-09-26 22:50:20 +0200
commite009fc87d54602cc2a4d9b60257f40bad14fc081 (patch)
treeb709b5b527b26365a8ec5343ca373e09b4293fb7 /src
parentc37d6971d66a2d840a2b20fe2b995443c2bd6c87 (diff)
downloadngircd-e009fc87d54602cc2a4d9b60257f40bad14fc081.tar.gz
ngircd-e009fc87d54602cc2a4d9b60257f40bad14fc081.zip
Don't forward KILLs to other servers if they've been blocked locally
This prevents clients from killing IRC services, for example.

Closes #238.
Closes #239.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index d5e4bde3..a6f04cba 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -362,11 +362,6 @@ IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reaso
 		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
@@ -388,6 +383,12 @@ IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reaso
 		    Client_Type(c), Nick);
 	}
 
+	/* Inform other servers */
+	IRC_WriteStrServersPrefix(From ? Client : NULL,
+				  From ? From : Client_ThisServer(),
+				  "KILL %s :%s", Nick, Reason);
+
+
 	/* Save ID of this connection */
 	if (Client)
 		my_conn = Client_Conn(Client);