]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Disconnect reason - Clarify "auth aborted by client" handling
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Dec 2022 11:42:02 +0000 (13:42 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 23 Mar 2023 08:06:31 +0000 (08:06 +0000)
Rename client.auth_try_aborted to auth_aborted_by_client and clarify the
disconnect reason message.

src/login-common/client-common.c
src/login-common/client-common.h
src/login-common/sasl-server.c
src/login-common/sasl-server.h

index e962537b96b2c183ad7f0a26447bed24734e09ab..a299d54734044187b285b76de8d57d9b3a585e64 100644 (file)
@@ -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";
 
index c55c9b74ffbbe062ff97b56edf8b20a1280c9012..0d4bda8557b1b232ca6fc30709b28738b5fa450a 100644 (file)
@@ -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);
index 2f02458336078a522aeed1d1468dd234b399e3c4..08a7956f2d1c7367d8c563cef3100e9094cdca0a 100644 (file)
@@ -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);
index 643d35976e56117696c134682c680e62308d1c02..6bafb164c4277fec23ad434aae4df20a1e019a0e 100644 (file)
@@ -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