Skip Menu |

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

Report information
The Basics
Id: 18154
Status: open
Priority: 0/
Queue: Net-SSH-W32Perl

People
Owner: Nobody in particular
Requestors: ibm.com
rkgreen [...] us
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.05
Fixed in: (no value)



Subject: Script hanging when trying to return data from STDOUT
I'm running ActivePerl 5.8.6 build 811 and have been trying to get a simple script using net-ssh-w32perl (0.05) to run on a Windows XP SP1 platform connecting to a SuSE linux box. I suspect there is an issue with stdout for the following reason. Reading configuration data C:\Documents and Settings\Administrator/.ssh/config Reading configuration data /etc/ssh_config Connecting to xxx.xxx.xxx.xxx, port 22. Socket created, turning on blocking... Remote protocol version 1.99, remote software version OpenSSH_2.9p2 Net::SSH::Perl Version 1.24, protocol version 2.0. No compat match: OpenSSH_2.9p2. Connection established. Sent key-exchange init (KEXINIT), wait response. Algorithms, c->s: 3des-cbc hmac-sha1 none Algorithms, s->c: 3des-cbc hmac-sha1 none Entering Diffie-Hellman Group 1 key exchange. Sent DH public key, waiting for reply. Received host key, type 'ssh-dss'. Host 'xxx.xxx.xxx.xxx' is known and matches the host key. Computing shared secret key. Verifying server signature. Waiting for NEWKEYS message. Enabling incoming encryption/MAC/compression. Send NEWKEYS, enable outgoing encryption/MAC/compression. Sending request for user-authentication service. Service accepted: ssh-userauth. Trying empty user-authentication request. Authentication methods that can continue: publickey,password,keyboard-interactive. Next method to try is publickey. Next method to try is password. Trying password authentication. Login completed, opening dummy shell channel. channel 0: new [client-session] Requesting channel_open for channel 0. channel 0: open confirm rwindow 0 rmax 16384 Got channel open confirmation, requesting shell. Requesting service shell on channel 0. channel 1: new [client-session] Requesting channel_open for channel 1. Entering interactive session. Sending command: Requesting service exec on channel 1. channel 1: open confirm rwindow 0 rmax 16384 =======> Hangs Here. When it runs OK (with the stdout redirect to a file) I get this: Sending command: ls Requesting service exec on channel 1. channel 1: send eof channel 1: open confirm rwindow 131071 rmax 32768 channel 1: rcvd eof channel 1: output open -> drain channel 1: obuf empty channel 1: output drain -> closed channel 1: close_write channel 1: send close input_channel_request: rtype exit-status reply 0 channel 1: rcvd close channel 1: full closed =======> script exits normally
yes but your bug is in the Net::SSH::Perl (1.34) not W32Perl. See https://rt.cpan.org/Ticket/Display.html?id=49820 First Problem is HOME, that helps: use File::HomeDir; $ENV{HOME} = File::HomeDir->my_home; use Net::SSH::W32Perl; or change in Net/SSH/Perl.pm the follow line my $home = $ENV{HOME} || (getpwuid($>))[7]; and the second problem the $proto_class in Net/SSH/Perl.pm, search the follow line: my $proto_class = join '::', __PACKAGE__,($proto == PROTOCOL_SSH2 ? "SSH2" : "SSH1"); and replace this with: my $proto_class; if($^O eq 'MSWin32' && $proto == PROTOCOL_SSH2){ $proto_class='Net::SSH::W32Perl::SSH2' }else{ $proto_class = join '::', __PACKAGE__,($proto == PROTOCOL_SSH2 ? "SSH2" : "SSH1"); }