diff --git a/doc/sgml/oper-guide/commands.sgml b/doc/sgml/oper-guide/commands.sgml index 6654cd2..871ee2d 100644 --- a/doc/sgml/oper-guide/commands.sgml +++ b/doc/sgml/oper-guide/commands.sgml @@ -1014,6 +1014,12 @@ Show operator blocks + + O + + Show privset blocks + + p diff --git a/help/opers/stats b/help/opers/stats index e6b27d9..3017eb3 100644 --- a/help/opers/stats +++ b/help/opers/stats @@ -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 diff --git a/include/privilege.h b/include/privilege.h index 2af53f3..46d5cd9 100644 --- a/include/privilege.h +++ b/include/privilege.h @@ -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 diff --git a/modules/m_stats.c b/modules/m_stats.c index 3b08b5d..dd678a3 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -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() * diff --git a/src/privilege.c b/src/privilege.c index 09f5ea0..e1f2507 100644 --- a/src/privilege.c +++ b/src/privilege.c @@ -24,6 +24,7 @@ #include #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); + } +}