Define a privilege (off by default) that allows opers to use OPMODE
[ircu2.10.12-pk.git] / ircd / channel.c
index b264db71fb3051e0d6d2f218ead60c73f4c94d0e..c311e4e3f8811b8992872556502ceb423510448d 100644 (file)
@@ -2436,7 +2436,8 @@ mode_parse_upass(struct ParseState *state, int *flag_p)
   }
 
   /* If a non-service user is trying to force it, refuse. */
-  if (state->flags & MODE_PARSE_FORCE && !IsChannelService(state->sptr)) {
+  if (state->flags & MODE_PARSE_FORCE && MyUser(state->sptr)
+      && !HasPriv(state->sptr, PRIV_APASS_OPMODE)) {
     send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname,
                "Use /JOIN", state->chptr->chname, " <AdminPass>.");
     return;
@@ -2543,7 +2544,8 @@ mode_parse_apass(struct ParseState *state, int *flag_p)
   }
 
   /* If a non-service user is trying to force it, refuse. */
-  if (state->flags & MODE_PARSE_FORCE && !IsChannelService(state->sptr)) {
+  if (state->flags & MODE_PARSE_FORCE && MyUser(state->sptr)
+      && !HasPriv(state->sptr, PRIV_APASS_OPMODE)) {
     send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname,
                "Use /JOIN", state->chptr->chname, " <AdminPass>.");
     return;