From a14da763824d4cfa9db2a0231e8eaafcd06431fe Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Sun, 17 Dec 2023 15:03:27 -0800
Subject: [PATCH] Don't include formatting/separators in IP-filter reason
 strings

---
 src/sbbs3/ftpsrvr.c  | 2 +-
 src/sbbs3/login.cpp  | 2 +-
 src/sbbs3/services.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c
index e251297358..aa7f0b7a02 100644
--- a/src/sbbs3/ftpsrvr.c
+++ b/src/sbbs3/ftpsrvr.c
@@ -1781,7 +1781,7 @@ static BOOL badlogin(SOCKET sock, CRYPT_SESSION sess, ulong* login_attempts
 			ftp_hacklog("FTP LOGIN", user, passwd, client->host, addr);
 		if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) {
 			char reason[128];
-			snprintf(reason, sizeof reason, "- TOO MANY CONSECUTIVE FAILED LOGIN ATTEMPTS (%lu in %s)"
+			snprintf(reason, sizeof reason, "TOO MANY CONSECUTIVE FAILED LOGIN ATTEMPTS (%lu in %s)"
 				,count, seconds_to_str(attempt.time - attempt.first, tmp));
 			filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL);
 		}
diff --git a/src/sbbs3/login.cpp b/src/sbbs3/login.cpp
index 0fbc6a0caa..49e460c17b 100644
--- a/src/sbbs3/login.cpp
+++ b/src/sbbs3/login.cpp
@@ -161,7 +161,7 @@ void sbbs_t::badlogin(const char* user, const char* passwd, const char* protocol
 		char ipaddr[INET6_ADDRSTRLEN];
 		inet_addrtop(addr, ipaddr, sizeof(ipaddr));
 		getnameinfo(&addr->addr, addr_len, host_name, sizeof(host_name), NULL, 0, NI_NAMEREQD);
-		snprintf(reason, sizeof reason, "- TOO MANY CONSECUTIVE FAILED LOGIN ATTEMPTS (%lu in %s)"
+		snprintf(reason, sizeof reason, "TOO MANY CONSECUTIVE FAILED LOGIN ATTEMPTS (%lu in %s)"
 			,count, seconds_to_str(attempt.time - attempt.first, tmp));
 		filter_ip(&cfg, protocol, reason, host_name, ipaddr, user, /* fname: */NULL);
 	}
diff --git a/src/sbbs3/services.c b/src/sbbs3/services.c
index 33cebf0cc8..5782ca0727 100644
--- a/src/sbbs3/services.c
+++ b/src/sbbs3/services.c
@@ -354,7 +354,7 @@ static void badlogin(SOCKET sock, char* user, char* passwd, client_t* client, un
 #endif
 	}
 	if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) {
-		snprintf(reason, sizeof reason, "- TOO MANY CONSECUTIVE FAILED LOGIN ATTEMPTS (%lu in %s)"
+		snprintf(reason, sizeof reason, "TOO MANY CONSECUTIVE FAILED LOGIN ATTEMPTS (%lu in %s)"
 			,count, seconds_to_str(attempt.time - attempt.first, tmp));
 		filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL);
 	}
-- 
GitLab