From c05e3dbf69d676870ea50ca77116e34b5daad07b Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 3 Jun 2020 22:26:30 +0200 Subject: [PATCH] lib-auth-client: auth-master - Restructure auth_user_list_reply_callback() --- src/lib-auth-client/auth-master.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib-auth-client/auth-master.c b/src/lib-auth-client/auth-master.c index 35c1c9820e..de9df26e46 100644 --- a/src/lib-auth-client/auth-master.c +++ b/src/lib-auth-client/auth-master.c @@ -773,16 +773,19 @@ auth_user_list_reply_callback(const char *cmd, const char *const *args, ctx->failed = TRUE; } ctx->finished = TRUE; - } else if (strcmp(cmd, "LIST") == 0 && args[0] != NULL) { - /* we'll just read all the users into memory. otherwise we'd - have to use a separate connection for listing and there's - a higher chance of a failure since the connection could be - open to dovecot-auth for a long time. */ - str_append(ctx->username, args[0]); - } else { + return FALSE; + } + if (strcmp(cmd, "LIST") != 0 || args[0] == NULL) { e_error(conn->event, "User listing returned invalid input"); ctx->failed = TRUE; + return FALSE; } + + /* We'll just read all the users into memory. otherwise we'd have to use + a separate connection for listing and there's a higher chance of a + failure since the connection could be open to dovecot-auth for a long + time. */ + str_append(ctx->username, args[0]); return FALSE; } -- 2.47.3