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)
This commit is contained in:
Frogomeli 2020-07-09 19:35:08 +02:00 committed by mtheall
parent 0db916db66
commit 9f86715a49

View File

@ -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_)