From: Timo Sirainen Date: Thu, 22 Dec 2022 11:42:02 +0000 (+0200) Subject: login-common: Disconnect reason - Clarify "auth aborted by client" handling X-Git-Tag: 2.4.0~2907 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41b1a8cd149117afe07c509396ef6ce99ed41eaa;p=thirdparty%2Fdovecot%2Fcore.git login-common: Disconnect reason - Clarify "auth aborted by client" handling Rename client.auth_try_aborted to auth_aborted_by_client and clarify the disconnect reason message. --- diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index e962537b96..a299d54734 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -1148,8 +1148,8 @@ const char *client_get_extra_disconnect_reason(struct client *client) return t_strdup_printf("disconnected while finishing login, " "waited %u secs", auth_secs); } - if (client->auth_try_aborted && client->auth_attempts == 1) - return "aborted authentication"; + if (client->auth_aborted_by_client && client->auth_attempts == 1) + return "auth aborted by client"; if (client->auth_process_comm_fail) return "auth process communication failure"; diff --git a/src/login-common/client-common.h b/src/login-common/client-common.h index c55c9b74ff..0d4bda8557 100644 --- a/src/login-common/client-common.h +++ b/src/login-common/client-common.h @@ -260,7 +260,9 @@ struct client { bool authenticating:1; /* SASL authentication is waiting for client to send a continuation */ bool auth_client_continue_pending:1; - bool auth_try_aborted:1; + /* Client asked for SASL authentication to be aborted by sending + "*" line. */ + bool auth_aborted_by_client:1; bool auth_initializing:1; bool auth_process_comm_fail:1; bool auth_anonymous:1; @@ -327,6 +329,8 @@ void client_set_title(struct client *client); const char *client_get_extra_disconnect_reason(struct client *client); void client_auth_respond(struct client *client, const char *response); +/* Called when client asks for SASL authentication to be aborted by sending + "*" line. */ void client_auth_abort(struct client *client); bool client_is_tls_enabled(struct client *client); void client_auth_fail(struct client *client, const char *text); diff --git a/src/login-common/sasl-server.c b/src/login-common/sasl-server.c index 2f02458336..08a7956f2d 100644 --- a/src/login-common/sasl-server.c +++ b/src/login-common/sasl-server.c @@ -511,7 +511,7 @@ void sasl_server_auth_begin(struct client *client, const char *mech_name, i_assert(auth_client_is_connected(auth_client)); client->auth_attempts++; - client->auth_try_aborted = FALSE; + client->auth_aborted_by_client = FALSE; client->authenticating = TRUE; client->master_auth_id = 0; if (client->auth_first_started == 0) @@ -596,7 +596,7 @@ void sasl_server_auth_failed(struct client *client, const char *reason, void sasl_server_auth_abort(struct client *client) { - client->auth_try_aborted = TRUE; + client->auth_aborted_by_client = TRUE; if (client->anvil_query != NULL) { anvil_client_query_abort(anvil, &client->anvil_query); i_free(client->anvil_request); diff --git a/src/login-common/sasl-server.h b/src/login-common/sasl-server.h index 643d35976e..6bafb164c4 100644 --- a/src/login-common/sasl-server.h +++ b/src/login-common/sasl-server.h @@ -39,6 +39,8 @@ void sasl_server_auth_begin(struct client *client, const char *mech_name, sasl_server_callback_t *callback); void sasl_server_auth_failed(struct client *client, const char *reason, const char *code) ATTR_NULL(3); +/* Called when client asks for SASL authentication to be aborted by sending + "*" line. */ void sasl_server_auth_abort(struct client *client); #endif