Skip Menu |

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

Report information
The Basics
Id: 52687
Status: resolved
Worked: 1.3 hours (80 min)
Priority: 0/
Queue: Net-OpenSSH

People
Owner: salva [...] cpan.org
Requestors: toddr [...] null.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.42
Fixed in: (no value)



Subject: Would like remove need for IO::Pty
When using programs on the remote side like su or sudo, I'm required to use open3pty. The problem with this is it forces me to use IO::Pty, which forces me to use Expect. Is there a way to use open3 but spoof the remote end that we're in a terminal? A Quick look at Net::OpenSSH::Perl::SSH2 seems to indicate that we're only talking about 1 packet of data on a control channel. (see use_pty in the code). This would remove my need to have to use Expect in my code.
Subject: Re: [rt.cpan.org #52687] Would like remove need for IO::Pty
Date: Fri, 11 Dec 2009 14:12:08 -0800 (PST)
To: bug-Net-OpenSSH [...] rt.cpan.org
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message ----
> From: "toddr@null.net via RT" <bug-Net-OpenSSH@rt.cpan.org> > Sent: Fri, December 11, 2009 11:06:00 PM > Subject: [rt.cpan.org #52687] Would like remove need for IO::Pty > > Fri Dec 11 17:05:59 2009: Request 52687 was acted upon. > Transaction: Ticket created by toddr@null.net > Queue: Net-OpenSSH > Subject: Would like remove need for IO::Pty > Broken in: 0.42 > Severity: Wishlist > Owner: Nobody > Requestors: toddr@null.net > Status: new > Ticket > > > When using programs on the remote side like su or sudo, I'm required to use > open3pty. The > problem with this is it forces me to use IO::Pty, which forces me to use Expect.
calling open3 as follows: my ($in, $out, $err, $pid) = $ssh->open3({tty => 1}, $cmd, @args) or die ... should do. Cheers, - Salva
From: toddr [...] null.net
The following comes back with error output: my ($in, $out, $err, $pid) = $ssh->open3({tty => 1}, qw{sudo cat /etc/sudoers}); print "E: $_" while(<$err>); OUTPUT: E: Pseudo-terminal will not be allocated because stdin is not a terminal.
adding the '-t', '-t' master option also does not appear to work. I'm wondering if this is a problem with the -n option? http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1
not a bug
oops, sorry, I missed your last messages.
Can you try the new version 0.43 available from CPAN? It call ssh with -tt instead of -t. That forces tty allocation even when local stdin is not attached to one. Under those conditions I get errors like tcgetattr: Invalid argument but they seem harmless. At least it has not affected the tests I have carried on. Tell me if it works for you. Cheers, - Salva
From: toddr [...] null.net
woohoo! progress! now we just have to figure out how to get rid of the annoying muxserver_accept_control message $>perl ssh.pl muxserver_accept_control: tcgetattr: Inappropriate ioctl for device err E: tcgetattr: Inappropriate ioctl for device out O: Password: O: ## Sudoers allows particular users to run various commands as O: ## the root user, without needing the root password. O: ##
From: toddr [...] null.net
we're having to use master_stderr_discard to supress the output from the error. Do you think this needs to be a standard part of {tty => 1}? If anything, maybe the documentation could be updated to hint about this?
IMO, this is a bug on OpenSSH, I have posted a bug report there, we will see what they said. https://bugzilla.mindrot.org/show_bug.cgi?id=1686 I will document the problem in Net::OpenSSH docs anyway.
There is now a patch available for OpenBSD intended to solve this bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1686
On Mon Dec 21 04:40:50 2009, SALVA wrote: Show quoted text
> There is now a patch available for OpenBSD intended to solve this bug: > > https://bugzilla.mindrot.org/show_bug.cgi?id=1686 >
Thanks for all your help. I think we're good to go. Todd
upcomming OpenSSH release 5.4 will have the bug solved