From 2681b86df2dd87546b46ef0d1b6630c3a0d5a0e3 Mon Sep 17 00:00:00 2001 From: Sam Dodrill Date: Sun, 15 Sep 2013 21:33:10 -0700 Subject: [PATCH] Added snotes for failed SASL authentication attempts if need_sasl flag is set Many thanks to Shockk for this patch. References commits: - 15dc12b76e76c6fa2ead773b6b40965223ad453f - Added snotes for failed SASL authentication attempts if need_sasl flag is set. - febd2e2aca27f7f1acfc522f3fda65d8be067edc - Updated help/opers/snomask to add +S snomask. --- help/opers/snomask | 1 + include/snomask.h | 1 + src/s_user.c | 2 ++ src/snomask.c | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/help/opers/snomask b/help/opers/snomask index a09ed7b..de9f3bd 100644 --- a/help/opers/snomask +++ b/help/opers/snomask @@ -16,6 +16,7 @@ Server notice masks: (? designates that the snomask is provided +n - Local client nick changes +r - Invalid usernames and dumb HTTP proxies +s - Generic server messages and oper kills + +S - Clients refused due to failed SASL auth +u - Client connections without auth{} block ? +W - Shows whenever someone does a local whois on you +x - New server introduction and split messages diff --git a/include/snomask.h b/include/snomask.h index a4d12a6..11635be 100644 --- a/include/snomask.h +++ b/include/snomask.h @@ -54,6 +54,7 @@ #define SNO_EXTERNAL 0x00000400 #define SNO_SPY 0x00000800 #define SNO_OPERSPY 0x00001000 +#define SNO_SASLFAIL 0x00002000 char *construct_snobuf(unsigned int val); unsigned int parse_snobuf_to_mask(unsigned int val, const char *sno); diff --git a/src/s_user.c b/src/s_user.c index 3e605e5..4584759 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -355,6 +355,8 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char if(IsNeedSasl(aconf) && !*user->suser) { + sendto_realops_snomask(SNO_SASLFAIL, L_ALL, + "SASL authentication failed, rejecting %s[%s].", source_p->name, source_p->host); ServerStats.is_ref++; sendto_one_notice(source_p, ":*** Notice -- You need to identify via SASL to use this server"); exit_client(client_p, source_p, &me, "SASL access only"); diff --git a/src/snomask.c b/src/snomask.c index a96f48c..f010f83 100644 --- a/src/snomask.c +++ b/src/snomask.c @@ -62,7 +62,7 @@ int snomask_modes[256] = { 0, /* P */ 0, /* Q */ 0, /* R */ - 0, /* S */ + SNO_SASLFAIL, /* S */ 0, /* T */ 0, /* U */ 0, /* V */