X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_stats.c;h=0ba58c42faeeb5ba30a714f427b525337a11d6e2;hb=5a6f04876e4eef1ae0f01d1a9f089eb73d768065;hp=fc3f0afc2f8324915faa1e1f50007a533598c493;hpb=955f95803f18a5006d38fe096b85028c07692b8b;p=ircu2.10.12-pk.git diff --git a/ircd/m_stats.c b/ircd/m_stats.c index fc3f0af..0ba58c4 100644 --- a/ircd/m_stats.c +++ b/ircd/m_stats.c @@ -121,7 +121,7 @@ m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) const struct StatDesc *sd; char *param = 0; - /* If we didn't find a descriptor and this is my client, send them help */ + /* If we didn't find a descriptor, send them help */ if ((parc < 2) || !(sd = stats_find(parv[1]))) parv[1] = "*", sd = stats_find("*"); @@ -131,15 +131,18 @@ m_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * not privileged (server or an operator), then the STAT_FLAG_OPERONLY * flag must not be set, and if the STAT_FLAG_OPERFEAT flag is set, * then the feature given by sd->sd_control must be off. + * + * This checks cptr rather than sptr so that a local oper may send + * /stats queries to other servers. */ if (!IsPrivileged(cptr) && ((sd->sd_flags & STAT_FLAG_OPERONLY) || ((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control)))) - return send_reply(cptr, ERR_NOPRIVILEGES); + return send_reply(sptr, ERR_NOPRIVILEGES); /* Check if they are a local user */ - if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(cptr)) - return send_reply(cptr, ERR_NOPRIVILEGES); + if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(sptr)) + return send_reply(sptr, ERR_NOPRIVILEGES); /* Check for extra parameter */ if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))