From fc77bc00adb13d8ca5c7019cd24094a5c265eafb Mon Sep 17 00:00:00 2001 From: Graham Barr Date: Tue, 20 Nov 2001 19:18:22 +0000 Subject: Net::FTP - Send -anonymous@ as the password for the anonymous user, not the real username. Patch from Eduardo Perez Ureta --- Net/FTP.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Net/FTP.pm b/Net/FTP.pm index 531ff40..49db7ca 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.61"; # $Id: //depot/libnet/Net/FTP.pm#61 $ +$VERSION = "2.62"; # $Id: //depot/libnet/Net/FTP.pm#62 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -310,7 +310,7 @@ sub login { ($ruser,$pass,$acct) = $rc->lpa() if ($rc); - $pass = "-" . (eval { (getpwuid($>))[0] } || $ENV{NAME} ) . '@' + $pass = '-anonymous@' if (!defined $pass && (!defined($ruser) || $ruser =~ /^anonymous/o)); } @@ -1200,7 +1200,7 @@ Net::FTP - FTP Client class use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0); - $ftp->login("anonymous",'me@here.there'); + $ftp->login("anonymous",'-anonymous@'); $ftp->cwd("/pub"); $ftp->get("that.file"); $ftp->quit; @@ -1718,6 +1718,6 @@ under the same terms as Perl itself. =for html
-I<$Id: //depot/libnet/Net/FTP.pm#61 $> +I<$Id: //depot/libnet/Net/FTP.pm#62 $> =cut -- cgit v1.2.3-24-ge0c7