[Melbourne-pm] FTP on RHEL [SEC=UNCLASSIFIED]
Timothy Hunt
T.Hunt at bom.gov.au
Sun Mar 15 20:39:58 PDT 2015
Hi Mongers. Being a public servant I have to use 'out of the box' versions of Perl. One of our data collection services is transitioning from RHEL5 to RHEL6. It uses FTP...
On RHEL5: This is perl, v5.8.8
perl ftp_test.pl
Net::FTP>>> Net::FTP(2.75)
Net::FTP>>> Exporter(5.58)
Net::FTP>>> Net::Cmd(2.26)
Net::FTP>>> IO::Socket::INET(1.29)
Net::FTP>>> IO::Socket(1.29)
Net::FTP>>> IO::Handle(1.25)
Net::FTP=GLOB(0xb4d5460)<<< 220 example.com FTP server (Version 4.2 Mon Dec 21 13:38:18 CST 2009) ready.
Net::FTP=GLOB(0xb4d5460)>>> user anonymous
Net::FTP=GLOB(0xb4d5460)<<< 331 Guest login ok, send ident as password.
Net::FTP=GLOB(0xb4d5460)>>> PASS ....
Net::FTP=GLOB(0xb4d5460)<<< 230-Last unsuccessful login: Mon Sep 9 08:00:38 AEST 2013 on /dev/pts/40 from foo.example.com Net::FTP=GLOB(0xb4d5460)<<< 230-Last login: Mon Mar 16 13:22:17 AEDT 2015 on ftp from foo.example.com
Net::FTP=GLOB(0xb4d5460)<<< 230 Guest login ok, access restrictions apply.
Net::FTP=GLOB(0xb4d5460)>>> CWD /pub/tmp
Net::FTP=GLOB(0xb4d5460)<<< 250 CWD command successful.
Net::FTP=GLOB(0xb4d5460)>>> PASV
Net::FTP=GLOB(0xb4d5460)<<< 227 Entering Passive Mode (x,y,z,a,252,56)
Net::FTP=GLOB(0xb4d5460)>>> NLST T*
Net::FTP=GLOB(0xb4d5460)<<< 550 Bad directory components
Bad directory components
So there are no "T*" files, fail with 550, move on...
RHEL6: This is perl, v5.10.1
Net::FTP>>> Net::FTP(2.77)
Net::FTP>>> Exporter(5.63)
Net::FTP>>> Net::Cmd(2.29)
Net::FTP>>> IO::Socket::INET(1.31)
Net::FTP>>> IO::Socket(1.31)
Net::FTP>>> IO::Handle(1.28)
Net::FTP=GLOB(0xbab080)<<< 220 example.com FTP server (Version 4.2 Mon Dec 21 13:38:18 CST 2009) ready.
Net::FTP=GLOB(0xbab080)>>> USER anonymous
Net::FTP=GLOB(0xbab080)<<< 331 Guest login ok, send ident as password.
Net::FTP=GLOB(0xbab080)>>> PASS ....
Net::FTP=GLOB(0xbab080)<<< 230-Last unsuccessful login: Mon Sep 9 08:00:38 AEST 2013 on /dev/pts/40 from foo.example.com Net::FTP=GLOB(0xbab080)<<< 230-Last login: Mon Mar 16 12:17:46 AEDT 2015 on ftp from foo.example.com
Net::FTP=GLOB(0xbab080)<<< 230 Guest login ok, access restrictions apply.
Net::FTP=GLOB(0xbab080)>>> CWD /pub/tmp
Net::FTP=GLOB(0xbab080)<<< 250 CWD command successful.
Net::FTP=GLOB(0xbab080)>>> PASV Net::FTP=GLOB(0xbab080)<<< 227 Entering Passive Mode (x,z,c,v,222,248)
Net::FTP=GLOB(0xbab080)>>> NLST T*
Can't use an undefined value as a symbol reference at /usr/share/perl5/Net/FTP/dataconn.pm line 54.
Which is not the expected 550.
I have had a look at the change logs but didn't notice anything significant. As mentioned, I don't have the option of upgrading Perl outside the distro.
Enough code to make it break is:
#!/usr/bin/perl
use strict;
use Net::FTP;
my $server = 'xxxx';
my $filename = 'T*'; # <<< but make sure that there are no T* files in the dir.
my $ftp = Net::FTP->new($server,Debug=>3,Passive=>1) or die "Cannot connect to some.host.name: $@";
$ftp->login("anonymous",'-anonymous@') or die "Cannot login ", $ftp->message;
$ftp->cwd($dir) or die "Cannot change working directory ", $ftp->message;
my $res = $ftp->ls($file_name) or die $ftp->message;
Hints welcomed.
Cheers,
Tim
--
Tim Hunt
Information Systems and Services Division
Bureau of Meteorology
Level 7, 700 Collins Street, Docklands VIC 3008
Tel: +61 3 9669 4094 | t.hunt at bom.gov.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20150316/bfba3056/attachment.html>
More information about the Melbourne-pm
mailing list