From: Wayne Davison Date: Fri, 17 Jun 2005 16:48:02 +0000 (+0000) Subject: - Improved some comments (some taken from the new cull-options output). X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/85fbfa10a858cdc7e444f1868d808ee845376fde - Improved some comments (some taken from the new cull-options output). - Made the user-config sections easier to find. - Default to running a fully-specified rsync executable so that there are not PATH surprises. - A few minor tweaks to the arg-checking code to make it clearer without actually changing its logic. --- diff --git a/support/rrsync b/support/rrsync index 41fd267d..41398eaa 100644 --- a/support/rrsync +++ b/support/rrsync @@ -8,8 +8,12 @@ use strict; use Socket; use Cwd 'abs_path'; use File::Glob ':glob'; -use constant RSYNC => 'rsync'; # Optionally set the path of rsync here. + +# You may configure these values to your liking. See also the section +# of options if you want to disable any options that rsync accepts. +use constant RSYNC => '/usr/bin/rsync'; use constant LOGFILE => 'rrsync.log'; + my $Usage = < -1, 'daemon' => -1, @@ -100,6 +108,8 @@ if ($short_disabled ne '') { $short_no_arg =~ s/[$short_disabled]//go; $short_with_num =~ s/[$short_disabled]//go; } +$short_no_arg = "[$short_no_arg]" if length($short_no_arg) > 1; +$short_with_num = "[$short_with_num]" if length($short_with_num) > 1; my $write_log = -f LOGFILE && open(LOG, '>>', LOGFILE); @@ -111,16 +121,14 @@ my $last_opt = ''; my $check_type; foreach (split(/(? 0 && ($type < 2 || !$am_sender)) { + $arg =~ s/\\(.)/$1/g; + if ($subdir ne '/' && ($type == 1 || ($type == 2 && !$am_sender))) { $arg =~ s#//#/#g; die "Do not use .. in --$opt; anchor the path at the root of your restricted dir.\n" if $arg =~ m#(^|/)\.\.(/|$)#;