From 9f86715a4999fcec355162767832c5bb48e229fc Mon Sep 17 00:00:00 2001 From: Frogomeli Date: Thu, 9 Jul 2020 19:35:08 +0200 Subject: [PATCH] Improve the support of command 227 The use of Rclone fail when tries to connect using FTP protocol. Rclone can't connect to the server ftp on Switch because of bad formatting of 227 command. > Rclone is a command line program to manage files on cloud storage. Source: https://rclone.org/ Rclone use this go library: * https://github.com/jlaffaye/ftp The lib check the connection information between the parenthesis but there aren't in the string formatted by this software Source: https://github.com/jlaffaye/ftp/blob/master/ftp.go#L391 Also there is other source of origin of this fix: * https://tools.ietf.org/html/rfc959 (the RFC of FTP Protocol) * https://github.com/proftpd/proftpd/blob/master/modules/mod_core.c#L3873 (proftpd a server FTP implementation) --- source/ftpSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ftpSession.cpp b/source/ftpSession.cpp index b797efd..6ff2d49 100644 --- a/source/ftpSession.cpp +++ b/source/ftpSession.cpp @@ -2242,7 +2242,7 @@ void FtpSession::PASV (char const *args_) } m_pasv = true; - sendResponse ("227 %s,%u,%u\r\n", name.c_str (), port >> 8, port & 0xFF); + sendResponse ("227 Entering Passive Mode (%s,%u,%u).\r\n", name.c_str (), port >> 8, port & 0xFF); } void FtpSession::PORT (char const *args_)