]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-server: Don't return two error lines if a command fails
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 14 Jun 2021 20:28:48 +0000 (23:28 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 1 Jul 2021 09:14:55 +0000 (09:14 +0000)
This normally didn't affect doveadm client usage, but it did break reply
matching when multiple usernames were handled by a single command (e.g.
wildcard users).

src/doveadm/client-connection-tcp.c

index 4ec3dc7a3c06d0972d985afa326a0547aa675888..204dcd987fb2e84966c4c024f2b5bbc4f1a660cb 100644 (file)
@@ -360,7 +360,10 @@ static int doveadm_cmd_handle(struct client_connection_tcp *conn,
        /* clear all headers */
        doveadm_print_deinit();
        doveadm_print_init(DOVEADM_PRINT_TYPE_SERVER);
-       return doveadm_exit_code == 0 ? 0 : -1;
+
+       /* We already sent the success/failure reply to the client. Return 0
+          so caller never adds another failure reply. */
+       return 0;
 }
 
 static bool client_handle_command(struct client_connection_tcp *conn,