From 35c01301914f4e4c8f8370ed37477dc6efd910f5 Mon Sep 17 00:00:00 2001 From: Graham Barr Date: Mon, 1 Aug 2005 22:49:33 +0000 Subject: Try upper and lower USER command --- Net/FTP.pm | 14 ++++++++++++-- 1 file 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(@_) } -- cgit v1.2.3-24-ge0c7