]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Change /stats O to show privset blocks (oper only).
authorJilles Tjoelker <redacted>
Sun, 18 Jan 2009 00:35:24 +0000 (01:35 +0100)
committerJilles Tjoelker <redacted>
Sun, 18 Jan 2009 00:35:24 +0000 (01:35 +0100)
To show operator blocks, only /stats o (lowercase) now works.

doc/sgml/oper-guide/commands.sgml
help/opers/stats
include/privilege.h
modules/m_stats.c
src/privilege.c

index 6654cd23a1306cba76ddc222b7c79e723fb2f935..871ee2d95a4714a411f0f402d18487b159e64b54 100644 (file)
              <para>Show operator blocks</para>
            </listitem>
          </varlistentry>
+         <varlistentry>
+           <term>O</term>
+           <listitem>
+             <para>Show privset blocks</para>
+           </listitem>
+         </varlistentry>
          <varlistentry>
            <term>p</term>
            <listitem>
index e6b27d9a4ea75c38a971c7abdba7f999e9d87dda..3017eb31988d81c09a5da56c179444431de68835 100644 (file)
@@ -24,6 +24,7 @@ X f - Shows File Descriptors
   l - Shows hostname and generic info about [nick]
   m - Shows commands and their usage
   n - Shows DNS blacklists
+* O - Shows privset blocks
 ^ o - Shows operator blocks (Old O: lines)
 ^ P - Shows configured ports
   p - Shows online opers
index 2af53f3eb77639a201aac469f6ce9d095be5fe19..46d5cd93675094f09c52a3a02a31b05cf9c77709 100644 (file)
@@ -47,5 +47,6 @@ struct PrivilegeSet *privilegeset_ref(struct PrivilegeSet *set);
 void privilegeset_unref(struct PrivilegeSet *set);
 void privilegeset_mark_all_illegal(void);
 void privilegeset_delete_all_illegal(void);
+void privilegeset_report(struct Client *source_p);
 
 #endif
index 3b08b5d387a8fcfa3bca49c9d6d8553b4bcf7e2d..dd678a312206feaf2016e5ec11c58e29c88bc716 100644 (file)
@@ -101,6 +101,7 @@ static void stats_klines(struct Client *);
 static void stats_messages(struct Client *);
 static void stats_dnsbl(struct Client *);
 static void stats_oper(struct Client *);
+static void stats_privset(struct Client *);
 static void stats_operedup(struct Client *);
 static void stats_ports(struct Client *);
 static void stats_tresv(struct Client *);
@@ -148,7 +149,7 @@ static struct StatsStruct stats_cmd_table[] = {
        {'M', stats_messages,           0, 0, },
        {'n', stats_dnsbl,              0, 0, },
        {'o', stats_oper,               0, 0, },
-       {'O', stats_oper,               0, 0, },
+       {'O', stats_privset,            1, 0, },
        {'p', stats_operedup,           0, 0, },
        {'P', stats_ports,              0, 0, },
        {'q', stats_tresv,              1, 0, },
@@ -678,6 +679,11 @@ stats_oper(struct Client *source_p)
        }
 }
 
+static void
+stats_privset(struct Client *source_p)
+{
+       privilegeset_report(source_p);
+}
 
 /* stats_operedup()
  *
index 09f5ea0de81dde44192f3e70c79ab9235bb429e1..e1f2507615092beb8edcbc265bd3452796bf17e9 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdinc.h>
 #include "s_conf.h"
 #include "privilege.h"
+#include "numeric.h"
 
 static rb_dlink_list privilegeset_list = {};
 
@@ -189,3 +190,20 @@ privilegeset_delete_all_illegal(void)
                privilegeset_unref(set);
        }
 }
+
+void
+privilegeset_report(struct Client *source_p)
+{
+       rb_dlink_node *ptr;
+
+       RB_DLINK_FOREACH(ptr, privilegeset_list.head)
+       {
+               struct PrivilegeSet *set = ptr->data;
+
+               /* use RPL_STATSDEBUG for now -- jilles */
+               sendto_one_numeric(source_p, RPL_STATSDEBUG,
+                               "O :%s %s",
+                               set->name,
+                               set->privs);
+       }
+}