From 36ad1362178afa777fb41884ba0e2a3c93df24cb Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 3 Jul 2013 13:59:41 +0000 Subject: - Removed useless sanity checks - Fixed bug where remote /STATS requests were not rate limited git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2342 82007160-df01-0410-b94d-b575c5fd34c7 --- NEWS | 1 + modules/m_admin.c | 3 +-- modules/m_away.c | 3 --- modules/m_info.c | 3 --- modules/m_links.c | 3 +-- modules/m_lusers.c | 3 +-- modules/m_motd.c | 3 --- modules/m_stats.c | 32 +++++++------------------------- 8 files changed, 11 insertions(+), 40 deletions(-) diff --git a/NEWS b/NEWS index bd0a97a..6381b58 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ -- ircd-hybrid-8.1.4 Release Notes o) Added 'xline' and 'resv' logging types. See doc/reference.conf for more information +o) Fixed bug where remote /STATS requests were not rate limited -- ircd-hybrid-8.1.3 Release Notes diff --git a/modules/m_admin.c b/modules/m_admin.c index 0abecff..345582a 100644 --- a/modules/m_admin.c +++ b/modules/m_admin.c @@ -125,8 +125,7 @@ ms_admin(struct Client *client_p, struct Client *source_p, parc, parv) != HUNTED_ISME) return; - if (IsClient(source_p)) - do_admin(source_p); + do_admin(source_p); } static struct Message admin_msgtab = { diff --git a/modules/m_away.c b/modules/m_away.c index 644d1d5..e690036 100644 --- a/modules/m_away.c +++ b/modules/m_away.c @@ -99,9 +99,6 @@ static void ms_away(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - if (!IsClient(source_p)) - return; - if (parc < 2 || EmptyString(parv[1])) { /* Marking as not away */ diff --git a/modules/m_info.c b/modules/m_info.c index 3347170..8988e14 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -724,9 +724,6 @@ static void ms_info(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - if (!IsClient(source_p)) - return; - if (hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME) return; diff --git a/modules/m_links.c b/modules/m_links.c index dade049..4078a2e 100644 --- a/modules/m_links.c +++ b/modules/m_links.c @@ -169,8 +169,7 @@ ms_links(struct Client *client_p, struct Client *source_p, parc, parv) != HUNTED_ISME) return; - if (IsClient(source_p)) - m_links(client_p, source_p, parc, parv); + m_links(client_p, source_p, parc, parv); } static struct Message links_msgtab = { diff --git a/modules/m_lusers.c b/modules/m_lusers.c index 40a7bdf..3fd23ce 100644 --- a/modules/m_lusers.c +++ b/modules/m_lusers.c @@ -81,8 +81,7 @@ ms_lusers(struct Client *client_p, struct Client *source_p, parc, parv) != HUNTED_ISME) return; - if (IsClient(source_p)) - show_lusers(source_p); + show_lusers(source_p); } static struct Message lusers_msgtab = { diff --git a/modules/m_motd.c b/modules/m_motd.c index 9dcc231..f84eeb4 100644 --- a/modules/m_motd.c +++ b/modules/m_motd.c @@ -92,9 +92,6 @@ static void mo_motd(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - if (!IsClient(source_p)) - return; - if (hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) return; diff --git a/modules/m_stats.c b/modules/m_stats.c index 5305f33..56336c3 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -1637,12 +1637,6 @@ m_stats(struct Client *client_p, struct Client *source_p, { static time_t last_used = 0; - /* Is the stats meant for us? */ - if (!ConfigServerHide.disable_remote_commands) - if (hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, - parc, parv) != HUNTED_ISME) - return; - if (!MyClient(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p)) { from = me.id; @@ -1664,6 +1658,12 @@ m_stats(struct Client *client_p, struct Client *source_p, last_used = CurrentTime; + /* Is the stats meant for us? */ + if (!ConfigServerHide.disable_remote_commands) + if (hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, + parc, parv) != HUNTED_ISME) + return; + do_stats(source_p, parc, parv); } @@ -1698,27 +1698,9 @@ mo_stats(struct Client *client_p, struct Client *source_p, do_stats(source_p, parc, parv); } -/* - * ms_stats - STATS message handler - * parv[0] = sender prefix - * parv[1] = statistics selector (defaults to Message frequency) - * parv[2] = server name (current server defaulted, if omitted) - */ -static void -ms_stats(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - if (hunt_server(client_p, source_p, ":%s STATS %s :%s", 2, - parc, parv) != HUNTED_ISME) - return; - - if (IsClient(source_p)) - mo_stats(client_p, source_p, parc, parv); -} - static struct Message stats_msgtab = { "STATS", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - { m_unregistered, m_stats, ms_stats, m_ignore, mo_stats, m_ignore } + { m_unregistered, m_stats, mo_stats, m_ignore, mo_stats, m_ignore } }; static void -- cgit