From: Michael Poole Date: Sat, 15 May 2004 18:39:34 +0000 (+0000) Subject: Forward port 2.10.11 /whois CPU limiter. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=732b13562e39cac26128a71056aab30c553b811c Forward port 2.10.11 /whois CPU limiter. Fix typos in previous commits. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1060 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 06c7676..e9b09e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-05-15 beware + + [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 * ircd/s_conf.c (rehash): Call clear_quarantines on rehash since diff --git a/ircd/channel.c b/ircd/channel.c index b67c862..be0e336 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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 && diff --git a/ircd/m_list.c b/ircd/m_list.c index 3cb9ef9..09ab422 100644 --- a/ircd/m_list.c +++ b/ircd/m_list.c @@ -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; diff --git a/ircd/m_whois.c b/ircd/m_whois.c index ed0213a..81d42f4 100644 --- a/ircd/m_whois.c +++ b/ircd/m_whois.c @@ -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);