about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2005-06-24 20:56:46 +0000
committerAlexander Barton <alex@barton.de>2005-06-24 20:56:46 +0000
commit162338b8c8ffe7a0a83dc0e1e5dbc5b81e9cdc42 (patch)
treec5bad0c58f47c339624cee19d233b0ef88f25184 /src
parentde395db8e3064919bbeaeb8344bf84f9566fb48b (diff)
downloadngircd-162338b8c8ffe7a0a83dc0e1e5dbc5b81e9cdc42.tar.gz
ngircd-162338b8c8ffe7a0a83dc0e1e5dbc5b81e9cdc42.zip
Ignore unknown commands received before the client is registered.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/parse.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c
index e36b3e7e..e0df6d8a 100644
--- a/src/ngircd/parse.c
+++ b/src/ngircd/parse.c
@@ -12,7 +12,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: parse.c,v 1.62 2005/06/01 21:52:18 alex Exp $";
+static char UNUSED id[] = "$Id: parse.c,v 1.63 2005/06/24 20:56:46 alex Exp $";
 
 /**
  * @file
@@ -433,11 +433,23 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
 			return IRC_WriteStrClient( client, ERR_NOTREGISTERED_MSG, Client_ID( client ));
 		}
 	}
+
+	if( Client_Type( client ) != CLIENT_USER &&
+	    Client_Type( client ) != CLIENT_SERVER &&
+	    Client_Type( client ) != CLIENT_SERVICE )
+		return true;
 	
-	/* Unbekannter Befehl */
-	Log( LOG_DEBUG, "Connection %d: Unknown command \"%s\", %d %s,%s prefix.", Client_Conn( client ), Req->command, Req->argc, Req->argc == 1 ? "parameter" : "parameters", Req->prefix ? "" : " no" );
-	if( Client_Type( client ) != CLIENT_SERVER ) return IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );
-	else return true;
+	/* Unknown command and registered connection: generate error: */
+	Log( LOG_DEBUG, "Connection %d: Unknown command \"%s\", %d %s,%s prefix.",
+			Client_Conn( client ), Req->command, Req->argc,
+			Req->argc == 1 ? "parameter" : "parameters",
+			Req->prefix ? "" : " no" );
+
+	if( Client_Type( client ) != CLIENT_SERVER )
+		return IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG,
+				Client_ID( client ), Req->command );
+
+	return true;
 } /* Handle_Request */