]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Allow ERROR command on server and service links only
authorAlexander Barton <alex@barton.de>
Mon, 31 Dec 2012 20:46:41 +0000 (21:46 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 31 Dec 2012 20:46:48 +0000 (21:46 +0100)
Ignore it and add a penalty time on all other link types.

src/ngircd/irc.c

index 63c4813a361e6b464f6b3ae7699c7af70170403f..a678f9048e68d0c27b43d55533e333621d730543 100644 (file)
@@ -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));