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 1.4.6b updated default cipherlist for syncoid to
chacha20-poly1305@openssh.com,arcfour - arcfour isn't supported on chacha20-poly1305@openssh.com,arcfour - arcfour isn't supported on
newer SSH (in Ubuntu Xenial and FreeBSD), chacha20 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 $zfs = '/sbin/zfs';
my %args = getargs(@ARGV); my %args = getargs(@ARGV);
<<<<<<< HEAD
my $progversion = '1.4.6b'; my $progversion = '1.4.6b';
=======
my $progversion = '1.4.6c';
>>>>>>> gusson-ssh_port
if ($args{'version'}) { print "$progversion\n"; exit 0; } 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 # 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. # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
<<<<<<< HEAD
my $version = '1.4.6b'; my $version = '1.4.6b';
=======
my $version = '1.4.6c';
>>>>>>> gusson-ssh_port
use strict; use strict;
use Config::IniFiles; # read samba-style conf file 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 # 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. # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
<<<<<<< HEAD
my $version = '1.4.6b'; my $version = '1.4.6b';
=======
my $version = '1.4.6c';
>>>>>>> gusson-ssh_port
use strict; use strict;
use Data::Dumper; use Data::Dumper;
@ -26,6 +30,10 @@ my $zfscmd = '/sbin/zfs';
my $sshcmd = '/usr/bin/ssh'; my $sshcmd = '/usr/bin/ssh';
my $pscmd = '/bin/ps'; my $pscmd = '/bin/ps';
my $sshcipher = '-c chacha20-poly1305@openssh.com,arcfour'; my $sshcipher = '-c chacha20-poly1305@openssh.com,arcfour';
<<<<<<< HEAD
=======
my $sshport = '-p 22';
>>>>>>> gusson-ssh_port
my $pvcmd = '/usr/bin/pv'; my $pvcmd = '/usr/bin/pv';
my $mbuffercmd = '/usr/bin/mbuffer'; my $mbuffercmd = '/usr/bin/mbuffer';
my $sudocmd = '/usr/bin/sudo'; my $sudocmd = '/usr/bin/sudo';
@ -34,12 +42,15 @@ my $mbufferoptions = '-q -s 128k -m 16M 2>/dev/null';
# being present on remote machines. # being present on remote machines.
my $lscmd = '/bin/ls'; my $lscmd = '/bin/ls';
if ( $args{'sshport'} ) {
$sshport = "-p $args{'sshport'}";
}
# figure out if source and/or target are remote. # figure out if source and/or target are remote.
if ( $args{'sshkey'} ) { if ( $args{'sshkey'} ) {
$sshcmd = "$sshcmd $sshcipher -i $args{'sshkey'}"; $sshcmd = "$sshcmd $sshcipher $sshport -i $args{'sshkey'}";
} }
else { else {
$sshcmd = "$sshcmd $sshcipher"; $sshcmd = "$sshcmd $sshcipher $sshport";
} }
my ($sourcehost,$sourcefs,$sourceisroot) = getssh($rawsourcefs); my ($sourcehost,$sourcefs,$sourceisroot) = getssh($rawsourcefs);
my ($targethost,$targetfs,$targetisroot) = getssh($rawtargetfs); my ($targethost,$targetfs,$targetisroot) = getssh($rawtargetfs);
@ -254,7 +265,7 @@ sub getargs {
my %novaluearg; my %novaluearg;
my %validarg; 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; } foreach my $item (@validargs) { $validarg{$item} = 1; }
push my @novalueargs, ('debug','nocommandchecks','version','monitor-version','dumpsnaps','recursive','r'); push my @novalueargs, ('debug','nocommandchecks','version','monitor-version','dumpsnaps','recursive','r');
foreach my $item (@novalueargs) { $novaluearg{$item} = 1; } foreach my $item (@novalueargs) { $novaluearg{$item} = 1; }
@ -716,6 +727,7 @@ sub getssh {
my $rhost; my $rhost;
my $isroot; my $isroot;
my $socket; my $socket;
# if we got passed something with an @ in it, we assume it's an ssh connection, eg root@myotherbox # if we got passed something with an @ in it, we assume it's an ssh connection, eg root@myotherbox
if ($fs =~ /\@/) { if ($fs =~ /\@/) {
$rhost = $fs; $rhost = $fs;
@ -726,7 +738,7 @@ sub getssh {
if ($remoteuser eq 'root') { $isroot = 1; } else { $isroot = 0; } if ($remoteuser eq 'root') { $isroot = 1; } else { $isroot = 0; }
# now we need to establish a persistent master SSH connection # now we need to establish a persistent master SSH connection
$socket = "/tmp/syncoid-$remoteuser-$rhost-" . time(); $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; close FH;
$rhost = "-S $socket $rhost"; $rhost = "-S $socket $rhost";
} else { } else {