Subject: | exit_signal causes segfault |
perl version: perl 5.18.1
ssh2 version: 1.4.266562SSH-2.0-libssh2_1.4.2
Net::SSH2 version: 0.53.
I execute 'ls' on the remote server and do not get an exit status even though 'man ls' says the following about its exit codes:
Exit status:
0 if OK,
1 if minor problems (e.g., cannot access subdirectory),
2 if serious trouble (e.g., cannot access command-line argument).
# ./foo.pl
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
die "Can't connect. ($!)\n"
unless $ssh2->connect('localhost');
die "Can't authenticate.\n"
unless $ssh2->auth_password( 'davewood', 'abcdefgh' );
my $chan = $ssh2->channel();
$chan->exec('ls --help') or die;
say "error" if $ssh2->error;
say "exit status: " . $chan->exit_signal;
davewood@nio:~$ perl foo.pl
Segmentation fault