]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Use ERR_NOPRIVS when an oper is not allowed to see admin-only /stats.
authorJilles Tjoelker <redacted>
Sat, 29 Mar 2008 22:09:45 +0000 (23:09 +0100)
committerJilles Tjoelker <redacted>
Sat, 29 Mar 2008 22:09:45 +0000 (23:09 +0100)
This includes opers without the admin flag and admins on other servers.

modules/m_stats.c

index acee0063cf7e2406666bd3d71921d43e44cd019d..6e7552e9e8e72764c2fc822fa8286eccd46c6e8a 100644 (file)
@@ -226,13 +226,18 @@ m_stats(struct Client *client_p, struct Client *source_p, int parc, const char *
                        /* Called for remote clients and for local opers, so check need_admin
                         * and need_oper
                         */
-                       if((stats_cmd_table[i].need_admin && !IsOperAdmin (source_p)) ||
-                          (stats_cmd_table[i].need_oper && !IsOper (source_p)))
+                       if(stats_cmd_table[i].need_oper && !IsOper(source_p))
                        {
                                sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
                                                   form_str (ERR_NOPRIVILEGES));
                                break;
                        }
+                       if(stats_cmd_table[i].need_admin && !IsOperAdmin(source_p))
+                       {
+                               sendto_one(source_p, form_str(ERR_NOPRIVS),
+                                          me.name, source_p->name, "admin");
+                               break;
+                       }
 
                        /* Blah, stats L needs the parameters, none of the others do.. */
                        if(statchar == 'L' || statchar == 'l')