rsync 3.1.0/3.1.1 incompatible with 2.5.7

Wayne Davison wayned at
Fri Jul 25 17:49:17 MDT 2014

On Fri, Jul 25, 2014 at 11:50 AM, Ole Tange <tange at> wrote:

> I am quite surprised that rsync-3.1.x does not simply negotiate
> the protocol and downgrade to protocol 30 automatically when 31 fails.

Sadly, it can't do any of that because it is the 2.5.7 version that is
killing the connection due to the advent of protocol 31 -- 2.5.7 has some
code in it to die if what it thinks is a protocol number isn't in a
particular range of values that maxes out at protocol 30.

And I find the error message could be more helpful in finding
> the workaround.

Again, it's the old 2.5.7 assuming that the bytes it is encountering are
crap instead of valid data, which usually means that some ascii text got
into the transmission stream.  A sad effect of having no decent starting
byte sequence to the protocol, and no way to change it without becoming
incompatible with all prior versions of the software.

My question is now: What should I do as a developer?

There aren't any particularly easy answers for dealing with an old bit of
software that is refusing to play nice with newer software.  One
possibility is for your wrapping code to do a configure pass that checks
the rsync version on both of the hosts and figures out if one is too old
(2.6.0 and newer are fine, so only 2.5.7 and older have this issue) and one
is too new (3.1.0 is the first to start using protocol 31). If that occurs,
you can specify the --protocol=30 option on the newer rsync to avoid the

Depending on the client's willingness to tweak their rsync, the fix for
such an old 2.5.7 would really be as simple as changing one number in the
executable from comparing against 30 to comparing against 40.  If someone
were to take the code for 2.5.7 and tweak that one use of the
(it only gets used in compat.c) then the 2.5.7 version would work fine.
 That would essentially be a 1-byte patch to the executable, but obviously
you can't expect everyone to be willing to apply such a change, even if you
were able to figure out exactly what byte to twiddle.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list