summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-13 17:12:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-13 17:12:06 +0000
commit29ac7ce26d25dbf00a3edc08ecc0821ad7408bef (patch)
tree9d4c1dea3bbeffb23034a5157cc61c3a7e261c76 /src
parent406ab09f22f46a6cee5559e96f0325768188ffa4 (diff)
Fixed some 'unknown command' stuff (sorry w00t) :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1077 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 39fe13317..7b0babd91 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -2827,17 +2827,17 @@ void process_command(userrec *user, char* cmd)
total_params++;
}
}
-
+
// another phidjit bug...
if (total_params > 126)
{
- //kill_link(user,"Protocol violation (1)");
- WriteServ(user->fd,"421 %s * :Unknown command",user->nick);
+ *(strchr(cmd,' ')) = '\0';
+ WriteServ(user->fd,"421 %s %s :Too many parameters given",user->nick,cmd);
return;
}
-
- strlcpy(temp,cmd,MAXBUF);
+ strlcpy(temp,cmd,MAXBUF);
+
std::string tmp = cmd;
for (int i = 0; i <= MODCOUNT; i++)
{
@@ -2915,8 +2915,7 @@ void process_command(userrec *user, char* cmd)
if (strlen(command)>MAXCOMMAND)
{
- //kill_link(user,"Protocol violation (2)");
- WriteServ(user->fd,"421 %s * :Unknown command",user->nick);
+ WriteServ(user->fd,"421 %s %s :Command too long",user->nick,command);
return;
}
@@ -2928,8 +2927,7 @@ void process_command(userrec *user, char* cmd)
{
if (strchr("@!\"$%^&*(){}[]_=+;:'#~,<>/?\\|`",command[x]))
{
- //kill_link(user,"Protocol violation (3)");
- WriteServ(user->fd,"421 %s * :Unknown command",user->nick);
+ WriteServ(user->fd,"421 %s %s :Unknown command",user->nick,command);
return;
}
}
@@ -3959,6 +3957,14 @@ int InspIRCd(void)
if (result)
{
+ // perform a check on the raw buffer as an array (not a string!) to remove
+ // characters 0 and 7 which are illegal in the RFC - replace them with spaces.
+ // hopefully this should stop even more people whining about "Unknown command: *"
+ for (int checker = 0; checker < result; checker++)
+ {
+ if ((data[checker] == 0) || (data[checker] == 7))
+ data[checker] = ' ';
+ }
userrec* current = count2a->second;
int currfd = current->fd;
char* l = strtok(data,"\n");