options again if OpenSSH v1 is detected
Revision history for Perl extension Net::SSH.
Revision history for Perl extension Net::SSH.
+0.06 unreleased
+ - patch from Anthony Awtrey <tony@awtrey.com> to use s/=/ / in -o
+ options again if OpenSSH v1 is detected
+
+0.05 Fri Feb 15 15:46:00 2002
- brainfart mis-credit
0.04 Fri Feb 15 14:05:06 2002
- brainfart mis-credit
0.04 Fri Feb 15 14:05:06 2002
package Net::SSH;
use strict;
package Net::SSH;
use strict;
-use vars qw($VERSION @ISA @EXPORT_OK $ssh $DEBUG);
+use vars qw($VERSION @ISA @EXPORT_OK $ssh $equalspace $DEBUG);
use Exporter;
use IO::File;
use IPC::Open2;
use Exporter;
use IO::File;
use IPC::Open2;
@ISA = qw(Exporter);
@EXPORT_OK = qw( ssh issh ssh_cmd sshopen2 sshopen3 );
@ISA = qw(Exporter);
@EXPORT_OK = qw( ssh issh ssh_cmd sshopen2 sshopen3 );
$DEBUG = 0;
$ssh = "ssh";
$DEBUG = 0;
$ssh = "ssh";
+my $reader = IO::File->new();
+my $writer = IO::File->new();
+my $error = IO::File->new();
+open3($writer, $reader, $error, $ssh, '-V');
+my $ssh_version = <$error>;
+chomp($ssh_version);
+$ssh_version =~ s/.*OpenSSH[-|_](\w+?)\.\w+?\.\w+?.*/$1/g;
+if ($ssh_version == 1) {
+ $equalspace = " ";
+} else {
+ $equalspace = "=";
+}
+
=head1 NAME
Net::SSH - Perl extension for secure shell
=head1 NAME
Net::SSH - Perl extension for secure shell
sub ssh {
my($host, @command) = @_;
sub ssh {
my($host, @command) = @_;
- my @cmd = ($ssh, '-o', 'BatchMode=yes', $host, @command);
+ my @cmd = ($ssh, '-o', 'BatchMode'.$equalspace.'yes', $host, @command);
warn "[Net::SSH::ssh] executing ". join(' ', @cmd). "\n"
if $DEBUG;
system(@cmd);
warn "[Net::SSH::ssh] executing ". join(' ', @cmd). "\n"
if $DEBUG;
system(@cmd);
sub sshopen2 {
my($host, $reader, $writer, @command) = @_;
sub sshopen2 {
my($host, $reader, $writer, @command) = @_;
- open2($reader, $writer, $ssh, '-o', 'BatchMode=yes', $host, @command);
+ open2($reader, $writer, $ssh, '-o', 'BatchMode'.$equalspace.'yes', $host, @command);
}
=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND [, ARGS ... ]
}
=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND [, ARGS ... ]
sub sshopen3 {
my($host, $writer, $reader, $error, @command) = @_;
sub sshopen3 {
my($host, $writer, $reader, $error, @command) = @_;
- open3($writer, $reader, $error, $ssh, '-o', 'BatchMode=yes', $host, @command);
+ open3($writer, $reader, $error, $ssh, '-o', 'BatchMode'.$equalspace.'yes', $host, @command);
Martin Langhoff <martin@cwa.co.nz> contributed the ssh_cmd command, and
Jeff Finucane <jeff@cmh.net> updated it and took care of the 0.04 release.
Martin Langhoff <martin@cwa.co.nz> contributed the ssh_cmd command, and
Jeff Finucane <jeff@cmh.net> updated it and took care of the 0.04 release.
+Anthony Awtrey <tony@awtrey.com> contributed a fix for those still using
+OpenSSH v1.
+
=head1 COPYRIGHT
Copyright (c) 2002 Ivan Kohler.
=head1 COPYRIGHT
Copyright (c) 2002 Ivan Kohler.