Skip Menu |

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

Report information
The Basics
Id: 41908
Status: open
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: greg [...] turnstep.com
Requestors: craig [...] alcatel-lucent.com
Cc: deorth [...] gmail.com
phirince [...] gmail.com
AdminCc:

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



Subject: use_pty=>1 not implemented in SSH2.pm:cmd()
Folks- It seems that the existing software does not allow you to create an SSH2 connection with a tty setup on the target machine, but does work fine with an SSH1 connection. This bug was identified (an pretty much fixed) a long time ago: http://www.derkeiler.com/Newsgroups/comp.security.ssh/2003-05/0097.html This problem is also described at: http://www.perlmonks.org/?node_id=732192 The attached file is example code that will expose the problem. The fix is pretty much what Quackie tried back in 2003. Here is my version of his code, that seems to make it work on my machine: sub cmd { my $ssh = shift; my($cmd, $stdin) = @_; my $cmgr = $ssh->channel_mgr; my $channel = $ssh->_session_channel; $channel->open; $channel->register_handler(SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, sub { my($channel, $packet) = @_; $channel->{ssh}->debug("Sending remote TTY request..."); # CMV MODS ********* my $r_packet = $channel->request_start('pty-req', 0); my($term) = $ENV{TERM} =~ /(\w+)/; $r_packet->put_str($term); $r_packet->put_int32(0) for 1..4; # For terminal size (I think)... $r_packet->put_str(""); $r_packet->send; $channel->{ssh}->debug("Sending command: $cmd"); $r_packet = $channel->request_start("exec", 0); $r_packet->put_str($cmd); $r_packet->send; # CMV MODS ********* This is from SSH2.pm V1.38. I would suggest that final implementation check for the use_pty setting and only execute it if requested by the user. Also retrieving and setting the current terminal size (as implemented in SSH2.pm version 1.46 in the shell() subroutine) would probably be a good idea as well. -Craig
Subject: tst04-3
Download tst04-3
application/octet-stream 1.2k

Message body not shown because it is not plain text.

I see the latest module contains experimental code to fix this. Any timeline on when it will be declared stable ?
Guys, I tested the "experimental" code in version 1.34 and it seems to be working fine. Can you guys please enable it by default ? Thanks, -Phirince
Applied, will be in 1.35
From: phirince [...] gmail.com
On Mon Oct 26 07:20:01 2009, greg@turnstep.com wrote: Show quoted text
> Applied, will be in 1.35
Any update on this? It has been more than a year now. Thanks, -Phirince
On Thu Nov 04 03:34:21 2010, phirince wrote: Show quoted text
> On Mon Oct 26 07:20:01 2009, greg@turnstep.com wrote:
> > Applied, will be in 1.35
> > Any update on this? It has been more than a year now.
I just created a public repository from the CPAN snapshots https://github.com/renormalist/Net-SSH-Perl but the said patch is not contained in there. @greg: If you can provide me with your original repo or its patches I can apply them and make another release. Kind regards, Steffen -- Steffen Schwigon <ss5@renormalist.net> Dresden Perl Mongers <http://dresden-pm.org/>