Author: Isomer <perry@coders.net>
[ircu2.10.12-pk.git] / ircd / parse.c
index 9d76052616dccf2ab979fcc975ce5baad3dc2857..7fb9571954dc73335d728507b2639c0a07c60229 100644 (file)
@@ -29,7 +29,6 @@
 #include "ircd_chattr.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
-#include "map.h"
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
@@ -207,7 +206,7 @@ struct Message msgtab[] = {
     TOK_ERROR,
     0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
     /* UNREG, CLIENT, SERVER, OPER, SERVICE */
-    { mr_error, m_ignore, ms_error, m_ignore, m_ignore }
+    { m_ignore, m_ignore, ms_error, m_ignore, m_ignore }
   },
   {
     MSG_KILL,
@@ -312,7 +311,7 @@ struct Message msgtab[] = {
     TOK_PASS,
     0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
     /* UNREG, CLIENT, SERVER, OPER, SERVICE */
-    { m_pass, m_registered, m_ignore, m_registered, m_ignore }
+    { mr_pass, m_registered, m_ignore, m_registered, m_ignore }
   },
   {
     MSG_LUSERS,
@@ -532,6 +531,19 @@ struct Message msgtab[] = {
     /* UNREG, CLIENT, SERVER, OPER, SERVICE */
     { m_proto, m_proto, m_proto, m_proto, m_ignore }
   },
+  /* This command is an alias for QUIT during the unregistered part of
+   * of the server.  This is because someone jumping via a broken web
+   * proxy will send a 'POST' as their first command - which we will
+   * obviously disconnect them immediately for, stopping people abusing
+   * open gateways
+   */
+  {
+    MSG_POST,
+    TOK_POST,
+    0, MAXPARA, MFLG_SLOW, 0,
+    /* UNREG, CLIENT, SERVER, OPER, SERVICE */
+    { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
+  },  
   { 0 }
 }; 
 
@@ -694,7 +706,7 @@ void initmsgtree(void)
   int ii;
   struct Message **msgtab_tok;
   struct Message **msgtok;
-
+  
   for (i = 0; msg->cmd; ++i, ++msg)
     continue;
   qsort(msgtab, i, sizeof(struct Message),
@@ -769,7 +781,7 @@ int parse_client(struct Client *cptr, char *buffer, char *bufend)
   struct Message* mptr;
   MessageHandler  handler = 0;
 
-  Debug((DEBUG_DEBUG, "Parsing: %s", buffer));
+  Debug((DEBUG_DEBUG, "Client Parsing: %s", buffer));
 
   if (IsDead(cptr))
     return 0;
@@ -914,7 +926,7 @@ int parse_server(struct Client *cptr, char *buffer, char *bufend)
   int             paramcount;
   struct Message* mptr;
 
-  Debug((DEBUG_DEBUG, "Parsing: %s", buffer));
+  Debug((DEBUG_DEBUG, "Server Parsing: %s", buffer));
 
 #ifdef GODMODE
   len = strlen(buffer);