From 9ea5d36197d9193a7a9d49c99cbb12148e56e404 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 14 Jun 2021 23:28:48 +0300 Subject: [PATCH] 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). --- src/doveadm/client-connection-tcp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- 2.47.3