about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2005-08-01 22:49:33 +0000
committerGraham Barr <gbarr@pobox.com>2009-02-24 10:40:46 -0600
commit35c01301914f4e4c8f8370ed37477dc6efd910f5 (patch)
tree3fb111499c5ff6398e8b347e0c0b913af7467dc0
parentb2ce2337b0b3cb940fea08526fd484314066c370 (diff)
downloadperl-libnet-35c01301914f4e4c8f8370ed37477dc6efd910f5.tar.gz
Try upper and lower USER command
-rw-r--r--Net/FTP.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index f931b09..2cbb4d9 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.76";
+$VERSION = '2.77';
 @ISA     = qw(Exporter Net::Cmd IO::Socket::INET);
 
 # Someday I will "use constant", when I am not bothered to much about
@@ -1217,11 +1217,21 @@ sub _STOR { shift->command("STOR",@_)->response() == CMD_INFO }
 sub _STOU { shift->command("STOU",@_)->response() == CMD_INFO }
 sub _RNFR { shift->command("RNFR",@_)->response() == CMD_MORE }
 sub _REST { shift->command("REST",@_)->response() == CMD_MORE }
-sub _USER { shift->command("user",@_)->response() } # A certain brain dead firewall :-)
 sub _PASS { shift->command("PASS",@_)->response() }
 sub _ACCT { shift->command("ACCT",@_)->response() }
 sub _AUTH { shift->command("AUTH",@_)->response() }
 
+sub _USER {
+  my $ftp = shift;
+  my $ok = $ftp->command("USER",@_)->response();
+
+  # A certain brain dead firewall :-)
+  $ok = $ftp->command("user",@_)->response()
+    unless $ok == CMD_MORE or $ok == CMD_OK;
+
+  $ok;
+}
+
 sub _SMNT { shift->unsupported(@_) }
 sub _MODE { shift->unsupported(@_) }
 sub _SYST { shift->unsupported(@_) }