Commit ca9ab24e authored by Marc Hoersken's avatar Marc Hoersken
Browse files

ftpserver.pl: directory LISTings use [CR][LF] for ASCII transfer

According to section 2.2 of RFC959 the End-of-Line is defined as:
 The end-of-line sequence defines the separation of printing
 lines.  The sequence is Carriage Return, followed by Line Feed.

Verified by sniffing traffic between a Windows FTP client (FileZilla)
and Unix-hosted FTP server (ProFTPD).
parent 480ca49e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2160,6 +2160,9 @@ my @ftpdir=("total 20\r\n",
        my @data = getpart("reply", "data");
        for(@data) {
            my $send = $_;
            # convert all \n to \r\n for ASCII transfer
            $send =~ s/\r\n/\n/g;
            $send =~ s/\n/\r\n/g;
            logmsg "send $send as data\n";
            senddata $send;
        }