]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'refs/heads/t/sideband-cleanup'
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 4 Dec 2016 10:10:36 +0000 (11:10 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 4 Dec 2016 10:10:36 +0000 (11:10 +0100)
started on 2016-07-03, cooking since 2016-07-16

para_server announces sideband as an optional feature, which is
pointless since sideband connections have become mandatory in
paraslash-0.5.x, so they are always used. This patch set removes
the feature negitiation during the initial handshake. The sideband
protocol remains and is not affected.

Overwiew of the handshake in v0.5.x:
(SA) server announces sideband
(CC) client fails connection if server did not announce sideband
(CR) client requests sideband
(SC) server fails connection if sideband was not requested
already broken
- client-0.4/server-0.5 (!CR, SC)
- client-0.5/server-0.4 (!SA, CC)

Conversion plan:
rm (CC): breaks nothing
rm (SC): breaks nothing
rm (CR): breaks cl-0.6/server-0.5 (!CR, SC)
rm (SA): breaks cl-0.5/server-0.6 (!SA, CC)
server fails connection if client requests sideband

In this series only the first two conversion steps are done as they
can be merged early without breaking anything.

* refs/heads/t/sideband-cleanup:
  server: Do not fail if client does not request sideband.
  client: No longer fail connection if sideband was not announced.

client_common.c
command.c
error.h

index cd1ccc619ce06710d9fad42652d6868942fc17d8..eea7510fd0589e86fb4058dd7f4361f3c79901aa 100644 (file)
@@ -292,11 +292,6 @@ static int client_post_select(struct sched *s, void *context)
                if (ret < 0 || n == 0)
                        goto out;
                ct->features = parse_features(buf);
-               if (!has_feature("sideband", ct)) {
-                       PARA_ERROR_LOG("server has no sideband support\n");
-                       ret = -E_INCOMPAT_FEAT;
-                       goto out;
-               }
                ct->status = CL_RECEIVED_WELCOME;
                return 0;
        case CL_RECEIVED_WELCOME: /* send auth command */
index 93de2d2d99d9f75cb041211e8c4f45dfef28c6a1..0eb4efc22fa564fd2c055aa0753392696ad49a2f 100644 (file)
--- a/command.c
+++ b/command.c
@@ -807,7 +807,6 @@ static void reset_signals(void)
 }
 
 struct connection_features {
-       bool sideband_requested;
        bool aes_ctr128_requested;
 };
 
@@ -835,8 +834,8 @@ static int parse_auth_request(char *buf, int len, struct user **u,
                create_argv(p, ",", &features);
                for (i = 0; features[i]; i++) {
                        if (strcmp(features[i], "sideband") == 0)
-                               cf->sideband_requested = true;
-                       else if (strcmp(features[i], "aes_ctr128") == 0)
+                               continue;
+                       if (strcmp(features[i], "aes_ctr128") == 0)
                                cf->aes_ctr128_requested = true;
                        else {
                                ret = -E_BAD_FEATURE;
@@ -949,11 +948,6 @@ __noreturn void handle_connect(int fd, const char *peername)
        ret = parse_auth_request(buf, ret, &cc->u, &cf);
        if (ret < 0)
                goto net_err;
-       if (!cf.sideband_requested) { /* sideband is mandatory */
-               PARA_ERROR_LOG("client did not request sideband\n");
-               ret = -E_BAD_FEATURE;
-               goto net_err;
-       }
        if (cc->u) {
                get_random_bytes_or_die(rand_buf, sizeof(rand_buf));
                ret = pub_encrypt(cc->u->pubkey, rand_buf, sizeof(rand_buf),
diff --git a/error.h b/error.h
index 337160c9a6c3d19c33c9192ae95ba7262eba8db6..3fda5787774ce739754a58d74706c3081f1e9da5 100644 (file)
--- a/error.h
+++ b/error.h
@@ -306,7 +306,6 @@ extern const char **para_errlist[];
        PARA_ERROR(SERVER_EOF, "connection closed by para_server"), \
        PARA_ERROR(SERVER_CMD_SUCCESS, "command terminated successfully"), \
        PARA_ERROR(SERVER_CMD_FAILURE, "command failed"), \
-       PARA_ERROR(INCOMPAT_FEAT, "client/server incompatibility"), \
 
 
 #define NET_ERRORS \