Skip Menu |

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

Report information
The Basics
Id: 16629
Status: rejected
Worked: 1 hour (60 min)
Priority: 0/
Queue: Net-SFTP-Foreign

People
Owner: Nobody in particular
Requestors: thomas.blank [...] de.debitel.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.57
Fixed in: (no value)



Subject: Missing return code if sftp-connect fails
Distribution name and version: Net-SFTP-Foreign-0.57 Perl version: "This is perl, v5.8.5 built for sun4-solaris" Operating System vendor and version: SunOS 5.8 Generic_117350-25 sun4u sparc SUNW,Sun-Fire-V240 Solaris (Problem also exists on Linux, with same perl- an distribution-version) I'm missing an appropriate return code from Net::SFTP::Foreign->new() Assume the following code: #!/usr/local/bin/perl -w use strict; use Net::SFTP::Foreign; my $sftp; if ( !($sftp = Net::SFTP::Foreign->new( "myhost", warn => 0, debug => 0, user=> "myuser" #, more => ["-vvv"] )) ) { print STDERR "ERROR\n"; exit 1; } undef $sftp; exit 0; And execute: $ ./fmysftp.pl Permission denied (publickey,keyboard-interactive). reading from ssh pipe failed () at ./fmysftp.pl line 6 $ echo $? 0 An exit-code 0 really makes no sense here. How am I able to check if connection was successfully or not?
the ssh binary does not return meaningful codes on exit, that's why you get 0 on $!. If you want to see what is getting wrong add the option more => '-v' to the constructor. Cheers On Tue Dec 20 07:21:22 2005, guest wrote: Show quoted text
> Distribution name and version: Net-SFTP-Foreign-0.57 > Perl version: "This is perl, v5.8.5 built for sun4-solaris" > Operating System vendor and version: SunOS 5.8 Generic_117350-25 sun4u > sparc SUNW,Sun-Fire-V240 Solaris > (Problem also exists on Linux, with same perl- an distribution- > version) > > I'm missing an appropriate return code from Net::SFTP::Foreign->new() > > Assume the following code: > #!/usr/local/bin/perl -w > use strict; > use Net::SFTP::Foreign; > my $sftp; > if ( !($sftp = Net::SFTP::Foreign->new( > "myhost", > warn => 0, > debug => 0, > user=> "myuser" > #, more => ["-vvv"] > )) ) { > print STDERR "ERROR\n"; > exit 1; > } > undef $sftp; > exit 0; > > And execute: > $ ./fmysftp.pl > Permission denied (publickey,keyboard-interactive). > reading from ssh pipe failed () at ./fmysftp.pl line 6 > $ echo $? > 0 > > An exit-code 0 really makes no sense here. How am I able to check if > connection was successfully or not?