about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2012-12-31 21:46:41 +0100
committerAlexander Barton <alex@barton.de>2012-12-31 21:46:48 +0100
commit3e47bc9af511716bbe388f0a29b5fdbb617cee4c (patch)
tree658ef99162757ea4c99e2b1fc069bf9305d06639 /src
parent5d921984873b708c2f91bed01689f6351d95c233 (diff)
downloadngircd-3e47bc9af511716bbe388f0a29b5fdbb617cee4c.tar.gz
ngircd-3e47bc9af511716bbe388f0a29b5fdbb617cee4c.zip
Allow ERROR command on server and service links only
Ignore it and add a penalty time on all other link types.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index 63c4813a..a678f904 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -81,6 +81,17 @@ IRC_ERROR( CLIENT *Client, REQUEST *Req )
 	assert( Client != NULL );
 	assert( Req != NULL );
 
+	if (Client_Type(Client) != CLIENT_GOTPASS
+	    && Client_Type(Client) != CLIENT_GOTPASS_2813
+	    && Client_Type(Client) != CLIENT_UNKNOWNSERVER
+	    && Client_Type(Client) != CLIENT_SERVER
+	    && Client_Type(Client) != CLIENT_SERVICE) {
+		LogDebug("Ignored ERROR command from \"%s\" ...",
+			 Client_Mask(Client));
+		IRC_SetPenalty(Client, 2);
+		return CONNECTED;
+	}
+
 	if (Req->argc < 1)
 		Log(LOG_NOTICE, "Got ERROR from \"%s\"!",
 		    Client_Mask(Client));