From: Stephan Bosch Date: Sat, 7 Oct 2023 22:54:09 +0000 (+0200) Subject: login-common: client-common-auth - Move SASL response pre-checks to client_auth_respo... X-Git-Tag: 2.4.0~2494 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c99f7e5a40a1b9d6aee1e3b35f4cc3d69e4c5ddc;p=thirdparty%2Fdovecot%2Fcore.git login-common: client-common-auth - Move SASL response pre-checks to client_auth_response() This fixes Submission and ManageSieve not calling sasl_server_auth_delayed_final(). --- diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index 45c0d0304b..f5696e98f6 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -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)); diff --git a/src/submission-login/client-authenticate.c b/src/submission-login/client-authenticate.c index 5fd1f4874c..cc42a6c8ef 100644 --- a/src/submission-login/client-authenticate.c +++ b/src/submission-login/client-authenticate.c @@ -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; }