Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: seisen [...] gmail.com
Cc:
AdminCc:

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



Subject: Can not specify SSH client arguments
fix: usage example: ========================= my @options = ( '-o', 'BatchMode=yes', '-o', 'StrictHostKeyCheckin=no', '-o', 'PasswordAuthentication=no'); sshopen3("root\@$HOST", *WRITER, *READER, *ERROR, "$command", @options); ========================= Diff: ================ 1c1 < package Net::SSH; --- Show quoted text
> #package Net::SSH;
158c158 < =item sshopen2 [USER@]HOST, READER, WRITER, COMMAND [, ARGS ... ] --- Show quoted text
> =item sshopen2 [USER@]HOST, READER, WRITER, COMMAND, [@SSH_OPTIONS]
165c165 < my($host, $reader, $writer, @command) = @_; --- Show quoted text
> my($host, $reader, $writer, @command, @ssh_options) = @_;
170c170 < =item sshopen3 HOST, WRITER, READER, ERROR, COMMAND [, ARGS ... ] --- Show quoted text
> =item sshopen3 HOST, WRITER, READER, ERROR, COMMAND, [@SSH_OPTIONS]
177c177 < my($host, $writer, $reader, $error, @command) = @_; --- Show quoted text
> my($host, $writer, $reader, $error, @command, @ssh_options) = @_;
================
Subject: Can not specify SSH client arguments
fix: usage example: ========================= my @options = ( '-o', 'BatchMode=yes', '-o', 'StrictHostKeyCheckin=no', '-o', 'PasswordAuthentication=no'); sshopen3("root\@$HOST", *WRITER, *READER, *ERROR, "$command", @options); =========================
Subject: SSH.diff
--- /usr//share/perl5/Net/SSH.pm 2008-09-23 16:57:34.000000000 +0200 +++ SSH.pm 2008-09-23 17:41:56.860018000 +0200 @@ -1,4 +1,4 @@ -package Net::SSH; +#package Net::SSH; use strict; use vars qw($VERSION @ISA @EXPORT_OK $ssh $equalspace $DEBUG @ssh_options); @@ -155,26 +155,26 @@ } -=item sshopen2 [USER@]HOST, READER, WRITER, COMMAND [, ARGS ... ] +=item sshopen2 [USER@]HOST, READER, WRITER, COMMAND, [@SSH_OPTIONS] Connects the supplied filehandles to the ssh process (in batch mode). =cut sub sshopen2 { - my($host, $reader, $writer, @command) = @_; + my($host, $reader, $writer, @command, @ssh_options) = @_; @ssh_options = &_ssh_options unless @ssh_options; open2($reader, $writer, $ssh, @ssh_options, $host, @command); } -=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND [, ARGS ... ] +=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND, [@SSH_OPTIONS] Connects the supplied filehandles to the ssh process (in batch mode). =cut sub sshopen3 { - my($host, $writer, $reader, $error, @command) = @_; + my($host, $writer, $reader, $error, @command, @ssh_options) = @_; @ssh_options = &_ssh_options unless @ssh_options; open3($writer, $reader, $error, $ssh, @ssh_options, $host, @command); }
FYI: Patch does not work. You can't specify two arrays ( @command and @options) on the left side of a list assignment. On Tue Sep 23 11:46:41 2008, dakol wrote: Show quoted text
> fix: > > > usage example: > ========================= > my @options = ( '-o', 'BatchMode=yes', > '-o', 'StrictHostKeyCheckin=no', > '-o', 'PasswordAuthentication=no'); > > sshopen3("root\@$HOST", *WRITER, *READER, *ERROR, "$command",
@options); Show quoted text
> =========================
Subject: Re: [rt.cpan.org #39545] Can not specify SSH client arguments
Date: Wed, 24 Sep 2008 12:56:03 +0200
To: bug-Net-SSH [...] rt.cpan.org
From: "Fabien Seisen" <seisen [...] gmail.com>
i press the submit button a bit too fast. here is a working patch. I created a "sshopen4" function which does the tric

Message body is not shown because sender requested not to inline it.

On Wed Sep 24 06:56:55 2008, dakol wrote: Show quoted text
> i press the submit button a bit too fast. > > here is a working patch. > I created a "sshopen4" function which does the tric
I don't think that's necessarily a good name, or that adding a method is the way to go. sshopen2 and sshopen3 are analagous to IPC::Open2 and IPC::Open3. There is no IPC::Open4...