[Unison-hackers] rsync bug when using a ssh tunnel?

Alan Schmitt alan.schmitt at polytechnique.org
Wed Apr 21 12:25:49 EDT 2010


Hello,

I think I found a small bug when using an ssh tunnel with unison. To
access a machine behind a firewall, I first create a tunnel so that
when I ssh to localhost on port 2222 I get there. I have the following
on my profile for the second root:
root = ssh://localhost:2222

However, it seems that the port specification is not set when calling rsync:

rsync --partial --inplace --compress
'localhost:'\''/Users/schmitta/Documents/Inbox/SpamSieve-2.8.1.dmg'\'''
'/Users/schmitta/Documents/Inbox/.unison.SpamSieve-2.8.1.dmg.78575513a98a95631a88c5cb057209d3.unison.tmp'

In this case we need to add the argument
--rsh "ssh -p 2222"
to the rsync call (I could not find a way to specify the port directly
when using ssh, according to rsync man page, one can only specify the
port when using a rsync server on the other side).

The changes needed seem to be around line 778 or 799 of copy.ml (when
we decide the program to use in transferFileUsingExternalCopyprog).
But there are two things I don't know:
- how to get the port number we need to use;
- how to deal with the fact that the user may use his very own
copyprog program that does not care about all this.

For the moment I'll just add a preference to my profile (changing the
default copyprog and copyprogrest with this), but we should be aware
that we don't deal nicely with non standard ports in this case.

Alan


More information about the Unison-hackers mailing list