OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 04-Mar-2005 12:05:48
Branch: HEAD Handle: 2005030411054800
Modified files:
openpkg-src/rsync rsync.patch
Log:
second attempt for the protocol workaround: distinguish between client
and server protocol versions and this way only refuse to play with too
old clients on the server side but still allow the client to connect
to ancient servers
Summary:
Revision Changes Path
1.16 +37 -15 openpkg-src/rsync/rsync.patch
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/rsync/rsync.patch
============================================================================
$ cvs diff -u -r1.15 -r1.16 rsync.patch
--- openpkg-src/rsync/rsync.patch 4 Mar 2005 10:09:34 -0000 1.15
+++ openpkg-src/rsync/rsync.patch 4 Mar 2005 11:05:48 -0000 1.16
@@ -87,32 +87,54 @@
if (partial_dir) {
Index: compat.c
--- compat.c.orig 2004-07-22 01:59:22 +0200
-+++ compat.c 2005-03-04 11:02:28 +0100
-@@ -60,8 +60,8 @@
++++ compat.c 2005-03-04 11:57:39 +0100
+@@ -53,19 +53,22 @@
+ rprintf(FINFO, "(%s) Protocol versions: remote=%d,
negotiated=%d\n",
+ am_server? "Server" : "Client", remote_protocol,
protocol_version);
+ }
+- if (remote_protocol < MIN_PROTOCOL_VERSION
+- || remote_protocol > MAX_PROTOCOL_VERSION) {
++ if ( ( am_server && (remote_protocol < MIN_CLIENT_PROTOCOL_VERSION ||
remote_protocol > MAX_CLIENT_PROTOCOL_VERSION))
++ || (!am_server && (remote_protocol < MIN_SERVER_PROTOCOL_VERSION ||
remote_protocol > MAX_SERVER_PROTOCOL_VERSION))) {
+ rprintf(FERROR,"protocol version mismatch - is your shell
clean?\n");
+ rprintf(FERROR,"(see the rsync man page for an explanation)\n");
exit_cleanup(RERR_PROTOCOL);
}
- if (remote_protocol < OLD_PROTOCOL_VERSION) {
+- if (remote_protocol < OLD_PROTOCOL_VERSION) {
- rprintf(FINFO,"%s is very old version of rsync, upgrade
recommended.\n",
- am_server? "Client" : "Server");
+- }
+- if (protocol_version < MIN_PROTOCOL_VERSION) {
++ if ( ( am_server && remote_protocol < OLD_CLIENT_PROTOCOL_VERSION)
++ || (!am_server && remote_protocol < OLD_SERVER_PROTOCOL_VERSION)) {
+ rprintf(FINFO,"%s is very old version (protocol %d) of rsync,
upgrade recommended.\n",
+ am_server? "Client" : "Server", remote_protocol);
- }
- if (protocol_version < MIN_PROTOCOL_VERSION) {
++ }
++ if ( ( am_server && protocol_version < MIN_SERVER_PROTOCOL_VERSION)
++ || (!am_server && protocol_version < MIN_CLIENT_PROTOCOL_VERSION)
++ ) {
rprintf(FERROR, "--protocol must be at least %d on the %s.\n",
+- MIN_PROTOCOL_VERSION, am_server? "Server" : "Client");
++ am_server ? MIN_SERVER_PROTOCOL_VERSION :
MIN_CLIENT_PROTOCOL_VERSION, am_server? "Server" : "Client");
+ exit_cleanup(RERR_PROTOCOL);
+ }
+ if (protocol_version > PROTOCOL_VERSION) {
Index: rsync.h
--- rsync.h.orig 2004-09-22 06:10:10 +0200
-+++ rsync.h 2005-03-04 11:00:58 +0100
-@@ -81,8 +81,13 @@
++++ rsync.h 2005-03-04 12:01:01 +0100
+@@ -81,9 +81,12 @@
* unlikely to begin by sending a byte between MIN_PROTOCL_VERSION and
* MAX_PROTOCOL_VERSION. */
-+#ifdef RSYNC_ANTIQUED_PROTOCOLS
- #define MIN_PROTOCOL_VERSION 20
- #define OLD_PROTOCOL_VERSION 25
-+#else
-+#define MIN_PROTOCOL_VERSION 25
-+#define OLD_PROTOCOL_VERSION 27
-+#endif
- #define MAX_PROTOCOL_VERSION 40
+-#define MIN_PROTOCOL_VERSION 20
+-#define OLD_PROTOCOL_VERSION 25
+-#define MAX_PROTOCOL_VERSION 40
++#define MIN_SERVER_PROTOCOL_VERSION 20
++#define OLD_SERVER_PROTOCOL_VERSION 25
++#define MAX_SERVER_PROTOCOL_VERSION 40
++#define MIN_CLIENT_PROTOCOL_VERSION 25
++#define OLD_CLIENT_PROTOCOL_VERSION 27
++#define MAX_CLIENT_PROTOCOL_VERSION 40
#define RSYNC_PORT 873
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]