From be52c4c062d6d3cd3d171e55d993fcc9cf2c5070 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 11 Aug 2021 17:08:31 +0100 Subject: [PATCH] add SNO_BANNED, snote for it on client k/x-line rejection (#242) * add SNO_BANNED, snote for it on client k/x-line rejection * add snomask help file line for SNO_BANNED --- help/opers/snomask | 1 + include/snomask.h | 1 + ircd/s_conf.c | 4 ++++ ircd/s_user.c | 4 ++++ ircd/snomask.c | 2 +- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/help/opers/snomask b/help/opers/snomask index 4901cb0b..c90c68db 100644 --- a/help/opers/snomask +++ b/help/opers/snomask @@ -5,6 +5,7 @@ Server notice masks: SNOMASK DESCRIPTION ----------------------------------------------------------------- +b - Possible spambot/flooder warnings + +B - Connections rejected due to K-Lines and X-Lines +c - Local client connections and exits +C - Extended local client connections and exits +d - Server debug messages diff --git a/include/snomask.h b/include/snomask.h index 49a84ff3..e7b3da12 100644 --- a/include/snomask.h +++ b/include/snomask.h @@ -52,6 +52,7 @@ #define SNO_EXTERNAL 0x00000400 #define SNO_SPY 0x00000800 #define SNO_OPERSPY 0x00001000 +#define SNO_BANNED 0x00002000 char *construct_snobuf(unsigned int val); unsigned int parse_snobuf_to_mask(unsigned int val, const char *sno); diff --git a/ircd/s_conf.c b/ircd/s_conf.c index 28acd6c0..572804d3 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -366,6 +366,10 @@ verify_access(struct Client *client_p, const char *username) form_str(ERR_YOUREBANNEDCREEP), me.name, client_p->name, get_user_ban_reason(aconf)); + + sendto_realops_snomask(SNO_BANNED, L_NETWIDE, + "Rejecting K-Lined user %s [%s@%s]", + get_client_name(client_p, HIDE_IP), aconf->user, aconf->host); add_reject(client_p, aconf->user, aconf->host, aconf, NULL); return (BANNED_CLIENT); } diff --git a/ircd/s_user.c b/ircd/s_user.c index 6512b7bf..665a09c5 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -596,6 +596,10 @@ register_local_user(struct Client *client_p, struct Client *source_p) (xconf = find_xline(source_p->info, 1)) != NULL) { ServerStats.is_ref++; + sendto_realops_snomask(SNO_BANNED, L_NETWIDE, + "Rejecting X-Lined user %s [%s]", + get_client_name(client_p, HIDE_IP), xconf->host); + add_reject(source_p, xconf->host, NULL, NULL, NULL); exit_client(client_p, source_p, &me, "Bad user info"); return CLIENT_EXITED; diff --git a/ircd/snomask.c b/ircd/snomask.c index c4d34ce8..f3ecde0e 100644 --- a/ircd/snomask.c +++ b/ircd/snomask.c @@ -43,7 +43,7 @@ int snomask_modes[256] = { /* 0x30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x3F */ 0, /* @ */ 0, /* A */ - 0, /* B */ + SNO_BANNED, /* B */ SNO_CCONNEXT, /* C */ 0, /* D */ 0, /* E */