about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2003-10-18 10:11:20 +0000
committerGraham Barr <gbarr@pobox.com>2003-10-18 10:11:20 +0000
commit6a671f9cc89c63c5e9f7c8ad66dcbc916f387ff7 (patch)
tree8722fd0138a15ceab307884ff565b671416c1aea
parent29a7374a7dd6ca5f4e8ae4256172edf0f9268111 (diff)
downloadperl-libnet-6a671f9cc89c63c5e9f7c8ad66dcbc916f387ff7.tar.gz
Net::FTP
- Ensure values returned by PASV are used as decimal values and not octal
  if the server happens to return leading zeros

-rw-r--r--Net/FTP.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index 32471ea..0b56476 100644
--- a/Net/FTP.pm
+++ b/Net/FTP.pm
@@ -22,7 +22,7 @@ use Net::Config;
 use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC);
 # use AutoLoader qw(AUTOLOAD);
 
-$VERSION = "2.74"; # $Id: //depot/libnet/Net/FTP.pm#82 $
+$VERSION = "2.74"; # $Id: //depot/libnet/Net/FTP.pm#83 $
 @ISA     = qw(Exporter Net::Cmd IO::Socket::INET);
 
 # Someday I will "use constant", when I am not bothered to much about
@@ -938,7 +938,7 @@ sub _dataconn
 
  if(defined ${*$ftp}{'net_ftp_pasv'})
   {
-   my @port = split(/,/,${*$ftp}{'net_ftp_pasv'});
+   my @port = map { 0+$_ } split(/,/,${*$ftp}{'net_ftp_pasv'});
 
    $data = $pkg->new(PeerAddr => join(".",@port[0..3]),
                              PeerPort => $port[4] * 256 + $port[5],