Require a newer protocol to specify the digest list.
authorWayne Davison <wayne@opencoder.net>
Sun, 11 Sep 2022 04:52:54 +0000 (21:52 -0700)
committerWayne Davison <wayne@opencoder.net>
Sun, 11 Sep 2022 05:12:24 +0000 (22:12 -0700)
clientserver.c

index 7436d01e563859ad17ad059a0f05a1ca27bee51b..9ad7eaf7b92f5efb55f7a8b5cc2f3e7f159f4bc2 100644 (file)
@@ -184,11 +184,11 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
        }
 
        if (remote_sub < 0) {
-               if (remote_protocol == 30) {
+               if (remote_protocol >= 30) {
                        if (am_client)
-                               rprintf(FERROR, "rsync: server is speaking an incompatible beta of protocol 30\n");
+                               rprintf(FERROR, "rsync: the server omitted the subprotocol value: %s\n", buf);
                        else
-                               io_printf(f_out, "@ERROR: your client is speaking an incompatible beta of protocol 30\n");
+                               io_printf(f_out, "@ERROR: your client omitted the subprotocol value: %s\n", buf);
                        return -1;
                }
                remote_sub = 0;
@@ -200,6 +200,12 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
                daemon_auth_choices = strdup(daemon_auth_choices + 1);
                if ((cp = strchr(daemon_auth_choices, '\n')) != NULL)
                        *cp = '\0';
+       } else if (remote_protocol > 31) {
+               if (am_client)
+                       rprintf(FERROR, "rsync: the server omitted the digest name list: %s\n", buf);
+               else
+                       io_printf(f_out, "@ERROR: your client omitted the digest name list: %s\n", buf);
+               return -1;
        }
 
        if (protocol_version > remote_protocol) {