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
This commit is contained in:
jesopo 2021-08-11 17:08:31 +01:00 committed by GitHub
parent 0fd3040caf
commit be52c4c062
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 1 deletions

View file

@ -5,6 +5,7 @@ Server notice masks:
SNOMASK DESCRIPTION SNOMASK DESCRIPTION
----------------------------------------------------------------- -----------------------------------------------------------------
+b - Possible spambot/flooder warnings +b - Possible spambot/flooder warnings
+B - Connections rejected due to K-Lines and X-Lines
+c - Local client connections and exits +c - Local client connections and exits
+C - Extended local client connections and exits +C - Extended local client connections and exits
+d - Server debug messages +d - Server debug messages

View file

@ -52,6 +52,7 @@
#define SNO_EXTERNAL 0x00000400 #define SNO_EXTERNAL 0x00000400
#define SNO_SPY 0x00000800 #define SNO_SPY 0x00000800
#define SNO_OPERSPY 0x00001000 #define SNO_OPERSPY 0x00001000
#define SNO_BANNED 0x00002000
char *construct_snobuf(unsigned int val); char *construct_snobuf(unsigned int val);
unsigned int parse_snobuf_to_mask(unsigned int val, const char *sno); unsigned int parse_snobuf_to_mask(unsigned int val, const char *sno);

View file

@ -366,6 +366,10 @@ verify_access(struct Client *client_p, const char *username)
form_str(ERR_YOUREBANNEDCREEP), form_str(ERR_YOUREBANNEDCREEP),
me.name, client_p->name, me.name, client_p->name,
get_user_ban_reason(aconf)); 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); add_reject(client_p, aconf->user, aconf->host, aconf, NULL);
return (BANNED_CLIENT); return (BANNED_CLIENT);
} }

View file

@ -596,6 +596,10 @@ register_local_user(struct Client *client_p, struct Client *source_p)
(xconf = find_xline(source_p->info, 1)) != NULL) (xconf = find_xline(source_p->info, 1)) != NULL)
{ {
ServerStats.is_ref++; 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); add_reject(source_p, xconf->host, NULL, NULL, NULL);
exit_client(client_p, source_p, &me, "Bad user info"); exit_client(client_p, source_p, &me, "Bad user info");
return CLIENT_EXITED; return CLIENT_EXITED;

View file

@ -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 */ /* 0x30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x3F */
0, /* @ */ 0, /* @ */
0, /* A */ 0, /* A */
0, /* B */ SNO_BANNED, /* B */
SNO_CCONNEXT, /* C */ SNO_CCONNEXT, /* C */
0, /* D */ 0, /* D */
0, /* E */ 0, /* E */