Reimplementation of PR#140, all kudos go to @lopsided98
As I couldn't exactly see what the merge errors were Github was complaining about. I decided to re-implement the changes. NOTE: I am still testing them!
This commit is contained in:
parent
eeedf38d57
commit
03707f68e9
|
@ -202,6 +202,10 @@ As of 1.4.18, syncoid also automatically supports and enables resume of interrup
|
||||||
|
|
||||||
This prints a list of snapshots during the run.
|
This prints a list of snapshots during the run.
|
||||||
|
|
||||||
|
+ --no-privilege-elevation
|
||||||
|
|
||||||
|
Bypass the root check and assume syncoid has the necessary permissions (for use with ZFS permission delegation).
|
||||||
|
|
||||||
+ --sshport
|
+ --sshport
|
||||||
|
|
||||||
Allow sync to/from boxes running SSH on non-standard ports.
|
Allow sync to/from boxes running SSH on non-standard ports.
|
||||||
|
|
5
syncoid
5
syncoid
|
@ -19,7 +19,7 @@ use Sys::Hostname;
|
||||||
my %args = ('sshkey' => '', 'sshport' => '', 'sshcipher' => '', 'sshoption' => [], 'target-bwlimit' => '', 'source-bwlimit' => '');
|
my %args = ('sshkey' => '', 'sshport' => '', 'sshcipher' => '', 'sshoption' => [], 'target-bwlimit' => '', 'source-bwlimit' => '');
|
||||||
GetOptions(\%args, "no-command-checks", "monitor-version", "compress=s", "dumpsnaps", "recursive|r",
|
GetOptions(\%args, "no-command-checks", "monitor-version", "compress=s", "dumpsnaps", "recursive|r",
|
||||||
"source-bwlimit=s", "target-bwlimit=s", "sshkey=s", "sshport=i", "sshcipher|c=s", "sshoption|o=s@",
|
"source-bwlimit=s", "target-bwlimit=s", "sshkey=s", "sshport=i", "sshcipher|c=s", "sshoption|o=s@",
|
||||||
"debug", "quiet", "no-stream", "no-sync-snap", "no-resume", "exclude=s@", "skip-parent", "identifier=s") or pod2usage(2);
|
"debug", "quiet", "no-privilege-elevation", "no-stream", "no-sync-snap", "no-resume", "exclude=s@", "skip-parent", "identifier=s") or pod2usage(2);
|
||||||
|
|
||||||
my %compressargs = %{compressargset($args{'compress'} || 'default')}; # Can't be done with GetOptions arg, as default still needs to be set
|
my %compressargs = %{compressargset($args{'compress'} || 'default')}; # Can't be done with GetOptions arg, as default still needs to be set
|
||||||
|
|
||||||
|
@ -1031,7 +1031,7 @@ sub getssh {
|
||||||
$rhost =~ s/:\Q$fs\E$//;
|
$rhost =~ s/:\Q$fs\E$//;
|
||||||
my $remoteuser = $rhost;
|
my $remoteuser = $rhost;
|
||||||
$remoteuser =~ s/\@.*$//;
|
$remoteuser =~ s/\@.*$//;
|
||||||
if ($remoteuser eq 'root') { $isroot = 1; } else { $isroot = 0; }
|
if ($remoteuser eq 'root' || $args{'no-privilege-elevation'}) { $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=1m $args{'sshport'} $rhost exit |";
|
open FH, "$sshcmd -M -S $socket -o ControlPersist=1m $args{'sshport'} $rhost exit |";
|
||||||
|
@ -1249,4 +1249,5 @@ Options:
|
||||||
--quiet Suppresses non-error output
|
--quiet Suppresses non-error output
|
||||||
--dumpsnaps Dumps a list of snapshots during the run
|
--dumpsnaps Dumps a list of snapshots during the run
|
||||||
--no-command-checks Do not check command existence before attempting transfer. Not recommended
|
--no-command-checks Do not check command existence before attempting transfer. Not recommended
|
||||||
|
--no-privilege-elevation Bypass the root check, for use with ZFS permission delegation
|
||||||
--no-resume Don't use the ZFS resume feature if available
|
--no-resume Don't use the ZFS resume feature if available
|
||||||
|
|
Loading…
Reference in New Issue