]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: client-common-auth - Move SASL response pre-checks to client_auth_respo...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 7 Oct 2023 22:54:09 +0000 (00:54 +0200)
committerstephan.bosch <stephan.bosch@open-xchange.com>
Mon, 23 Oct 2023 15:50:54 +0000 (15:50 +0000)
This fixes Submission and ManageSieve not calling
sasl_server_auth_delayed_final().

src/login-common/client-common-auth.c
src/submission-login/client-authenticate.c

index 45c0d0304b1d4b4ca7cf982329f6fcdc1542d4f8..f5696e98f676dda291de93e8fa7f4075dd863d3f 100644 (file)
@@ -806,6 +806,17 @@ void client_auth_respond(struct client *client, const char *response)
        if (!client_does_custom_io(client))
                io_remove(&client->io);
 
+       /* This has to happen before * handling, otherwise
+          client can abort failed request. */
+       if (client->final_response) {
+               sasl_server_auth_delayed_final(client);
+               return;
+       }
+       if (strcmp(response, "*") == 0) {
+               sasl_server_auth_abort(client);
+               return;
+       }
+
        client->auth_client_continue_pending = FALSE;
        client_set_auth_waiting(client);
        auth_client_request_continue(client->auth_request, response);
@@ -858,18 +869,6 @@ void client_auth_parse_response(struct client *client)
        if (client_auth_read_line(client) <= 0)
                return;
 
-       /* This has to happen before * handling, otherwise
-          client can abort failed request. */
-       if (client->final_response) {
-               sasl_server_auth_delayed_final(client);
-               return;
-       }
-
-       if (strcmp(str_c(client->auth_response), "*") == 0) {
-               sasl_server_auth_abort(client);
-               return;
-       }
-
        client_auth_respond(client, str_c(client->auth_response));
        memset(str_c_modifiable(client->auth_response), 0,
               str_len(client->auth_response));
index 5fd1f4874cd1e8beead78f793b8e09ee93f1ca76..cc42a6c8ef5c3890b96557e27ae4474bbf772764 100644 (file)
@@ -269,11 +269,6 @@ int cmd_auth_continue(void *conn_ctx,
        struct submission_client *subm_client = conn_ctx;
        struct client *client = &subm_client->common;
 
-       if (strcmp(response, "*") == 0) {
-               client_auth_abort(client);
-               return 0;
-       }
-
        client_auth_respond(client, response);
        return 0;
 }