X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/16edf86595a5a990a942fa045dfb523dae1fe6cb..4471d9e5709fc2a9992ef89f916dcb8bb8093d50:/compat.c diff --git a/compat.c b/compat.c index 3f4bd45c..4b57ec48 100644 --- a/compat.c +++ b/compat.c @@ -75,6 +75,19 @@ void setup_protocol(int f_out,int f_in) remote_protocol = read_int(f_in); if (protocol_version > remote_protocol) protocol_version = remote_protocol; + /* CVS support: fallback to finalized protocol if incompatible */ + if (protocol_version >= 30) { + int theirsub, oursub = PROTOCOL_SUBVERSION; + if (!read_batch) + write_varint(f_out, oursub); + theirsub = read_varint(f_in); + if (remote_protocol > PROTOCOL_VERSION) + theirsub = 0; /* 0 == final version */ + if (protocol_version < PROTOCOL_VERSION) + oursub = 0; + if (theirsub != oursub) + protocol_version--; + } } if (read_batch && remote_protocol > protocol_version) { rprintf(FERROR, "The protocol version in the batch file is too new (%d > %d).\n", @@ -115,14 +128,14 @@ void setup_protocol(int f_out,int f_in) protocol_version); exit_cleanup(RERR_PROTOCOL); } - if (preserve_acls) { + if (preserve_acls && !local_server) { rprintf(FERROR, "--acls requires protocol 30 or higher" " (negotiated %d).\n", protocol_version); exit_cleanup(RERR_PROTOCOL); } - if (preserve_xattrs) { + if (preserve_xattrs && !local_server) { rprintf(FERROR, "--xattrs requires protocol 30 or higher" " (negotiated %d).\n",