develooper Front page | perl.perl5.porters | Postings from January 2011

[perl #82378] Bug in Net::FTP.pm

Thread Next
From:
NEWPORT Dennis
Date:
January 19, 2011 01:06
Subject:
[perl #82378] Bug in Net::FTP.pm
Message ID:
rt-3.6.HEAD-5425-1295334467-1571.82378-75-0@perl.org
# New Ticket Created by  "NEWPORT Dennis" 
# Please include the string:  [perl #82378]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=82378 >


Background:

OS: RedHat 5, 2.6.18-92.el5
Module: Net::FTP.pm, version 2.78

We used to use wu-ftpd on HP-UX and then migrated to vsftpd on our new
RedHat linux machines. But vsftpd was not good at for some of our
pattern matching and wildcarding requirements on filenames so we have
now upgraded to ProFTPD. This is where the problem has occurred.

We use a Perl script to do some of our ftp'ing. It uses Net::FTP.pm. In
this we call put_unique. The problem is that the wu-ftpd and vsftpd ftp
implementations returned a string that said something like:

<<< 226 Transfer complete (unique file name:TEST_FILE).

where TEST_FILE was the name of the file we were ftp'ing, whereas
ProFTPD returns a sting that says:

<<< 150 FILE: ftpZpQr2p

where ftpZpQr2p is the name given to the unique file. But in this latter
case, this string (ftpZpQr2p) is not returned from put_unique. That is
because in the _store_cmd subroutine there is this line:

if ('STOU' eq uc $cmd and $ftp->message =~ m/unique\ file\
name:(.*)\)|"(.*)"/)

If this is changed to:

if ('STOU' eq uc $cmd and ($ftp->message =~ m/unique\ file\
name:(.*)\)|"(.*)"/ or $ftp->message =~ m/FILE:\ (.*)/))

then put_unique behaves as documented.

I've tested this and it works with wu-ftpd, vsftpd and ProFTPD.

Thanks.


---------------------
Dennis Newport

Central Flow Management Unit
Eurocontrol
Raketstraat 96
B-1130 Brussels
Belgium

email:          dennis.newport@eurocontrol.int
<mailto:dennis.newport@eurocontrol.int>
tel:            +32 2 729 9621
fax:            +32 2 729 9703
GSM:    +32 499 943624



____
 
This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.
 
Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.
 
Any views expressed in this message are those of the sender.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About