Forward port 2.10.11 /whois CPU limiter.
authorMichael Poole <mdpoole@troilus.org>
Sat, 15 May 2004 18:39:34 +0000 (18:39 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 15 May 2004 18:39:34 +0000 (18:39 +0000)
Fix typos in previous commits.

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

ChangeLog
ircd/channel.c
ircd/m_list.c
ircd/m_whois.c

index 06c7676fcf3e97a130cbd983f87f9ecbb1653f89..e9b09e810f0d2f11159f07efecf2d0226d036104 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-05-15 beware <steendijk@xs4all.nl>
+
+       [Original ChangeLog date: 2003-10-25 -MDP]
+       
+        * ircd/m_whois.c: Fixed /whois comma separated list with wildcards
+       cpu hog bug
+
 2004-05-15  Michael Poole <mdpoole@troilus.org>
 
        * ircd/s_conf.c (rehash): Call clear_quarantines on rehash since
index b67c862997d6ec20b2f650dd7e8f4da6060ad825..be0e3367156ff3bc05dcacf032606001731a8a2a 100644 (file)
@@ -1347,7 +1347,7 @@ void list_next_channels(struct Client *cptr, int nr)
       if (!cli_user(cptr))
         continue;
       if (!(HasPriv(cptr, PRIV_LIST_CHAN) && IsAnOper(cptr)) && 
-          SecretChannel(chptr) && !find_channel_member(cptr, chptr)))
+          SecretChannel(chptr) && !find_channel_member(cptr, chptr))
         continue;
       if (chptr->users > args->min_users && chptr->users < args->max_users &&
           chptr->creationtime > args->min_time &&
index 3cb9ef93e094bb19ffb2a2d056b15331370c4549..09ab42274abe7119600c4c996f9c375b6ade011b 100644 (file)
@@ -244,7 +244,7 @@ param_parse(struct Client *sptr, const char *param, struct ListingArgs *args,
       args->flags |= LISTARG_SHOWSECRET;
       param++;
 
-      if (*param != ',' && *param != ' ' && *param !+ '\0') /* check syntax */
+      if (*param != ',' && *param != ' ' && *param != '\0') /* check syntax */
         return show_usage(sptr);
       break;
 
index ed0213ad2ee8d7a18d099d1e8ce45f06f8d4f6df..81d42f41d7c883f873ec14f83666791e3dc14613 100644 (file)
@@ -345,6 +345,7 @@ int m_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char*           p = 0;
   int             found = 0;
   int            total = 0;
+  int             wildscount = 0;
 
   if (parc < 2)
   {
@@ -401,7 +402,13 @@ int m_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       }
     }
     else /* wilds */
-       found=do_wilds(sptr, nick, total, parc);
+    {
+      if (++wildscount > 3) {
+        send_reply(sptr, ERR_QUERYTOOLONG, parv[1]);
+        break;
+      }
+      found=do_wilds(sptr, nick, total, parc);
+    }
 
     if (!found)
       send_reply(sptr, ERR_NOSUCHNICK, nick);