Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2007-05-29 03:08:44 UTC

Modified files:
  Tag: u2_10_12_branch
     ircd/s_err.c ircd/s_bsd.c include/numeric.h ChangeLog

Log message:

Complain to the client when it sends a line that is too long.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.192 ircu2.10/ChangeLog:1.710.2.193
--- ircu2.10/ChangeLog:1.710.2.192      Sun May 20 08:01:19 2007
+++ ircu2.10/ChangeLog  Mon May 28 20:08:34 2007
@@ -1,3 +1,11 @@
+2007-05-28  Michael Poole <[EMAIL PROTECTED]>
+
+       * include/numeric.h (ERR_INPUTTOOLONG): New numeric.
+
+       * ircd/s_bsd.c (read_packet): Use it.
+
+       * ircd/s_err.c (replyTable): Give it a format string.
+
 2007-05-20  Michael Poole <[EMAIL PROTECTED]>
 
        * ircd/m_burst.c (ms_burst): Do not let bursting servers join a
Index: ircu2.10/include/numeric.h
diff -u ircu2.10/include/numeric.h:1.41 ircu2.10/include/numeric.h:1.41.2.1
--- ircu2.10/include/numeric.h:1.41     Mon Aug 29 14:39:26 2005
+++ ircu2.10/include/numeric.h  Mon May 28 20:08:33 2007
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Declarations of numeric replies and supporting functions.
- * @version $Id: numeric.h,v 1.41 2005/08/29 21:39:26 entrope Exp $
+ * @version $Id: numeric.h,v 1.41.2.1 2007/05/29 03:08:33 entrope Exp $
  */
 #ifndef INCLUDED_numeric_h
 #define INCLUDED_numeric_h
@@ -336,6 +336,7 @@
      /* ERR_BADMASK          415           IRCnet extension */
 #define ERR_QUERYTOOLONG     416        /* Undernet extension */
      /* ERR_TOOMANYMATCHES   416           IRCnet extension */
+#define ERR_INPUTTOOLONG     417
 /*      ERR_LENGTHTRUNCATED  419           aircd */
 
 #define ERR_UNKNOWNCOMMAND   421
Index: ircu2.10/ircd/s_bsd.c
diff -u ircu2.10/ircd/s_bsd.c:1.80.2.3 ircu2.10/ircd/s_bsd.c:1.80.2.4
--- ircu2.10/ircd/s_bsd.c:1.80.2.3      Sun Jan 14 19:08:23 2007
+++ ircu2.10/ircd/s_bsd.c       Mon May 28 20:08:33 2007
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Functions that now (or in the past) relied on BSD APIs.
- * @version $Id: s_bsd.c,v 1.80.2.3 2007/01/15 03:08:23 entrope Exp $
+ * @version $Id: s_bsd.c,v 1.80.2.4 2007/05/29 03:08:33 entrope Exp $
  */
 #include "config.h"
 
@@ -635,7 +635,13 @@
         if (DBufLength(&(cli_recvQ(cptr))) < 510)
           SetFlag(cptr, FLAG_NONL);
         else
+        {
+          /* More than 512 bytes in the line - drop the input and yell
+           * at the client.
+           */
           DBufClear(&(cli_recvQ(cptr)));
+          send_reply(cptr, ERR_INPUTTOOLONG);
+        }
       }
       else if (client_dopacket(cptr, dolen) == CPTR_KILLED)
         return CPTR_KILLED;
Index: ircu2.10/ircd/s_err.c
diff -u ircu2.10/ircd/s_err.c:1.72.2.6 ircu2.10/ircd/s_err.c:1.72.2.7
--- ircu2.10/ircd/s_err.c:1.72.2.6      Sun May 20 07:01:07 2007
+++ ircu2.10/ircd/s_err.c       Mon May 28 20:08:33 2007
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Error handling support.
- * @version $Id: s_err.c,v 1.72.2.6 2007/05/20 14:01:07 entrope Exp $
+ * @version $Id: s_err.c,v 1.72.2.7 2007/05/29 03:08:33 entrope Exp $
  */
 #include "config.h"
 
@@ -866,7 +866,7 @@
 /* 416 */
   { ERR_QUERYTOOLONG, "%s :Too many lines in the output, restrict your query", 
"416" },
 /* 417 */
-  { 0 },
+  { ERR_INPUTTOOLONG, ":Input line was too long", "417" },
 /* 418 */
   { 0 },
 /* 419 */
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to