Allow OPMODE to change +A and +U passwords rather than crashing.
authorMichael Poole <mdpoole@troilus.org>
Sun, 21 Nov 2004 15:00:23 +0000 (15:00 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sun, 21 Nov 2004 15:00:23 +0000 (15:00 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1270 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index 09eae741f48dfbc57ff5f5fa7799673d818cac9c..1b391a30eea1ffa36da924139418a6226877550e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-11-21  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/channel.c (mode_parse_upass): Allow forced mode changes to
+       be done by non-channel-managers, fixing a crash from OPMODE.
+       (mode_parse_apass): Likewise.
+
 2004-11-20  Michael Poole <mdpoole@troilus.org>
 
        * ircd/m_create.c (ms_create): Complain if a user tries to CREATE
index 9ff1bcfdc4cdd59ed85b867877210bdb562fa16c..90eed24df70e11ae167d2fdb71658ce6faab6e9f 100644 (file)
@@ -2436,7 +2436,7 @@ mode_parse_upass(struct ParseState *state, int *flag_p)
   }
 
   /* If they are not the channel manager, they are not allowed to change it */
-  if (MyUser(state->sptr) && !IsChannelManager(state->member)) {
+  if (MyUser(state->sptr) && !(state->flags & MODE_PARSE_FORCE || IsChannelManager(state->member))) {
     if (*state->chptr->mode.apass) {
       send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname,
          "Use /JOIN", state->chptr->chname, "<AdminPass>.");
@@ -2549,7 +2549,7 @@ mode_parse_apass(struct ParseState *state, int *flag_p)
   }
 
   /* If they are not the channel manager, they are not allowed to change it */
-  if (MyUser(state->sptr) && !IsChannelManager(state->member)) {
+  if (MyUser(state->sptr) && !(state->flags & MODE_PARSE_FORCE || IsChannelManager(state->member))) {
     if (*state->chptr->mode.apass) {
       send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname,
          "Use /JOIN", state->chptr->chname, "<AdminPass>.");