cURL / Mailing Lists / curl-library / Single Mail


RE: Broken libcurl FTP list parsing

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

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

> actually does not send a correct FTP LISTing since it is
> [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 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


List admin:
Received on 2014-01-26