+++ This bug was initially created as a clone of Bug #1263378 +++
Transferring a unix text file via ftp with the perl Net:FTP module in ASCII mode leads to incorrect data in the transferred file when the source file contains 2 or more consecutive blank lines due to an incorrect transformation of source data from unix text format to the Network Virtual Terminal (NVT) data format.
--- Additional comment from Petr Pisar on 2015-09-16 13:20:04 GMT ---
Upstream fixed this issue with libnet's commit:
From 24eb8619451c3d8529d903d9133d03a7f447488f Mon Sep 17 00:00:00 2001
From: Steve Hay <firstname.lastname@example.org>
Date: Fri, 3 Jan 2014 17:41:55 +0000
Subject: [PATCH] Fix incorrect handling of CRLF in Net::FTP
perl-5.16.3-286.el7.x86_64 is affected.
Created attachment 1086908 [details]
Upstream fix ported to perl-5.16.3
How to test:
(1) Install vsftpd server, configure it to enable anonymous upload into /var/ftp/upload directory from localhost, keep ascii_upload_enable=NO.
(2) Install perl, and strict, warnings, Net::FTP, Data::Dumper, Test::More Perl modules.
(3) Store testdata file from https://bugzilla.redhat.com/attachment.cgi?id=1073993 into /tmp/testdata.
(4) Execute reproducer from https://bugzilla.redhat.com/attachment.cgi?id=1073992.
The reproducer fails on `remote file matches expected content' test.
The file stored on the server will have some CR bytes missing.
The reproducer returns 0 exit code as all tests pass.
The file stored on the serer will have all CR's converted onto CR-LF pairs.
It looks good.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.