summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-07-14 09:44:13 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-07-14 09:44:13 -0300
commit87453d0e47b4b9975eb178a5196123f6372ab708 (patch)
tree460a8466c52439fa64f0d3b6923d90904d02fa60 /files
parent7564a4e9927f991072125263a821aba572b627d2 (diff)
downloadpuppet-rsync-87453d0e47b4b9975eb178a5196123f6372ab708.tar.gz
puppet-rsync-87453d0e47b4b9975eb178a5196123f6372ab708.tar.bz2
Updates rrsync from Debian Wheezy
Diffstat (limited to 'files')
-rw-r--r--[-rwxr-xr-x]files/rrsync/rrsync47
1 files changed, 21 insertions, 26 deletions
diff --git a/files/rrsync/rrsync b/files/rrsync/rrsync
index 7c7c659..5b2dbdf 100755..100644
--- a/files/rrsync/rrsync
+++ b/files/rrsync/rrsync
@@ -16,10 +16,10 @@ use constant LOGFILE => 'rrsync.log';
my $Usage = <<EOM;
Use 'command="$0 [-ro] SUBDIR"'
- in front of lines in $ENV{HOME}/.ssh/authorized_keys
+ in front of lines in $ENV{HOME}/.ssh/authorized_keys
EOM
-our $ro = (@ARGV && $ARGV[0] eq '-ro') ? shift : ''; # -ro = Read-Only
+our $ro = (@ARGV && $ARGV[0] eq '-ro') ? shift : ''; # -ro = Read-Only
our $subdir = shift;
die "$0: No subdirectory specified\n$Usage" unless defined $subdir;
$subdir = abs_path($subdir);
@@ -31,13 +31,13 @@ die "$0: Restricted directory does not exist!\n" if $subdir ne '/' && !-d $subdi
# command="rrsync logs/client" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAzGhEeNlPr...
# command="rrsync -ro results" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAmkHG1WCjC...
#
-# Format of the envrionment variables set by sshd:
+# Format of the environment variables set by sshd:
# SSH_ORIGINAL_COMMAND=rsync --server -vlogDtpr --partial . ARG # push
# SSH_ORIGINAL_COMMAND=rsync --server --sender -vlogDtpr --partial . ARGS # pull
# SSH_CONNECTION=client_addr client_port server_port
my $command = $ENV{SSH_ORIGINAL_COMMAND};
-die "$0: Not invoked via sshd\n$Usage" unless defined $command;
+die "$0: Not invoked via sshd\n$Usage" unless defined $command;
die "$0: SSH_ORIGINAL_COMMAND='$command' is not rsync\n" unless $command =~ s/^rsync\s+//;
die "$0: --server option is not first\n" unless $command =~ /^--server\s/;
our $am_sender = $command =~ /^--server\s+--sender\s/; # Restrictive on purpose!
@@ -74,18 +74,15 @@ our %long_opt = (
'delete-delay' => 0,
'delete-during' => 0,
'delete-excluded' => 0,
- 'delete-missing-args' => 0,
'existing' => 0,
'fake-super' => 0,
'files-from' => 3,
'force' => 0,
'from0' => 0,
'fuzzy' => 0,
- 'groupmap' => 1,
'iconv' => 1,
'ignore-errors' => 0,
'ignore-existing' => 0,
- 'ignore-missing-args' => 0,
'inplace' => 0,
'link-dest' => 2,
'list-only' => 0,
@@ -117,7 +114,6 @@ our %long_opt = (
'temp-dir' => 2,
'timeout' => 1,
'use-qsort' => 0,
- 'usermap' => 1,
);
### END of options data produced by the cull_options script. ###
@@ -153,24 +149,24 @@ while ($command =~ /((?:[^\s\\]+|\\.[^\s\\]*)+)/g) {
my($opt,$arg) = /^--([^=]+)(?:=(.*))?$/;
my $disabled;
if (defined $opt) {
- my $ct = $long_opt{$opt};
- last unless defined $ct;
- next if $ct == 0;
- if ($ct > 0) {
- if (!defined $arg) {
- $check_type = $ct;
- $last_opt = $opt;
- next;
- }
- $arg = check_arg($opt, $arg, $ct);
- $opts[-1] =~ s/=.*/=$arg/;
- next;
- }
- $disabled = 1;
- $opt = "--$opt";
+ my $ct = $long_opt{$opt};
+ last unless defined $ct;
+ next if $ct == 0;
+ if ($ct > 0) {
+ if (!defined $arg) {
+ $check_type = $ct;
+ $last_opt = $opt;
+ next;
+ }
+ $arg = check_arg($opt, $arg, $ct);
+ $opts[-1] =~ s/=.*/=$arg/;
+ next;
+ }
+ $disabled = 1;
+ $opt = "--$opt";
} elsif ($short_disabled ne '') {
- $disabled = /^-$short_no_arg*([$short_disabled])/o;
- $opt = "-$1";
+ $disabled = /^-$short_no_arg*([$short_disabled])/o;
+ $opt = "-$1";
}
last unless $disabled; # Generate generic failure
@@ -216,4 +212,3 @@ sub check_arg
}
$arg;
}
-