From: Timo Sirainen Date: Thu, 31 Oct 2019 14:21:15 +0000 (+0200) Subject: auth: auth-request-handler: Log errors via events X-Git-Tag: 2.3.15~237 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e06d67755624331e3fda1e90d5fca8f8fd6afd7;p=thirdparty%2Fdovecot%2Fcore.git auth: auth-request-handler: Log errors via events --- diff --git a/src/auth/auth-request-handler.c b/src/auth/auth-request-handler.c index f104d14557..5f7a5a69c2 100644 --- a/src/auth/auth-request-handler.c +++ b/src/auth/auth-request-handler.c @@ -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++;