]> jfr.im git - solanum.git/blobdiff - src/chmode.c
Spring cleaning redux:
[solanum.git] / src / chmode.c
index 4188f1d3ffbe574417ce8d0087f25f38f80d8aeb..3790611355d1e518cd8ff55127a5ceffa470adf0 100644 (file)
@@ -2,9 +2,9 @@
  *  charybdis: A slightly useful ircd.
  *  chmode.c: channel mode management
  *
- * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center 
- * Copyright (C) 1996-2002 Hybrid Development Team 
- * Copyright (C) 2002-2005 ircd-ratbox development team 
+ * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
+ * Copyright (C) 1996-2002 Hybrid Development Team
+ * Copyright (C) 2002-2005 ircd-ratbox development team
  * Copyright (C) 2005-2006 charybdis development team
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -42,6 +42,7 @@
 #include "s_newconf.h"
 #include "logger.h"
 #include "chmode.h"
+#include "s_assert.h"
 
 /* bitmasks for error returns, so we send once per call */
 #define SM_ERR_NOTS             0x00000001     /* No TS on channel */
@@ -81,13 +82,13 @@ construct_cflags_strings(void)
        int i;
         char *ptr = cflagsbuf;
        char *ptr2 = cflagsmyinfo;
-        
+
         *ptr = '\0';
        *ptr2 = '\0';
 
        for(i = 0; i < 256; i++)
        {
-               if( !(chmode_table[i].set_func == chm_ban) && 
+               if( !(chmode_table[i].set_func == chm_ban) &&
                        !(chmode_table[i].set_func == chm_forward) &&
                        !(chmode_table[i].set_func == chm_throttle) &&
                         !(chmode_table[i].set_func == chm_key) &&
@@ -101,7 +102,7 @@ construct_cflags_strings(void)
                {
                        chmode_flags[i] = 0;
                }
-                
+
                switch (chmode_flags[i])
                {
                    case MODE_FREETARGET:
@@ -115,14 +116,14 @@ construct_cflags_strings(void)
                            *ptr++ = (char) i;
                        }
                }
-               
+
                /* Should we leave orphaned check here? -- dwr */
                if(!(chmode_table[i].set_func == chm_nosuch) && !(chmode_table[i].set_func == chm_orphaned))
                {
                    *ptr2++ = (char) i;
                }
        }
-        
+
         *ptr++ = '\0';
        *ptr2++ = '\0';
 }
