Passwordless SSH messes with escaped spaces

Matt McCutchen hashproduct+rsync at
Thu Aug 24 17:23:10 GMT 2006

So really, your goal is to somehow get back from $SSH_ORIGINAL_COMMAND
the original arguments, check that the first three are what they
should be, and then execute the command line without further
expansion.  Since $SSH_ORIGINAL_COMMAND doesn't give you any way to
tell spaces between arguments from spaces inside arguments, one can't
do much better than your approach.

For the final exec, you could just use exec "${arr[@]}" .  Since bash
does not re-expand the contents of variables when they are used,
backquotes and other shell constructs in ${arr[@]} will not take
effect, i.e., you're safe.


More information about the rsync mailing list