Make references to channel password lengths consistent.
authorMichael Poole <mdpoole@troilus.org>
Wed, 31 Aug 2005 00:12:55 +0000 (00:12 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 31 Aug 2005 00:12:55 +0000 (00:12 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1472 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/channel.h
ircd/channel.c

index 48d293efa557c08230c23f28bff8f70dc8630b10..7303bd7be5d1f4b38863854c5f12c6b0febcd198 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-08-30  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * 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 <mdpoole@troilus.org>
 
index e0aca8dac01daf76f34f82b787378c5ec35e36f8..c2c12ea8348a87aed6a153e3c689ac19347099ca 100644 (file)
@@ -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 */
index 4cf0ae8443c3badd9caf16cb7685471d9143c65d..ea2d72812673a27510307cef6e9e6e5a6a7918fe 100644 (file)
@@ -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,