rsync 2.6.2 doesn't work with GNU inetutils rsh

Tim Conway conway at us.ibm.com
Fri Jun 4 16:35:24 GMT 2004


A few weeks ago, I corrected a guys commandline, wherein a flag came after 
a directory specification, and was informed that new libraries rearrange 
ARGV.  I was somewhat abashed, not having known that, but also thought 
that was a really stupid idea.  Now we have to do kludgy workarounds in 
order to accomodate users who are too stupid to understand a simple 
syntax.

You will have to write an rsh wrapper.
This will probably do:

#!/bin/sh

#rsh4rsync - wrapper to insert "--"
host=$1
shift
if [ "$1" = "-l" ]
  then
    rshargs="$1 $2"
    shift;shift
  fi
exec rsh $host $rshargs -- $@

I don't think rsync ever adds more than a -l user (taken from 
user at host:path) to the transport commandline.
No guarantees.  I wrote that in here, and haven't tested it.
Now, if sh's argument parser starts fscking with your commandline, you're 
hosed.

Tim Conway
Unix System Administration
Contractor - IBM Global Services
desk:3032734776
conway at us.ibm.com


This is the cygwin build of rsync, with the standard cygwin
rsh (which is a fairly old GNU inetutils 1.3.2).


~=> rsync --rsh=rsh -vv bibble:
opening connection using rsh bibble rsync --server --sender -vvr . 
rsh: unknown option -- server

As it helpfully explains, rsh is grabbing all the arguments intended for
the remote rsync command.

With GNU rsh,  it seems necessary to add a '--' to provide a limit:

rsh bibble ls -l     :   error from rsh
rsh bubble -- ls -l  :   works fine




More information about the rsync mailing list