@@ -255,7 +256,7 @@ add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const
         */
        if(MyClient(source_p))
        {
-               if((rb_dlink_list_length(&chptr->banlist) + rb_dlink_list_length(&chptr->exceptlist) + rb_dlink_list_length(&chptr->invexlist) + rb_dlink_list_length(&chptr->quietlist)) >= (chptr->mode.mode & MODE_EXLIMIT ? ConfigChannel.max_bans_large : ConfigChannel.max_bans))
+               if((rb_dlink_list_length(&chptr->banlist) + rb_dlink_list_length(&chptr->exceptlist) + rb_dlink_list_length(&chptr->invexlist) + rb_dlink_list_length(&chptr->quietlist)) >= (unsigned long)(chptr->mode.mode & MODE_EXLIMIT ? ConfigChannel.max_bans_large : ConfigChannel.max_bans))
                {
                        sendto_one(source_p, form_str(ERR_BANLISTFULL),
                                   me.name, source_p->name, chptr->chname, realban);
@@ -373,27 +374,30 @@ pretty_mask(const char *idmask)
 {
        static char mask_buf[BUFSIZE];
        int old_mask_pos;
-       char *nick, *user, *host, *forward = NULL;
-       char splat[] = "*";
-       char *t, *at, *ex, *ex2;
-       char ne = 0, ue = 0, he = 0, fe = 0;    /* save values at nick[NICKLEN], et all */
-       char e2 = 0;                            /* save value that delimits forward channel */
+       const char *nick, *user, *host, *forward = NULL;
+       char *t, *at, *ex;
+       int nl, ul, hl, fl;
        char *mask;
+       size_t masklen;
 
        mask = LOCAL_COPY(idmask);
        mask = check_string(mask);
        collapse(mask);
+       masklen = strlen(mask);
 
-       nick = user = host = splat;
+       nick = user = host = "*";
+       nl = ul = hl = 1;
+       fl = 0;
 
-       if((size_t) BUFSIZE - mask_pos < strlen(mask) + 5)
+       if((size_t) BUFSIZE - mask_pos < masklen + 5)
                return NULL;
 
        old_mask_pos = mask_pos;
 
        if (*mask == '$')
        {
-               mask_pos += rb_sprintf(mask_buf + mask_pos, "%s", mask) + 1;
+               memcpy(mask_buf + mask_pos, mask, masklen + 1);
+               mask_pos += masklen + 1;
                t = mask_buf + old_mask_pos + 1;
                if (*t == '!')
                        *t = '~';
@@ -403,100 +407,78 @@ pretty_mask(const char *idmask)
                return mask_buf + old_mask_pos;
        }
 
-       at = ex = ex2 = NULL;
-       if((t = strchr(mask, '@')) != NULL)
+       at = ex = NULL;
+       if((t = memchr(mask, '@', masklen)) != NULL)
        {
                at = t;
-               *t++ = '\0';
+               t++;
                if(*t != '\0')
-                       host = t;
+                       host = t, hl = strlen(t);
 
-               if((t = strchr(mask, '!')) != NULL)
+               if((t = memchr(mask, '!', at - mask)) != NULL)
                {
                        ex = t;
-                       *t++ = '\0';
-                       if(*t != '\0')
-                               user = t;
-                       if(*mask != '\0')
-                               nick = mask;
+                       t++;
+                       if(at != t)
+                               user = t, ul = at - t;
+                       if(ex != mask)
+                               nick = mask, nl = ex - mask;
                }
                else
                {
-                       if(*mask != '\0')
-                               user = mask;
+                       if(at != mask)
+                               user = mask, ul = at - mask;
                }
 
-               if((t = strchr(host, '!')) != NULL || (t = strchr(host, '$')) != NULL)
+               if((t = memchr(host, '!', hl)) != NULL ||
+                               (t = memchr(host, '$', hl)) != NULL)
                {
-                       ex2 = t;
-                       e2 = *t;
-                       *t++= '\0';
-                       if (*t != '\0')
-                               forward = t;
+                       t++;
+                       if (host + hl != t)
+                               forward = t, fl = host + hl - t;
+                       hl = t - 1 - host;
                }
        }
-       else if((t = strchr(mask, '!')) != NULL)
+       else if((t = memchr(mask, '!', masklen)) != NULL)
        {
                ex = t;
-               *t++ = '\0';
-               if(*mask != '\0')
-                       nick = mask;
+               t++;
+               if(ex != mask)
+                       nick = mask, nl = ex - mask;
                if(*t != '\0')
-                       user = t;
+                       user = t, ul = strlen(t);
        }
-       else if(strchr(mask, '.') != NULL || strchr(mask, ':') != NULL)
+       else if(memchr(mask, '.', masklen) != NULL ||
+                       memchr(mask, ':', masklen) != NULL)
        {
-               if(*mask != '\0')
-                       host = mask;
+               host = mask, hl = masklen;
        }
        else
        {
-               if(*mask != '\0')
-                       nick = mask;
+               if(masklen > 0)
+                       nick = mask, nl = masklen;
        }
 
        /* truncate values to max lengths */
-       if(strlen(nick) > NICKLEN - 1)
-       {
-               ne = nick[NICKLEN - 1];
-               nick[NICKLEN - 1] = '\0';
-       }
-       if(strlen(user) > USERLEN)
-       {
-               ue = user[USERLEN];
-               user[USERLEN] = '\0';
-       }
-       if(strlen(host) > HOSTLEN)
-       {
-               he = host[HOSTLEN];
-               host[HOSTLEN] = '\0';
-       }
-       if(forward && strlen(forward) > CHANNELLEN)
-       {
-               fe = forward[CHANNELLEN];
-               forward[CHANNELLEN] = '\0';
+       if(nl > NICKLEN - 1)
+               nl = NICKLEN - 1;
+       if(ul > USERLEN)
+               ul = USERLEN;
+       if(hl > HOSTLEN)
+               hl = HOSTLEN;
+       if(fl > CHANNELLEN)
+               fl = CHANNELLEN;
+
+       memcpy(mask_buf + mask_pos, nick, nl), mask_pos += nl;
+       mask_buf[mask_pos++] = '!';
+       memcpy(mask_buf + mask_pos, user, ul), mask_pos += ul;
+       mask_buf[mask_pos++] = '@';
+       memcpy(mask_buf + mask_pos, host, hl), mask_pos += hl;
+       if (forward) {
+               mask_buf[mask_pos++] = '$';
+               memcpy(mask_buf + mask_pos, forward, fl), mask_pos += fl;
        }
-
-       if (forward)
-               mask_pos += rb_sprintf(mask_buf + mask_pos, "%s!%s@%s$%s", nick, user, host, forward) + 1;
-       else
-               mask_pos += rb_sprintf(mask_buf + mask_pos, "%s!%s@%s", nick, user, host) + 1;
-
-       /* restore mask, since we may need to use it again later */
-       if(at)
-               *at = '@';
-       if(ex)
-               *ex = '!';
-       if(ex2)
-               *ex2 = e2;
-       if(ne)
-               nick[NICKLEN - 1] = ne;
-       if(ue)
-               user[USERLEN] = ue;
-       if(he)
-               host[HOSTLEN] = he;
-       if(fe)
-               forward[CHANNELLEN] = fe;
+       mask_buf[mask_pos++] = '\0';
 
        return mask_buf + old_mask_pos;
 }
@@ -630,8 +612,6 @@ chm_simple(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count++].arg = NULL;
@@ -642,8 +622,6 @@ chm_simple(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = NULL;
@@ -657,15 +635,13 @@ chm_orphaned(struct Client *source_p, struct Channel *chptr,
 {
        if(MyClient(source_p))
                return;
-        
+
        if((dir == MODE_ADD) && !(chptr->mode.mode & mode_type))
        {
                chptr->mode.mode |= mode_type;
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count++].arg = NULL;
@@ -676,8 +652,6 @@ chm_orphaned(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = NULL;
@@ -705,6 +679,9 @@ chm_staff(struct Client *source_p, struct Channel *chptr,
                return;
        }
 
+       if(!allow_mode_change(source_p, chptr, CHFL_CHANOP, errors, c))
+               return;
+
        if(MyClient(source_p) && (++mode_limit_simple > MAXMODES_SIMPLE))
                return;
 
@@ -715,8 +692,6 @@ chm_staff(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count++].arg = NULL;
@@ -727,8 +702,6 @@ chm_staff(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = NULL;
@@ -740,14 +713,14 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
        int alevel, int parc, int *parn,
        const char **parv, int *errors, int dir, char c, long mode_type)
 {
-       char *mask, *raw_mask, *forward;
+       const char *mask, *raw_mask;
+       char *forward;
        rb_dlink_list *list;
        rb_dlink_node *ptr;
        struct Ban *banptr;
        int errorval;
-       int rpl_list;
-       int rpl_endlist;
-       int caps;
+       const char *rpl_list_p;
+       const char *rpl_endlist_p;
        int mems;
 
        switch (mode_type)
@@ -755,10 +728,9 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
        case CHFL_BAN:
                list = &chptr->banlist;
                errorval = SM_ERR_RPL_B;
-               rpl_list = RPL_BANLIST;
-               rpl_endlist = RPL_ENDOFBANLIST;
+               rpl_list_p = form_str(RPL_BANLIST);
+               rpl_endlist_p = form_str(RPL_ENDOFBANLIST);
                mems = ALL_MEMBERS;
-               caps = 0;
                break;
 
        case CHFL_EXCEPTION:
@@ -769,9 +741,8 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
 
                list = &chptr->exceptlist;
                errorval = SM_ERR_RPL_E;
-               rpl_list = RPL_EXCEPTLIST;
-               rpl_endlist = RPL_ENDOFEXCEPTLIST;
-               caps = CAP_EX;
+               rpl_list_p = form_str(RPL_EXCEPTLIST);
+               rpl_endlist_p = form_str(RPL_ENDOFEXCEPTLIST);
 
                if(ConfigChannel.use_except || (dir == MODE_DEL))
                        mems = ONLY_CHANOPS;
@@ -787,9 +758,8 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
 
                list = &chptr->invexlist;
                errorval = SM_ERR_RPL_I;
-               rpl_list = RPL_INVITELIST;
-               rpl_endlist = RPL_ENDOFINVITELIST;
-               caps = CAP_IE;
+               rpl_list_p = form_str(RPL_INVITELIST);
+               rpl_endlist_p = form_str(RPL_ENDOFINVITELIST);
 
                if(ConfigChannel.use_invex || (dir == MODE_DEL))
                        mems = ONLY_CHANOPS;
@@ -800,10 +770,9 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
        case CHFL_QUIET:
                list = &chptr->quietlist;
                errorval = SM_ERR_RPL_Q;
-               rpl_list = RPL_QUIETLIST;
-               rpl_endlist = RPL_ENDOFQUIETLIST;
+               rpl_list_p = form_str(RPL_QUIETLIST);
+               rpl_endlist_p = form_str(RPL_ENDOFQUIETLIST);
                mems = ALL_MEMBERS;
-               caps = 0;
                break;
 
        default:
@@ -839,11 +808,11 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
                        else
                                rb_strlcpy(buf, banptr->banstr, sizeof(buf));
 
-                       sendto_one(source_p, form_str(rpl_list),
+                       sendto_one(source_p, rpl_list_p,
                                   me.name, source_p->name, chptr->chname,
                                   buf, banptr->who, banptr->when);
                }
-               sendto_one(source_p, form_str(rpl_endlist), me.name, source_p->name, chptr->chname);
+               sendto_one(source_p, rpl_endlist_p, me.name, source_p->name, chptr->chname);
                return;
        }
 
@@ -948,8 +917,6 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = caps;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = mems;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = mask;
@@ -978,8 +945,6 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = caps;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = mems;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = buf + old_removed_mask_pos;
@@ -1037,12 +1002,9 @@ chm_op(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = targ_p->id;
-               mode_changes[mode_count].arg = targ_p->name;
-               mode_changes[mode_count++].client = targ_p;
+               mode_changes[mode_count++].arg = targ_p->name;
 
                mstptr->flags |= CHFL_CHANOP;
        }
@@ -1057,12 +1019,9 @@ chm_op(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = targ_p->id;
-               mode_changes[mode_count].arg = targ_p->name;
-               mode_changes[mode_count++].client = targ_p;
+               mode_changes[mode_count++].arg = targ_p->name;
 
                mstptr->flags &= ~CHFL_CHANOP;
        }
@@ -1116,12 +1075,9 @@ chm_voice(struct Client *source_p, struct Channel *chptr,
        {
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = targ_p->id;
-               mode_changes[mode_count].arg = targ_p->name;
-               mode_changes[mode_count++].client = targ_p;
+               mode_changes[mode_count++].arg = targ_p->name;
 
                mstptr->flags |= CHFL_VOICE;
        }
@@ -1129,12 +1085,9 @@ chm_voice(struct Client *source_p, struct Channel *chptr,
        {
                mode_changes[mode_count].letter = 'v';
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = targ_p->id;
-               mode_changes[mode_count].arg = targ_p->name;
-               mode_changes[mode_count++].client = targ_p;
+               mode_changes[mode_count++].arg = targ_p->name;
 
                mstptr->flags &= ~CHFL_VOICE;
        }
@@ -1170,8 +1123,6 @@ chm_limit(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = limitstr;
@@ -1187,8 +1138,6 @@ chm_limit(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = NULL;
@@ -1220,8 +1169,6 @@ chm_throttle(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = parv[(*parn)];
@@ -1243,8 +1190,6 @@ chm_throttle(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = NULL;
@@ -1307,8 +1252,6 @@ chm_forward(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems =
                        ConfigChannel.use_forward ? ALL_MEMBERS : ONLY_SERVERS;
                mode_changes[mode_count].id = NULL;
@@ -1323,8 +1266,6 @@ chm_forward(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = NULL;
@@ -1365,8 +1306,6 @@ chm_key(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_ADD;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = chptr->mode.key;
@@ -1396,8 +1335,6 @@ chm_key(struct Client *source_p, struct Channel *chptr,
 
                mode_changes[mode_count].letter = c;
                mode_changes[mode_count].dir = MODE_DEL;
-               mode_changes[mode_count].caps = 0;
-               mode_changes[mode_count].nocaps = 0;
                mode_changes[mode_count].mems = ALL_MEMBERS;
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count++].arg = "*";
@@ -1680,7 +1617,7 @@ struct ChannelMode chmode_table[256] =
 /* set_channel_mode()
  *
  * inputs      - client, source, channel, membership pointer, params
- * output      - 
+ * output      -
  * side effects - channel modes/memberships are changed, MODE is issued
  *
  * Extensively modified to be hotpluggable, 03/09/06 -- nenolod
@@ -1832,7 +1769,7 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
 /* set_channel_mlock()
  *
  * inputs      - client, source, channel, params
- * output      - 
+ * output      -
  * side effects - channel mlock is changed / MLOCK is propagated
  */
 void