From: Michael Poole Date: Wed, 31 Aug 2005 00:12:55 +0000 (+0000) Subject: Make references to channel password lengths consistent. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=37b6a75be889cde071401c28464ae961e650577a Make references to channel password lengths consistent. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1472 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 48d293e..7303bd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-08-30 Michael Poole + + * include/channel.h (PASSLEN): Remove; use KEYLEN instead. + + * ircd/channel.c (mode_parse_upass): Likewise. + (mode_parse_apass): Likewise. + The inconsistency (in clean_key()) was reported by Reed. + 2005-08-30 Michael Poole * RELEASE.NOTES: Document +D and +d channel modes. @@ -13,6 +21,7 @@ (mode_parse_key): Use it, and check that keys do not start with :. (mode_parse_upass): Likewise, and adjust for ERR_NOMANAGER. (mode_parse_apass): Likewise. + The key and password changes fix bugs reported by coekie. 2005-08-27 Michael Poole diff --git a/include/channel.h b/include/channel.h index e0aca8d..c2c12ea 100644 --- a/include/channel.h +++ b/include/channel.h @@ -45,7 +45,6 @@ struct Client; #define MODEBUFLEN 200 /**< Maximum length of a mode */ #define KEYLEN 23 /**< Maximum length of a key */ -#define PASSLEN 23 /**< Maximum length of a password */ #define CHANNELLEN 200 /**< Maximum length of a channel */ #define MAXJOINARGS 15 /**< number of slots for join buffer */ @@ -248,8 +247,8 @@ struct Mode { unsigned int mode; unsigned int limit; char key[KEYLEN + 1]; - char upass[PASSLEN + 1]; - char apass[PASSLEN + 1]; + char upass[KEYLEN + 1]; + char apass[KEYLEN + 1]; }; #define BAN_IPMASK 0x0001 /**< ban mask is an IP-number mask */ diff --git a/ircd/channel.c b/ircd/channel.c index 4cf0ae8..ea2d728 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2527,7 +2527,7 @@ mode_parse_upass(struct ParseState *state, int *flag_p) if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_ADD) /* set the new upass */ - ircd_strncpy(state->chptr->mode.upass, t_str, PASSLEN); + ircd_strncpy(state->chptr->mode.upass, t_str, KEYLEN); else /* remove the old upass */ *state->chptr->mode.upass = '\0'; } @@ -2635,7 +2635,7 @@ mode_parse_apass(struct ParseState *state, int *flag_p) if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_ADD) { /* set the new apass */ /* Make it VERY clear to the user that this is a one-time password */ - ircd_strncpy(state->chptr->mode.apass, t_str, PASSLEN); + ircd_strncpy(state->chptr->mode.apass, t_str, KEYLEN); if (MyUser(state->sptr)) { send_reply(state->sptr, RPL_APASSWARN_SET, state->chptr->mode.apass); send_reply(state->sptr, RPL_APASSWARN_SECRET, state->chptr->chname,