]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
ircd: rename DNSBL entries from blacklist to dnsbl_entry.
authorAriadne Conill <redacted>
Mon, 6 Jul 2020 03:01:56 +0000 (21:01 -0600)
committerAriadne Conill <redacted>
Mon, 6 Jul 2020 03:20:31 +0000 (21:20 -0600)
include/authproc.h
ircd/authproc.c
ircd/newconf.c
ircd/s_conf.c
ircd/s_user.c
modules/m_stats.c

index bfa747515c4c2bda535117900be6662f3069c7e9..571253f850a94d726063de2fa7d0c577801db1d6 100644 (file)
@@ -30,7 +30,7 @@
 #include "rb_dictionary.h"
 #include "client.h"
 
-struct BlacklistStats
+struct DNSBLEntryStats
 {
        char *host;
        uint8_t iptype;
@@ -60,7 +60,7 @@ enum
 
 extern rb_helper *authd_helper;
 
-extern rb_dictionary *bl_stats;
+extern rb_dictionary *dnsbl_stats;
 extern rb_dlink_list opm_list;
 extern struct OPMListener opm_listeners[LISTEN_LAST];
 
@@ -76,9 +76,9 @@ void authd_accept_client(struct Client *client_p, const char *ident, const char
 void authd_reject_client(struct Client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason);
 void authd_abort_client(struct Client *);
 
-void add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters);
-void del_blacklist(const char *host);
-void del_blacklist_all(void);
+void add_dnsbl_entry(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters);
+void del_dnsbl_entry(const char *host);
+void del_dnsbl_entry_all(void);
 
 bool set_authd_timeout(const char *key, int timeout);
 void ident_check_enable(bool enabled);
index e1545bfc8e6e254c931870e17d169dc0b7eac89a..68078c0e5d93fabe8427f7f1093b17b8bac77808 100644 (file)
@@ -67,7 +67,7 @@ uint32_t cid;
 static rb_dictionary *cid_clients;
 static struct ev_entry *timeout_ev;
 
-rb_dictionary *bl_stats;
+rb_dictionary *dnsbl_stats;
 
 rb_dlink_list opm_list;
 struct OPMListener opm_listeners[LISTEN_LAST];
@@ -581,17 +581,17 @@ timeout_dead_authd_clients(void *notused __unused)
        }
 }
 
-/* Send a new blacklist to authd */
+/* Send a new DNSBL entry to authd */
 void
-add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters)
+add_dnsbl_entry(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters)
 {
        rb_dlink_node *ptr;
-       struct BlacklistStats *stats = rb_malloc(sizeof(struct BlacklistStats));
+       struct DNSBLEntryStats *stats = rb_malloc(sizeof(*stats));
        char filterbuf[BUFSIZE] = "*";
        size_t s = 0;
 
-       if(bl_stats == NULL)
-               bl_stats = rb_dictionary_create("blacklist statistics", rb_strcasecmp);
+       if(dnsbl_stats == NULL)
+               dnsbl_stats = rb_dictionary_create("dnsbl statistics", rb_strcasecmp);
 
        /* Build a list of comma-separated values for authd.
         * We don't check for validity - do it elsewhere.
@@ -615,19 +615,19 @@ add_blacklist(const char *host, const char *reason, uint8_t iptype, rb_dlink_lis
        stats->host = rb_strdup(host);
        stats->iptype = iptype;
        stats->hits = 0;
-       rb_dictionary_add(bl_stats, stats->host, stats);
+       rb_dictionary_add(dnsbl_stats, stats->host, stats);
 
        rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", host, iptype, filterbuf, reason);
 }
 
-/* Delete a blacklist */
+/* Delete a DNSBL entry. */
 void
-del_blacklist(const char *host)
+del_dnsbl_entry(const char *host)
 {
-       struct BlacklistStats *stats = rb_dictionary_retrieve(bl_stats, host);
+       struct DNSBLEntryStats *stats = rb_dictionary_retrieve(dnsbl_stats, host);
        if(stats != NULL)
        {
-               rb_dictionary_delete(bl_stats, host);
+               rb_dictionary_delete(dnsbl_stats, host);
                rb_free(stats->host);
                rb_free(stats);
        }
@@ -636,21 +636,21 @@ del_blacklist(const char *host)
 }
 
 static void
-blacklist_delete(rb_dictionary_element *delem, void *unused)
+dnsbl_delete_elem(rb_dictionary_element *delem, void *unused)
 {
-       struct BlacklistStats *stats = delem->data;
+       struct DNSBLEntryStats *stats = delem->data;
 
        rb_free(stats->host);
        rb_free(stats);
 }
 
-/* Delete all the blacklists */
+/* Delete all the DNSBL entries. */
 void
-del_blacklist_all(void)
+del_dnsbl_entry_all(void)
 {
-       if(bl_stats != NULL)
-               rb_dictionary_destroy(bl_stats, blacklist_delete, NULL);
-       bl_stats = NULL;
+       if(dnsbl_stats != NULL)
+               rb_dictionary_destroy(dnsbl_stats, dnsbl_delete_elem, NULL);
+       dnsbl_stats = NULL;
 
        rb_helper_write(authd_helper, "O rbl_del_all");
 }
index b69c3bfc1224834e9c9588ad88bc683b11164856..ed9267c55d5f85106beb16c21308df6df872e3a9 100644 (file)
@@ -2061,7 +2061,7 @@ conf_set_blacklist_reason(void *data)
                        }
                }
 
