Skip Menu |

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

Report information
The Basics
Id: 4561
Status: rejected
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: Nobody in particular
Requestors: post [...] rolandgruber.de
Cc:
AdminCc:

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



Subject: Problem with multiple cmd() calls
I have problems executing multiple commands with the cmd() function. Only the first command is executed correctly. The others are ignored and the return values of cmd() are all empty. Here is an example code: my $ssh = Net::SSH::Perl->new($hostname, options=>["UserKnownHostsFile /dev/null"], protocol => "2,1", debug => true ); $ssh->login($username, $password); for ($i=0; $i<=30; $i++) { ($stdout, $stderr, $exit) = $ssh->cmd("touch /tmp/test$i"); } The debug output: Roland: Reading configuration data /home/roland/.ssh/config Roland: Reading configuration data /etc/ssh_config Roland: Connecting to localhost, port 22. Roland: Remote protocol version 2.0, remote software version OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9 Roland: Net::SSH::Perl Version 1.24, protocol version 2.0. Roland: No compat match: OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9. Roland: Connection established. Roland: Sent key-exchange init (KEXINIT), wait response. Roland: Algorithms, c->s: 3des-cbc hmac-sha1 none Roland: Algorithms, s->c: 3des-cbc hmac-sha1 none Roland: Entering Diffie-Hellman Group 1 key exchange. Roland: Sent DH public key, waiting for reply. Roland: Received host key, type 'ssh-dss'. Roland: Permanently added 'localhost' to the list of known hosts. Roland: Computing shared secret key. Roland: Verifying server signature. Roland: Waiting for NEWKEYS message. Roland: Enabling incoming encryption/MAC/compression. Roland: Send NEWKEYS, enable outgoing encryption/MAC/compression. Roland: Sending request for user-authentication service. Roland: Service accepted: ssh-userauth. Roland: Trying empty user-authentication request. Roland: Authentication methods that can continue: publickey,password,keyboard-interactive. Roland: Next method to try is publickey. Roland: Publickey: testing agent key '/home/roland/.ssh/id_dsa' Roland: Authentication methods that can continue: publickey,password,keyboard-interactive. Roland: Next method to try is publickey. Roland: Trying pubkey authentication with key file '/home/roland/.ssh/id_dsa' Roland: Will not query passphrase for '/home/roland/.ssh/id_dsa' in batch mode. Roland: Loading private key failed. Roland: Next method to try is password. Roland: Trying password authentication. Roland: Login completed, opening dummy shell channel. Roland: channel 0: new [client-session] Roland: Requesting channel_open for channel 0. Roland: channel 0: open confirm rwindow 0 rmax 32768 Roland: Got channel open confirmation, requesting shell. Roland: Requesting service shell on channel 0. Roland: channel 1: new [client-session] Roland: Requesting channel_open for channel 1. Roland: Entering interactive session. Roland: Sending command: touch /tmp/o1/test0 Roland: Requesting service exec on channel 1. Roland: channel 1: open confirm rwindow 0 rmax 32768 Roland: input_channel_request: rtype exit-status reply 0 Roland: channel 1: rcvd eof Roland: channel 1: output open -> drain Roland: channel 1: rcvd close Roland: channel 1: input open -> closed Roland: channel 1: close_read Roland: channel 1: obuf empty Roland: channel 1: output drain -> closed Roland: channel 1: close_write Roland: channel 1: send close Roland: channel 1: full closed Roland: channel 2: new [client-session] Roland: Requesting channel_open for channel 2. Roland: Entering interactive session. Roland: channel 3: new [client-session] Roland: Requesting channel_open for channel 3. My Perl version is 5.8.0, Net::SSH::Perl is 1.24 running on Debian Sarge.
From: James R Grinter
It may, or may not, be relevant but I've had problems with even the first cmd() call if the remote OpenSSH-based server had 'UseLogin' enabled. Symptoms are that not all data is always returned, especially from subsequent cmd() calls. -- jrg.
Can't reproduce locally.