Allow OPMODE to change +A and +U passwords rather than crashing.
[ircu2.10.12-pk.git] / ircd / channel.c
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>.");