-               add_blacklist(yy_blacklist_host, yy_blacklist_reason, yy_blacklist_iptype, &yy_blacklist_filters);
+               add_dnsbl_entry(yy_blacklist_host, yy_blacklist_reason, yy_blacklist_iptype, &yy_blacklist_filters);
        }
 
 cleanup_bl:
index 2021185127571eafcfd324040f1d9b4a16d08af7..ae5f6881b44fbd7ae0655c4c28de042a4be58211 100644 (file)
@@ -1566,7 +1566,7 @@ clear_out_old_conf(void)
                alias_dict = NULL;
        }
 
-       del_blacklist_all();
+       del_dnsbl_entry_all();
 
        privilegeset_mark_all_illegal();
 
index 5ac5f56ea8981c7a62e7e35cd5be483446025203..cb4cf9db392a02273ce9b5a9e201e38c5d604bf6 100644 (file)
@@ -213,25 +213,25 @@ authd_check(struct Client *client_p, struct Client *source_p)
 
        switch(source_p->preClient->auth.cause)
        {
-       case 'B':       /* Blacklists */
+       case 'B':       /* DNSBL */
                {
-                       struct BlacklistStats *stats;
-                       char *blacklist = source_p->preClient->auth.data;
+                       struct DNSBLEntryStats *stats;
+                       char *dnsbl_name = source_p->preClient->auth.data;
 
-                       if(bl_stats != NULL)
-                               if((stats = rb_dictionary_retrieve(bl_stats, blacklist)) != NULL)
+                       if(dnsbl_stats != NULL)
+                               if((stats = rb_dictionary_retrieve(dnsbl_stats, dnsbl_name)) != NULL)
                                        stats->hits++;
 
                        if(IsExemptKline(source_p) || IsConfExemptDNSBL(aconf))
                        {
                                sendto_one_notice(source_p, ":*** Your IP address %s is listed in %s, but you are exempt",
-                                               source_p->sockhost, blacklist);
+                                               source_p->sockhost, dnsbl_name);
                                break;
                        }
 
                        sendto_realops_snomask(SNO_REJ, L_NETWIDE,
                                "Listed on DNSBL %s: %s (%s@%s) [%s] [%s]",
-                               blacklist, source_p->name, source_p->username, source_p->host,
+                               dnsbl_name, source_p->name, source_p->username, source_p->host,
                                IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
                                source_p->info);
 
@@ -239,9 +239,9 @@ authd_check(struct Client *client_p, struct Client *source_p)
                                me.name, source_p->name, reason);
 
                        sendto_one_notice(source_p, ":*** Your IP address %s is listed in %s",
-                               source_p->sockhost, blacklist);
-                       add_reject(source_p, NULL, NULL, NULL, "Banned (DNS blacklist)");
-                       exit_client(client_p, source_p, &me, "Banned (DNS blacklist)");
+                               source_p->sockhost, dnsbl_name);
+                       add_reject(source_p, NULL, NULL, NULL, "Banned (listed in a DNSBL)");
+                       exit_client(client_p, source_p, &me, "Banned (listed in a DNSBL)");
                        reject = true;
                }
                break;
@@ -927,7 +927,7 @@ report_and_set_user_flags(struct Client *source_p, struct ConfItem *aconf)
        if(IsConfExemptDNSBL(aconf))
                /* kline exempt implies this, don't send both */
                if(!IsConfExemptKline(aconf))
-                       sendto_one_notice(source_p, ":*** You are exempt from DNS blacklists");
+                       sendto_one_notice(source_p, ":*** You are exempt from DNSBL listings");
 
        /* If this user is exempt from user limits set it F lined" */
        if(IsConfExemptLimits(aconf))
index 88bca7aa4ed7aeea7980f147562211f674132e1a..ef255ee9dcd9f6f746e0611047c4f052ffd52609 100644 (file)
@@ -756,12 +756,12 @@ static void
 stats_dnsbl(struct Client *source_p)
 {
        rb_dictionary_iter iter;
-       struct BlacklistStats *stats;
+       struct DNSBLEntryStats *stats;
 
-       if(bl_stats == NULL)
+       if(dnsbl_stats == NULL)
                return;
 
-       RB_DICTIONARY_FOREACH(stats, &iter, bl_stats)
+       RB_DICTIONARY_FOREACH(stats, &iter, dnsbl_stats)
        {
                /* use RPL_STATSDEBUG for now -- jilles */
                sendto_one_numeric(source_p, RPL_STATSDEBUG, "n :%d %s",