cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Broken libcurl FTP list parsing

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Sun, 26 Jan 2014 13:33:13 +0000

On Sun, 26 Jan 2014, Marc Hörsken wrote:

> ftpserver.pl actually does not send a correct FTP LISTing since it is
using
> [CR] for test case 100 instead of [CR][LF] in accordance with RFC959.

We had the same problem in the IMAP, POP3 and SMTP tests - and what we have
done there is to include CRLF in the data lines of the data section. With
your proposed fix we could do the same for those protocols so that the
correct line ending don't need to be included in the data section of the
test specification.

We might want to consider extending the fix even further as well... Rather
than simply fixing up the relevant places that call sendcontrol() or
senddata() we put the fix into those functions instead. For example there is
currently an error on line 2601 of ftpserver.pl that does the following:

sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\n", $pasvport);

Which I believe should be:

sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\r\n", $pasvport);

However, it doesn't cause any problems for curl so I have never fixed it.

Modifying these functions to automatically include the line ending if it
wasn't specified and correct it if it was would mean that this sort of thing
wouldn’t happen in the future ;-) As senddata() can contain binary data we
would have to take than into consideration.

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-26