]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth-request-handler: Log errors via events
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 31 Oct 2019 14:21:15 +0000 (16:21 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 12 Mar 2021 12:18:13 +0000 (12:18 +0000)
src/auth/auth-request-handler.c

index f104d14557c95e6d6cbabffdd5baf83a35c7f67c..5f7a5a69c2c03ddbdbf0e6b4dc13fe5245b3d6cb 100644 (file)
@@ -535,7 +535,8 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler,
        list = t_strsplit_tabescaped(args);
        if (list[0] == NULL || list[1] == NULL ||
            str_to_uint(list[0], &id) < 0 || id == 0) {
-               i_error("BUG: Authentication client %u "
+               e_error(handler->conn->event,
+                       "BUG: Authentication client %u "
                        "sent broken AUTH request", handler->client_pid);
                return FALSE;
        }
@@ -544,7 +545,8 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler,
                mech = &mech_dovecot_token;
                if (strcmp(list[1], mech->mech_name) != 0) {
                        /* unsupported mechanism */
-                       i_error("BUG: Authentication client %u requested invalid "
+                       e_error(handler->conn->event,
+                               "BUG: Authentication client %u requested invalid "
                                "authentication mechanism %s (DOVECOT-TOKEN required)",
                                handler->client_pid, str_sanitize(list[1], MAX_MECH_NAME_LEN));
                        return FALSE;
@@ -554,7 +556,8 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler,
                mech = mech_register_find(auth_default->reg, list[1]);
                if (mech == NULL) {
                        /* unsupported mechanism */
-                       i_error("BUG: Authentication client %u requested unsupported "
+                       e_error(handler->conn->event,
+                               "BUG: Authentication client %u requested unsupported "
                                "authentication mechanism %s", handler->client_pid,
                                str_sanitize(list[1], MAX_MECH_NAME_LEN));
                        return FALSE;
@@ -591,7 +594,8 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler,
        }
 
        if (*list != NULL) {
-               i_error("BUG: Authentication client %u "
+               e_error(handler->conn->event,
+                       "BUG: Authentication client %u "
                        "sent AUTH parameters after 'resp'",
                        handler->client_pid);
                auth_request_unref(&request);
@@ -599,14 +603,16 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler,
        }
 
        if (request->fields.service == NULL) {
-               i_error("BUG: Authentication client %u "
+               e_error(handler->conn->event,
+                       "BUG: Authentication client %u "
                        "didn't specify service in request",
                        handler->client_pid);
                auth_request_unref(&request);
                return FALSE;
        }
        if (hash_table_lookup(handler->requests, POINTER_CAST(id)) != NULL) {
-               i_error("BUG: Authentication client %u "
+               e_error(handler->conn->event,
+                       "BUG: Authentication client %u "
                        "sent a duplicate ID %u", handler->client_pid, id);
                auth_request_unref(&request);
                return FALSE;
@@ -694,7 +700,8 @@ bool auth_request_handler_auth_continue(struct auth_request_handler *handler,
 
        data = strchr(args, '\t');
        if (data == NULL || str_to_uint(t_strdup_until(args, data), &id) < 0) {
-               i_error("BUG: Authentication client sent broken CONT request");
+               e_error(handler->conn->event,
+                       "BUG: Authentication client sent broken CONT request");
                return FALSE;
        }
        data++;