From: Joseph Bongaarts Date: Tue, 19 Mar 2002 19:25:55 +0000 (+0000) Subject: Author: Ghostwolf X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=91c487d3c66994e9c316de33834c2e1529f5c514;p=ircu2.10.12-pk.git Author: Ghostwolf Log message: Fixed a bug in /stats i, and in the process saw someone tried to show connection limits in /stats i. Took the idea and finished implementing it. Update ChangeLog for today's earlier commits as well. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@680 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 5f9874c..ba18638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2002-03-19 Joseph Bongaarts + + * include/ircd_policy.h: added NO_HEAD_IN_SAND for easier removal of + hiding features. + + * configure.in: add --disable-headinsand + + * configure: Ran autoconf + + * ircd/m_stats.c: Fixed a bug in /stats i and made /stats i show + connect limits + + * ircd/s_stats.c: Made /stats i report connect limits + + * ircd/s_err.c: Modified RPL_STATSILINE to use %s instead of + "*" for the password field. + 2002-03-19 LordLuke * include/channel.h: Allow opers to view +s channels in /list diff --git a/ircd/m_stats.c b/ircd/m_stats.c index a6cda15..cad559a 100644 --- a/ircd/m_stats.c +++ b/ircd/m_stats.c @@ -340,15 +340,15 @@ int m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) (wilds && (!mmatch(host, aconf->host) || !mmatch(host, aconf->name)))) { - if (acptr->passwd && IsDigit(*aconf->passwd) && + if (aconf->passwd && IsDigit(*aconf->passwd) && (!aconf->passwd[1] || - (IsDigit(aconf->passwd[1]) && !aconf->passwd[2]) - send_reply(sptr, RPL_STATSILINE, 'I', aconf->passwd, aconf->host, - aconf->name, aconf->port, get_conf_class(aconf)); - } - else { - send_reply(sptr, RPL_STATSILINE, 'I', "*", aconf->host, + (IsDigit(aconf->passwd[1]) && !aconf->passwd[2]))) + send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, aconf->passwd, aconf->name, aconf->port, get_conf_class(aconf)); + else + send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, "*", + aconf->name, aconf->port, get_conf_class(aconf)); + if (--count == 0) break; } @@ -657,8 +657,16 @@ int ms_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) (wilds && (!mmatch(host, aconf->host) || !mmatch(host, aconf->name)))) { - send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, aconf->name, - aconf->port, get_conf_class(aconf)); + if (aconf->passwd && IsDigit(*aconf->passwd) && + (!aconf->passwd[1] || + (IsDigit(aconf->passwd[1]) && !aconf->passwd[2]))) + send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, + aconf->passwd, aconf->name, aconf->port, + get_conf_class(aconf)); + else + send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, "*", + aconf->name, aconf->port, get_conf_class(aconf)); + if (--count == 0) break; } @@ -877,8 +885,16 @@ int mo_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) (wilds && (!mmatch(host, aconf->host) || !mmatch(host, aconf->name)))) { - send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, aconf->name, - aconf->port, get_conf_class(aconf)); + if (aconf->passwd && IsDigit(*aconf->passwd) && + (!aconf->passwd[1] || + (IsDigit(aconf->passwd[1]) && !aconf->passwd[2]))) + send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, + aconf->passwd, aconf->name, aconf->port, + get_conf_class(aconf)); + else + send_reply(sptr, RPL_STATSILINE, 'I', aconf->host, "*", + aconf->name, aconf->port, get_conf_class(aconf)); + if (--count == 0) break; } diff --git a/ircd/s_err.c b/ircd/s_err.c index c9f6296..08195f8 100644 --- a/ircd/s_err.c +++ b/ircd/s_err.c @@ -462,7 +462,7 @@ static Numeric replyTable[] = { /* 214 */ { RPL_STATSNLINE, "%c %s * %s %d %d", "214" }, /* 215 */ - { RPL_STATSILINE, "%c %s * %s %d %d", "215" }, + { RPL_STATSILINE, "%c %s %s %s %d %d", "215" }, /* 216 */ { RPL_STATSKLINE, "%c %s \"%s\" %s 0 0", "216" }, /* 217 */ diff --git a/ircd/s_stats.c b/ircd/s_stats.c index e966e46..4b07c81 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -128,6 +128,14 @@ void report_configured_links(struct Client *sptr, int mask) send_reply(sptr, p[1], c, host, pass, name, port, get_conf_class(tmp)); else if ((tmp->status & (CONF_SERVER | CONF_HUB))) send_reply(sptr, p[1], c, "*", name, port, get_conf_class(tmp)); + else if ((tmp->status & CONF_CLIENT)) + { + if(tmp->passwd && IsDigit(*tmp->passwd) && (!tmp->passwd[1] || + (IsDigit(tmp->passwd[1]) && !tmp->passwd[2]))) + send_reply(sptr, p[1], c, host, pass, name, port, get_conf_class(tmp)); + else + send_reply(sptr, p[1], c, host, "*", name, port, get_conf_class(tmp)); + } else send_reply(sptr, p[1], c, host, name, port, get_conf_class(tmp)); }