Make PRIV_LIST_CHAN work as it should (affecting LIST, not WHOIS, NAMES, etc).
authorMichael Poole <mdpoole@troilus.org>
Tue, 22 Feb 2005 03:10:29 +0000 (03:10 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 22 Feb 2005 03:10:29 +0000 (03:10 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1322 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/channel.h
ircd/m_list.c

index 4545f05199fbe2a4b0d1ebad1064644a1776cd6a..b9e1e012f403d7c7517af8b464ed5f7841879748 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
index 24e70b46db345a278275260b0653db870b5ab3c1..db347976c6343021ef6dd64ff7ed229541208427 100644 (file)
@@ -126,8 +126,7 @@ struct Client;
 /** 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)
 
index 471743b838062d2bf1dc3e2fe67d15d62361b04c..e470cc484b16c17f5d4b0a0bd966012031e88246 100644 (file)
@@ -238,7 +238,7 @@ param_parse(struct Client *sptr, const char *param, struct ListingArgs *args,
 
     case 'S':
     case 's':
-      if (!IsAnOper(sptr))
+      if (!IsAnOper(sptr) || !HasPriv(sptr, PRIV_LIST_CHAN))
         return show_usage(sptr);
 
       args->flags |= LISTARG_SHOWSECRET;
@@ -340,7 +340,10 @@ int m_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   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);
   }