Author: beware <steendijk@tomaatnet.nl>
authorAlex Badea <vampire@p16.pub.ro>
Wed, 17 Apr 2002 14:02:53 +0000 (14:02 +0000)
committerAlex Badea <vampire@p16.pub.ro>
Wed, 17 Apr 2002 14:02:53 +0000 (14:02 +0000)
Log message:

Fixed whois again (disallow local non-opers to do remote whois's on
non-existent users)

(pullup from u2_10_11 branch)

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@745 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_whois.c

index bb761e2b8b04d35e32310c96c147189d22992ddd..e0926358085be89953df0aeb3c2c9af7b501d931 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-17  beware <steendijk@tomaatnet.nl>
+
+       * m_whois.c (m_whois): disallow remote queries for non-existent
+       local users when originated by a non-oper
+
 2002-04-16  Alex Badea  <vampire@p16.pub.ro>
 
        * ircd/s_user.c (hunt_server_cmd): also send a "no such server"
index 5a5109449b42e08a105b367f26266a2a809df94e..0855164edbf998b7cb4aaccdae05cfe5f615667a 100644 (file)
@@ -365,8 +365,16 @@ int m_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* If remote queries are disabled, then use the *second* parameter of
      * of whois, so /whois nick nick still works.
      */
-    if (!IsOper(sptr))
+    if (!IsAnOper(sptr))
+    {
+      if (!FindUser(parv[2]))
+      {
+       send_reply(sptr, ERR_NOSUCHNICK, parv[2]);
+       send_reply(sptr, RPL_ENDOFWHOIS, parv[2]);
+       return 0;
+      }
       parv[1] = parv[2];
+    }
 #endif
 
     if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=