Skip to content
Snippets Groups Projects
Commit a14da763 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't include formatting/separators in IP-filter reason strings

parent 05077226
No related branches found
No related tags found
No related merge requests found
...@@ -1781,7 +1781,7 @@ static BOOL badlogin(SOCKET sock, CRYPT_SESSION sess, ulong* login_attempts ...@@ -1781,7 +1781,7 @@ static BOOL badlogin(SOCKET sock, CRYPT_SESSION sess, ulong* login_attempts
ftp_hacklog("FTP LOGIN", user, passwd, client->host, addr); ftp_hacklog("FTP LOGIN", user, passwd, client->host, addr);
if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) { if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) {
char reason[128]; 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)); ,count, seconds_to_str(attempt.time - attempt.first, tmp));
filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL); filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL);
} }
......
...@@ -161,7 +161,7 @@ void sbbs_t::badlogin(const char* user, const char* passwd, const char* protocol ...@@ -161,7 +161,7 @@ void sbbs_t::badlogin(const char* user, const char* passwd, const char* protocol
char ipaddr[INET6_ADDRSTRLEN]; char ipaddr[INET6_ADDRSTRLEN];
inet_addrtop(addr, ipaddr, sizeof(ipaddr)); inet_addrtop(addr, ipaddr, sizeof(ipaddr));
getnameinfo(&addr->addr, addr_len, host_name, sizeof(host_name), NULL, 0, NI_NAMEREQD); 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)); ,count, seconds_to_str(attempt.time - attempt.first, tmp));
filter_ip(&cfg, protocol, reason, host_name, ipaddr, user, /* fname: */NULL); filter_ip(&cfg, protocol, reason, host_name, ipaddr, user, /* fname: */NULL);
} }
......
...@@ -354,7 +354,7 @@ static void badlogin(SOCKET sock, char* user, char* passwd, client_t* client, un ...@@ -354,7 +354,7 @@ static void badlogin(SOCKET sock, char* user, char* passwd, client_t* client, un
#endif #endif
} }
if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) { 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)); ,count, seconds_to_str(attempt.time - attempt.first, tmp));
filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL); filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment