about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>1998-04-19 00:05:11 +0000
committerGraham Barr <gbarr@pobox.com>1998-04-19 00:05:11 +0000
commitb2d5f4a7b176ed93b7945dbabb773af019596196 (patch)
treee0bab49fc00ec8e6a77d70c3fd19a8e18394962e
parent766d74d39140f5c120cde5ba6b1e435a2f22953b (diff)
downloadperl-libnet-b2d5f4a7b176ed93b7945dbabb773af019596196.tar.gz
Net::FTP, Net::POP3
- wrapped getpwuid in eval {} as some OSs (eg NT) do not support it

-rw-r--r--Net/FTP.pm6
-rw-r--r--Net/POP3.pm6
2 files changed, 6 insertions, 6 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index fadf2e5..4bc45de 100644
--- a/Net/FTP.pm
+++ b/Net/FTP.pm
@@ -21,7 +21,7 @@ use Net::Cmd;
 use Net::Config;
 # use AutoLoader qw(AUTOLOAD);
 
-$VERSION = "2.39"; # $Id: //depot/libnet/Net/FTP.pm#24 $
+$VERSION = "2.40"; # $Id: //depot/libnet/Net/FTP.pm#25 $
 @ISA     = qw(Exporter Net::Cmd IO::Socket::INET);
 
 # Someday I will "use constant", when I am not bothered to much about
@@ -233,7 +233,7 @@ sub login
      ($ruser,$pass,$acct) = $rc->lpa()
         if ($rc);
 
-     $pass = eval { "-" . (getpwuid($>))[0] . "@" }
+     $pass = "-" . (eval { (getpwuid($>))[0] } || $ENV{NAME} ) . '@'
         if (!defined $pass && (!defined($ruser) || $ruser =~ /^anonymous/o));
     }
 
@@ -267,7 +267,7 @@ sub authorize
   {
    require Net::Netrc;
 
-   $auth ||= eval { (getpwuid($>))[0] };
+   $auth ||= eval { (getpwuid($>))[0] } || $ENV{NAME};
 
    my $rc = Net::Netrc->lookup(${*$ftp}{'net_ftp_firewall'}, $auth)
         || Net::Netrc->lookup(${*$ftp}{'net_ftp_firewall'});
diff --git a/Net/POP3.pm b/Net/POP3.pm
index bf3e219..3e96c66 100644
--- a/Net/POP3.pm
+++ b/Net/POP3.pm
@@ -13,7 +13,7 @@ use Net::Cmd;
 use Carp;
 use Net::Config;
 
-$VERSION = "2.14"; # $Id: //depot/libnet/Net/POP3.pm#8 $
+$VERSION = "2.15"; # $Id: //depot/libnet/Net/POP3.pm#9 $
 
 @ISA = qw(Net::Cmd IO::Socket::INET);
 
@@ -73,7 +73,7 @@ sub login
   {
    require Net::Netrc;
 
-   $user ||= (getpwuid($>))[0];
+   $user ||= eval { (getpwuid($>))[0] } || $ENV{NAME};
 
    my $m = Net::Netrc->lookup(${*$me}{'net_pop3_host'},$user);
 
@@ -106,7 +106,7 @@ sub apop
   {
    require Net::Netrc;
 
-   $user ||= (getpwuid($>))[0];
+   $user ||= eval { (getpwuid($>))[0] } || $ENV{NAME};
 
    my $m = Net::Netrc->lookup(${*$me}{'net_pop3_host'},$user);