Merge branch 'gusson-ssh_port'

Conflicts:
	CHANGELIST
	findoid
	sanoid
	syncoid
This commit is contained in:
Jim Salter 2016-05-27 18:58:48 -04:00
commit cd19307ab4
4 changed files with 29 additions and 4 deletions

View File

@ -1,3 +1,8 @@
<<<<<<< HEAD
=======
1.4.6c merged @gusson's pull request to add -sshport argument
>>>>>>> gusson-ssh_port
1.4.6b updated default cipherlist for syncoid to
chacha20-poly1305@openssh.com,arcfour - arcfour isn't supported on
newer SSH (in Ubuntu Xenial and FreeBSD), chacha20 isn't supported on

View File

@ -11,7 +11,11 @@ use warnings;
my $zfs = '/sbin/zfs';
my %args = getargs(@ARGV);
<<<<<<< HEAD
my $progversion = '1.4.6b';
=======
my $progversion = '1.4.6c';
>>>>>>> gusson-ssh_port
if ($args{'version'}) { print "$progversion\n"; exit 0; }

4
sanoid
View File

@ -4,7 +4,11 @@
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
<<<<<<< HEAD
my $version = '1.4.6b';
=======
my $version = '1.4.6c';
>>>>>>> gusson-ssh_port
use strict;
use Config::IniFiles; # read samba-style conf file

20
syncoid
View File

@ -4,7 +4,11 @@
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
<<<<<<< HEAD
my $version = '1.4.6b';
=======
my $version = '1.4.6c';
>>>>>>> gusson-ssh_port
use strict;
use Data::Dumper;
@ -26,6 +30,10 @@ my $zfscmd = '/sbin/zfs';
my $sshcmd = '/usr/bin/ssh';
my $pscmd = '/bin/ps';
my $sshcipher = '-c chacha20-poly1305@openssh.com,arcfour';
<<<<<<< HEAD
=======
my $sshport = '-p 22';
>>>>>>> gusson-ssh_port
my $pvcmd = '/usr/bin/pv';
my $mbuffercmd = '/usr/bin/mbuffer';
my $sudocmd = '/usr/bin/sudo';
@ -34,12 +42,15 @@ my $mbufferoptions = '-q -s 128k -m 16M 2>/dev/null';
# being present on remote machines.
my $lscmd = '/bin/ls';
if ( $args{'sshport'} ) {
$sshport = "-p $args{'sshport'}";
}
# figure out if source and/or target are remote.
if ( $args{'sshkey'} ) {
$sshcmd = "$sshcmd $sshcipher -i $args{'sshkey'}";
$sshcmd = "$sshcmd $sshcipher $sshport -i $args{'sshkey'}";
}
else {
$sshcmd = "$sshcmd $sshcipher";
$sshcmd = "$sshcmd $sshcipher $sshport";
}
my ($sourcehost,$sourcefs,$sourceisroot) = getssh($rawsourcefs);
my ($targethost,$targetfs,$targetisroot) = getssh($rawtargetfs);
@ -254,7 +265,7 @@ sub getargs {
my %novaluearg;
my %validarg;
push my @validargs, ('debug','nocommandchecks','version','monitor-version','compress','source-bwlimit','target-bwlimit','dumpsnaps','recursive','r','sshkey');
push my @validargs, ('debug','nocommandchecks','version','monitor-version','compress','source-bwlimit','target-bwlimit','dumpsnaps','recursive','r','sshkey','sshport');
foreach my $item (@validargs) { $validarg{$item} = 1; }
push my @novalueargs, ('debug','nocommandchecks','version','monitor-version','dumpsnaps','recursive','r');
foreach my $item (@novalueargs) { $novaluearg{$item} = 1; }
@ -716,6 +727,7 @@ sub getssh {
my $rhost;
my $isroot;
my $socket;
# if we got passed something with an @ in it, we assume it's an ssh connection, eg root@myotherbox
if ($fs =~ /\@/) {
$rhost = $fs;
@ -726,7 +738,7 @@ sub getssh {
if ($remoteuser eq 'root') { $isroot = 1; } else { $isroot = 0; }
# now we need to establish a persistent master SSH connection
$socket = "/tmp/syncoid-$remoteuser-$rhost-" . time();
open FH, "$sshcmd -M -S $socket -o ControlPersist=yes $rhost exit |";
open FH, "$sshcmd -M -S $socket -o ControlPersist=yes $sshport $rhost exit |";
close FH;
$rhost = "-S $socket $rhost";
} else {