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

Add NO_FTPS [FTP] Option to disable FTPS support when necessary

Ideally, a sysop would never need to disable FTPS support, but as a trouble
shooting measure, it can be helpful.
parent 82f3426b
Branches
Tags
No related merge requests found
Pipeline #6879 passed
......@@ -2644,6 +2644,11 @@ static void ctrl_thread(void* arg)
sockprintf(sock,sess,"534 Already in TLS mode");
continue;
}
if(startup->options & FTP_OPT_NO_FTPS) {
lprintf(LOG_NOTICE, "%04d <%s> AUTH TLS rejected because FTPS support is disabled", sock, host_ip);
sockprintf(sock, sess, "431 TLS not available");
continue;
}
if (start_tls(&sock, &sess, TRUE) || sess == -1) {
lprintf(LOG_WARNING, "%04d <%s> failed to initialize TLS successfully", sock, host_ip);
break;
......
......@@ -69,6 +69,7 @@ static struct init_field ftp_init_fields[] = {
#define FTP_OPT_KEEP_TEMP_FILES (1<<7) /* Don't delete temp files (for debugging) */
#define FTP_OPT_ALLOW_BOUNCE (1<<8)
#define FTP_OPT_LOOKUP_PASV_IP (1<<9) /* resolve public IP address for PASV response */
#define FTP_OPT_NO_FTPS (1<<10) // Don't support START_TLS
#define FTP_OPT_NO_HOST_LOOKUP (1<<11)
#define FTP_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */
#define FTP_OPT_MUTE (1U<<31)
......@@ -89,6 +90,7 @@ static ini_bitdesc_t ftp_options[] = {
{ FTP_OPT_KEEP_TEMP_FILES ,"KEEP_TEMP_FILES" },
{ FTP_OPT_ALLOW_BOUNCE ,"ALLOW_BOUNCE" },
{ FTP_OPT_LOOKUP_PASV_IP ,"LOOKUP_PASV_IP" },
{ FTP_OPT_NO_FTPS ,"NO_FTPS" },
{ FTP_OPT_NO_HOST_LOOKUP ,"NO_HOST_LOOKUP" },
{ FTP_OPT_NO_RECYCLE ,"NO_RECYCLE" },
{ FTP_OPT_MUTE ,"MUTE" },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment