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

Log unallowed/illegal filenames in quotes

Prefixed or trailing white-space characters would be hard to discern without this.
parent 1d88d809
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -4396,7 +4396,7 @@ static void ctrl_thread(void* arg) ...@@ -4396,7 +4396,7 @@ static void ctrl_thread(void* arg)
if(strcspn(p,ILLEGAL_FILENAME_CHARS)!=strlen(p)) { if(strcspn(p,ILLEGAL_FILENAME_CHARS)!=strlen(p)) {
success=FALSE; success=FALSE;
lprintf(LOG_WARNING,"%04d <%s> !ILLEGAL FILENAME ATTEMPT by %s [%s]: %s" lprintf(LOG_WARNING,"%04d <%s> !ILLEGAL FILENAME ATTEMPT by %s [%s]: '%s'"
,sock, user.alias, host_name, host_ip, p); ,sock, user.alias, host_name, host_ip, p);
ftp_hacklog("FTP FILENAME", user.alias, cmd, host_name, &ftp.client_addr); ftp_hacklog("FTP FILENAME", user.alias, cmd, host_name, &ftp.client_addr);
} else { } else {
...@@ -4568,14 +4568,14 @@ static void ctrl_thread(void* arg) ...@@ -4568,14 +4568,14 @@ static void ctrl_thread(void* arg)
} }
if(illegal_filename(p) if(illegal_filename(p)
|| trashcan(&scfg,p,"file")) { || trashcan(&scfg,p,"file")) {
lprintf(LOG_WARNING,"%04d <%s> !ILLEGAL FILENAME ATTEMPT by %s [%s]: %s" lprintf(LOG_WARNING,"%04d <%s> !ILLEGAL FILENAME ATTEMPT by %s [%s]: '%s'"
,sock, user.alias, host_name, host_ip, p); ,sock, user.alias, host_name, host_ip, p);
sockprintf(sock,sess,"553 Illegal filename attempt"); sockprintf(sock,sess,"553 Illegal filename attempt");
ftp_hacklog("FTP FILENAME", user.alias, cmd, host_name, &ftp.client_addr); ftp_hacklog("FTP FILENAME", user.alias, cmd, host_name, &ftp.client_addr);
continue; continue;
} }
if(!allowed_filename(&scfg, p)) { if(!allowed_filename(&scfg, p)) {
lprintf(LOG_WARNING,"%04d <%s> !UNALLOWED FILENAME ATTEMPT by %s [%s]: %s" lprintf(LOG_WARNING,"%04d <%s> !UNALLOWED FILENAME ATTEMPT by %s [%s]: '%s'"
,sock, user.alias, host_name, host_ip, p); ,sock, user.alias, host_name, host_ip, p);
sockprintf(sock,sess,"553 Unallowed filename attempt"); sockprintf(sock,sess,"553 Unallowed filename attempt");
continue; continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment