From: Timo Sirainen Date: Mon, 14 Jun 2021 20:28:48 +0000 (+0300) Subject: doveadm-server: Don't return two error lines if a command fails X-Git-Tag: 2.3.17~397 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ea5d36197d9193a7a9d49c99cbb12148e56e404;p=thirdparty%2Fdovecot%2Fcore.git doveadm-server: Don't return two error lines if a command fails 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). --- diff --git a/src/doveadm/client-connection-tcp.c b/src/doveadm/client-connection-tcp.c index 4ec3dc7a3c..204dcd987f 100644 --- a/src/doveadm/client-connection-tcp.c +++ b/src/doveadm/client-connection-tcp.c @@ -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,