Skip Menu |

This queue is for tickets about the Net-SFTP CPAN distribution.

Report information
The Basics
Id: 13821
Status: rejected
Priority: 0/
Queue: Net-SFTP

People
Owner: Nobody in particular
Requestors: tearsea88 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Net::SFTP error handling on bad login
Dist. name and version: Net::SFTP 1.30 2005/01/16 21:36:56 dbrobins Perl Version: v5.8.3 built for i686-linux Operating System: Linux myserver.com 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686 i686 i386 GNU/Linux When trying to connect using Net::SFTP, I'm wondering if there's a way to trap or check the connection status. Example: my $sftp=SFTP2->new($server, user => $user, password=>$pass, warn=>0) if(!$sftp) { #run error controls here } Right now, when I purposely use a bad password, I would get this: Permission denied at /usr/lib/perl5/site_perl/5.8.3/Net/SFTP.pm line 62 Line 62 of SFTP.pm is: $ssh->login($param{user}, $param{password}) It dies there. Is there anyway to work around this or is there a fix or possible patch/fix for future releases?
On Thu Jul 21 18:58:59 2005, guest wrote: ... Show quoted text
> When trying to connect using Net::SFTP, I'm wondering if there's a way > to trap or check the connection status. Example: > > my $sftp=SFTP2->new($server, user => $user, password=>$pass, warn=>0) > > Right now, when I purposely use a bad password, I would get this: > > Permission denied at /usr/lib/perl5/site_perl/5.8.3/Net/SFTP.pm line > 62
Show quoted text
> Is there anyway to work around this or is there a fix or possible > patch/fix for future releases?
I'd prefer to maintain existing behaviour. You can trap the die with eval, e.g. eval { my $sftp = Net::SFTP->new(...); }; if ($@) { # handle failure, $@ is the error message (see perldoc -f eval). } or even my $sftp = eval { Net::SFTP->new(...); }; if (!$sftp) { # handle failure } You may want to take a look at Net::SSH2. I'm primarily fixing bugs in Net::SSH::Perl/Net::SFTP and not adding new functionality.
On Thu Jul 21 18:58:59 2005, guest wrote: Show quoted text
> Dist. name and version: Net::SFTP 1.30 2005/01/16 21:36:56 dbrobins > Perl Version: v5.8.3 built for i686-linux > Operating System: Linux myserver.com 2.4.21-27.ELsmp #1 SMP Wed Dec 1 > 21:59:02 EST 2004 i686 i686 i386 GNU/Linux > > When trying to connect using Net::SFTP, I'm wondering if there's a way > to trap or check the connection status. Example: > > my $sftp=SFTP2->new($server, user => $user, password=>$pass, warn=>0) > > if(!$sftp) { > #run error controls here > } > > Right now, when I purposely use a bad password, I would get this: > > Permission denied at /usr/lib/perl5/site_perl/5.8.3/Net/SFTP.pm line > 62 > > Line 62 of SFTP.pm is: > > $ssh->login($param{user}, $param{password}) > > It dies there. > > Is there anyway to work around this or is there a fix or possible > patch/fix for future releases?
When I said REJECTED the first time, guess what, I meant REJECTED.