+2005-02-21 Michael Poole <mdpoole@troilus.org>
+
+ * include/channel.h (ShowChannel): Remove PRIV_LIST_CHAN check
+ from here, so /whois does not show secret global channels.
+
+ * ircd/m_list.c (param_parse): Require PRIV_LIST_CHAN to use
+ "/list s".
+ (m_list): Allow opers with PRIV_LIST_CHAN to see secret channels.
+
2005-02-21 Perry Lorier <isomer@undernet.org>
* ircd/s_stats.c: Hide the hub IP's. They're kinda important.
/** channel not shown but names are */
#define HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE))
/** channel visible */
-#define ShowChannel(v,c) (PubChannel(c) || find_channel_member((v),(c)) || \
- (IsAnOper(v) && HasPriv(v, PRIV_LIST_CHAN)))
+#define ShowChannel(v,c) (PubChannel(c) || find_channel_member((v),(c)))
#define PubChannel(x) ((!x) || ((x)->mode.mode & \
(MODE_PRIVATE | MODE_SECRET)) == 0)
case 'S':
case 's':
- if (!IsAnOper(sptr))
+ if (!IsAnOper(sptr) || !HasPriv(sptr, PRIV_LIST_CHAN))
return show_usage(sptr);
args->flags |= LISTARG_SHOWSECRET;
for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = 0)
{
chptr = FindChannel(name);
- if (chptr && ShowChannel(sptr, chptr) && cli_user(sptr))
+ if (!chptr)
+ continue;
+ if (ShowChannel(sptr, chptr)
+ || (IsAnOper(sptr) && HasPriv(sptr, PRIV_LIST_CHAN)))
send_reply(sptr, RPL_LIST, chptr->chname,
chptr->users - number_of_zombies(chptr), chptr->topic);
}