What's happening is that rsnapshot splits those arguments into an array
in the rsync_backup_point() subroutine:
# split up rsync long args into an array
< at > rsync_long_args_stack = ( split(/\s+/, $rsync_long_args) );
The < at > rsync_long_args_stack, along with the full rsync command to run, is
passed to the system() call in Perl. When system() gets an array, it
basically doesn't do any sort of interpolation the way a shell does.
Thus, your quotes are being taken literally, and not being used to group
command arguments together. Additionally, since the rsync_long_args are
getting split on whitespace, "--rsync-path='sudo" and "/usr/bin/rsync'"
are passed as seperate array elements.
Ideally I'd like this to work the way you would expect it to work in the
shell. Unfortunately I don't believe simply changing the call to
system() from an array into one string will fix it. In fact, we tried
this before (pre-mailing list) and it had unintended consequences. I
forget exactly what, but it was probably files with spaces in their
names or some other such thing.
Part of the reason I like passing an array to system() is because it
(AFAIK) prevents someone from creating a directory called "; rm -rf ."
and getting the shell to act on it. I haven't tried to work up a proof
of concept to exploit such a flaw, but I think you get the idea.
However, this still doesn't help you now does it
certainly should be improved, and if anyone has any suggestions I'd be
more than happy to hear them.
-Nathan
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
