Bug 3298 - --rsh option incorrectly interprets quotes
--rsh option incorrectly interprets quotes
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
2.6.6
x86 Linux
: P3 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-02 11:33 UTC by Devin Bayer
Modified: 2006-03-12 02:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Bayer 2005-12-02 11:33:27 UTC
Using rsync -e 'ssh -i "/some directory with spaces/identity"' causes rsync to try to execute ssh like:

execve("/usr/bin/ssh", ["ssh", "-i", "\"/some directory with spaces/identity\"", ...])

Which of course fails, because the quotes were to delimit the argument, not part of the filename.  This makes it more difficult to use options with spaces and is inconsistant with the --rsync-path option, which uses sh to interpret the command.
Comment 1 Wayne Davison 2005-12-14 15:04:24 UTC
I added single- and double-quote parsing to rsync's handling of the remote-shell command.  Rsync doesn't use the shell to parse this string (since that could cause problems for the option-forwarding code).  I decided to not include backslash parsing in order to (1) keep it simple and (2) avoid causing problems for cygwin users.  I also decided to keep the quirk that tabs are not considered arg-breaking characters.  This should give us very good backward-compatibility.