From 61569b65f2a549f4da48a8bccc165c501c1fcb41 Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 4 Mar 2007 15:42:55 -0800 Subject: [PATCH] [svn] Cut down quit/part/kick reasons to avoid quit reasons overflowing the client exiting server notice (from TOPICLEN to 260). kill reasons become shorter accordingly. kline/dline/gline reasons become 390. away messages stay at TOPICLEN for now. --- ChangeLog | 10 ++++++++++ include/ircd_defs.h | 13 +++++++++---- include/serno.h | 2 +- modules/m_dline.c | 8 ++++---- modules/m_gline.c | 12 ++++++------ modules/m_kline.c | 8 ++++---- 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index eff68c7c2..d84b20957 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +jilles 2007/03/02 17:45:47 UTC (20070302-3223) + Log: + Don't leak auth{} spoofed IP addresses in +f notices. + from ratbox (androsyn) + + + Changes: Modified: + +10 -3 trunk/src/s_conf.c (File Modified) + + jilles 2007/02/24 19:34:28 UTC (20070224-3219) Log: Make oper_up() take +i/-i during opering up into account diff --git a/include/ircd_defs.h b/include/ircd_defs.h index 66918e3b7..fc1d3bd41 100644 --- a/include/ircd_defs.h +++ b/include/ircd_defs.h @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: ircd_defs.h 865 2006-02-16 14:05:37Z nenolod $ + * $Id: ircd_defs.h 3225 2007-03-04 23:42:55Z jilles $ */ /* @@ -101,9 +101,14 @@ #define LOC_CHANNELLEN 50 /* reason length of klines, parts, quits etc */ -#define REASONLEN TOPICLEN /* in charybdis, reasonlen is controlled via topiclen */ -#define AWAYLEN TOPICLEN /* ditto for awaylen */ -#define KILLLEN TOPICLEN /* and killlen. have a nice day. --nenolod */ +/* for quit messages, note that a client exit server notice + * :012345678901234567890123456789012345678901234567890123456789123 NOTICE * :*** Notice -- Client exiting: 012345678901234567 (0123456789@012345678901234567890123456789012345678901234567890123456789123) [] [1111:2222:3333:4444:5555:6666:7777:8888] + * takes at most 246 bytes (including CRLF and '\0') and together with the + * quit reason should fit in 512 */ +#define REASONLEN 260 /* kick/part/quit */ +#define BANREASONLEN 390 /* kline/dline/gline */ +#define AWAYLEN TOPICLEN +#define KILLLEN 200 /* with Killed (nick ()) added this should fit in quit */ /* 23+1 for \0 */ #define KEYLEN 24 diff --git a/include/serno.h b/include/serno.h index d15786a15..a00298d52 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070224-3219" +#define SERNO "20070302-3223" diff --git a/modules/m_dline.c b/modules/m_dline.c index 98ac14291..f173d05c6 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_dline.c 3161 2007-01-25 07:23:01Z nenolod $ + * $Id: m_dline.c 3225 2007-03-04 23:42:55Z jilles $ */ #include "stdinc.h" @@ -59,7 +59,7 @@ struct Message undline_msgtab = { }; mapi_clist_av1 dline_clist[] = { &dline_msgtab, &undline_msgtab, NULL }; -DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 3161 $"); +DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 3225 $"); static int valid_comment(char *comment); static int flush_write(struct Client *, FILE *, char *, char *); @@ -393,8 +393,8 @@ valid_comment(char *comment) if(strchr(comment, '"')) return 0; - if(strlen(comment) > REASONLEN) - comment[REASONLEN] = '\0'; + if(strlen(comment) > BANREASONLEN) + comment[BANREASONLEN] = '\0'; return 1; } diff --git a/modules/m_gline.c b/modules/m_gline.c index 5c315539e..ad156283d 100644 --- a/modules/m_gline.c +++ b/modules/m_gline.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_gline.c 3161 2007-01-25 07:23:01Z nenolod $ + * $Id: m_gline.c 3225 2007-03-04 23:42:55Z jilles $ */ #include "stdinc.h" @@ -63,7 +63,7 @@ struct Message ungline_msgtab = { }; mapi_clist_av1 gline_clist[] = { &gline_msgtab, &ungline_msgtab, NULL }; -DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 3161 $"); +DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 3225 $"); static int majority_gline(struct Client *source_p, const char *user, const char *host, const char *reason); @@ -514,8 +514,8 @@ invalid_gline(struct Client *source_p, const char *luser, return 1; } - if(strlen(lreason) > REASONLEN) - lreason[REASONLEN] = '\0'; + if(strlen(lreason) > BANREASONLEN) + lreason[BANREASONLEN] = '\0'; return 0; } @@ -546,8 +546,8 @@ set_local_gline(struct Client *source_p, const char *user, aconf->status = CONF_GLINE; aconf->flags |= CONF_FLAGS_TEMPORARY; - if(strlen(my_reason) > REASONLEN) - my_reason[REASONLEN-1] = '\0'; + if(strlen(my_reason) > BANREASONLEN) + my_reason[BANREASONLEN-1] = '\0'; if((oper_reason = strchr(my_reason, '|')) != NULL) { diff --git a/modules/m_kline.c b/modules/m_kline.c index 3c1c40f34..4101ec36e 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_kline.c 3161 2007-01-25 07:23:01Z nenolod $ + * $Id: m_kline.c 3225 2007-03-04 23:42:55Z jilles $ */ #include "stdinc.h" @@ -65,7 +65,7 @@ struct Message unkline_msgtab = { }; mapi_clist_av1 kline_clist[] = { &kline_msgtab, &unkline_msgtab, NULL }; -DECLARE_MODULE_AV1(kline, NULL, NULL, kline_clist, NULL, NULL, "$Revision: 3161 $"); +DECLARE_MODULE_AV1(kline, NULL, NULL, kline_clist, NULL, NULL, "$Revision: 3225 $"); /* Local function prototypes */ static int find_user_host(struct Client *source_p, const char *userhost, char *user, char *host); @@ -659,8 +659,8 @@ valid_comment(struct Client *source_p, char *comment) return 0; } - if(strlen(comment) > REASONLEN) - comment[REASONLEN] = '\0'; + if(strlen(comment) > BANREASONLEN) + comment[BANREASONLEN] = '\0'; return 1; }