Fix secret channel information leak
authorAli Shemiran <ashemira@ucsd.edu>
Fri, 9 May 2008 19:47:31 +0000 (21:47 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 9 May 2008 19:47:31 +0000 (21:47 +0200)
/who on a secret channel that the user is not a member of
now returns proper RPL_ENDOFWHO_MSG instead of nothing.

ChangeLog
src/ngircd/irc-info.c
src/testsuite/ngircd-test.conf
src/testsuite/who-test.e

index 64807e7..6213d7a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
 
 ngIRCd-dev
 
+  - Fix Bug: 85: "WHO #SecretChannel" that user is not a member of now returns
+    proper RPL_ENDOFWHO_MSG instead of nothing. (Ali Shemiran)
   - Implemented IRC commands SERVICE, SERVLIST, and SQUERY as dummy functions
     to be even more RFC-compliant. Closes bug 74.
   - Fixed Bug 75: KICK now handles comma-delimited lists.
index 93c43f6..86e1ace 100644 (file)
@@ -738,7 +738,7 @@ IRC_Send_WHO(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
 
        /* Secret channel? */
        if (!is_member && strchr(Channel_Modes(Chan), 's'))
-               return CONNECTED;
+               return IRC_WriteStrClient(Client, RPL_ENDOFWHO_MSG, Client_ID(Client), Channel_Name(Chan));
 
        cl2chan = Channel_FirstMember(Chan);
        for (; cl2chan ; cl2chan = Channel_NextMember(Chan, cl2chan)) {
index eeace76..4d918e0 100644 (file)
        Name = #TopicChannel
        Modes = t
        Topic = the topic
+       
+[CHANNEL]
+       Name = #SecretChannel
+       Modes = s
+       Topic = A secret Channel
 
 # -eof-
index aafa795..2e14844 100644 (file)
@@ -152,6 +152,16 @@ expect {
        timeout { exit 1 }
        ":ngircd.test.server 352 nick \* * localhost ngircd.test.server nick H\* :0 Real Name"
 }
+expect {
+       timeout { exit 1 }
+       "315"
+}
+
+send "who #SecretChannel\r"
+expect {
+       timeout { exit 1 }
+       "315"
+}
 
 send "quit\r"
 expect {