]> jfr.im git - irc/freenode/solanum.git/commitdiff
Add /stats s to list secure blocks
authorEd Kellett <redacted>
Sun, 8 Nov 2020 23:29:56 +0000 (23:29 +0000)
committerEd Kellett <redacted>
Mon, 9 Nov 2020 00:26:56 +0000 (00:26 +0000)
`s` and `S` were both used for ssld stats, but only `S` was documented,
so I'm taking `s`. You can't stop me!

help/opers/stats
modules/m_stats.c

index a4a5fd665a1f88995e80080449f3e9b67380f4f1..9461e5b75cf396bc6618da492ee03a4b6c8fcdd0 100644 (file)
@@ -32,6 +32,7 @@ X f - Shows File Descriptors
 * q - Shows temporary and global resv'd nicks and channels
 * Q - Shows resv'd nicks and channels
 * r - Shows resource usage by ircd
+* s - Shows secure blocks
 X S - Shows ssld processes
 * t - Shows generic server stats
   u - Shows server uptime
index 2464eed950ae18da781279b2523407842e76cee7..5063fc6135d06283d8e559b48a19f7f19710f6ba 100644 (file)
@@ -116,6 +116,7 @@ static void stats_operedup(struct Client *);
 static void stats_ports(struct Client *);
 static void stats_tresv(struct Client *);
 static void stats_resv(struct Client *);
+static void stats_secure(struct Client *);
 static void stats_ssld(struct Client *);
 static void stats_usage(struct Client *);
 static void stats_tstats(struct Client *);
@@ -177,7 +178,7 @@ static struct stats_cmd stats_cmd_table[256] = {
        ['Q'] = HANDLER_NORM(stats_resv,        false,  "oper:general"),
        ['r'] = HANDLER_NORM(stats_usage,       false,  "oper:general"),
        ['R'] = HANDLER_NORM(stats_usage,       false,  "oper:general"),
-       ['s'] = HANDLER_NORM(stats_ssld,        true,   NULL),
+       ['s'] = HANDLER_NORM(stats_secure,      false,  "oper:general"),
        ['S'] = HANDLER_NORM(stats_ssld,        true,   NULL),
        ['t'] = HANDLER_NORM(stats_tstats,      false,  "oper:general"),
        ['T'] = HANDLER_NORM(stats_tstats,      false,  "oper:general"),
@@ -485,7 +486,8 @@ stats_exempt(struct Client *source_p)
                                                   'e', host, pass, "", "");
                        }
                }
-       }}
+       }
+}
 
 
 static void
@@ -918,6 +920,26 @@ stats_resv(struct Client *source_p)
        }
 }
 
+static void
+stats_secure(struct Client *source_p)
+{
+       struct AddressRec *arec;
+       struct ConfItem *aconf;
+       size_t i;
+
+       for (i = 0; i < ATABLE_SIZE; i++)
+       {
+               for (arec = atable[i]; arec; arec = arec->next)
+               {
+                       if(arec->type == CONF_SECURE)
+                       {
+                               aconf = arec->aconf;
+                               sendto_one_numeric(source_p, RPL_STATSDEBUG, "s :%s", aconf->host);
+                       }
+               }
+       }
+}
+
 static void
 stats_ssld_foreach(void *data, pid_t pid, int cli_count, enum ssld_status status, const char *version)
 {