From: Stephan Bosch Date: Wed, 3 Jun 2020 20:26:30 +0000 (+0200) Subject: lib-auth-client: auth-master - Restructure auth_user_list_reply_callback() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c05e3dbf69d676870ea50ca77116e34b5daad07b;p=thirdparty%2Fdovecot%2Fcore.git lib-auth-client: auth-master - Restructure auth_user_list_reply_callback() --- 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; }