From: Timo Sirainen Date: Tue, 2 Mar 2021 15:30:52 +0000 (+0200) Subject: imap-urlauth: Replace i_info() and i_error() calls with e_info() and e_error() X-Git-Tag: 2.3.15~256 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de3d7f4d0ea496e6d5eecc686f9e2eb1b252dd86;p=thirdparty%2Fdovecot%2Fcore.git imap-urlauth: Replace i_info() and i_error() calls with e_info() and e_error() --- diff --git a/src/imap-urlauth/imap-urlauth-client.c b/src/imap-urlauth/imap-urlauth-client.c index 55b3170a74..c5acec9d86 100644 --- a/src/imap-urlauth/imap-urlauth-client.c +++ b/src/imap-urlauth/imap-urlauth-client.c @@ -148,11 +148,12 @@ static int client_worker_connect(struct client *client) client->fd_ctrl = net_connect_unix_with_retries(socket_path, 1000); if (client->fd_ctrl < 0) { if (errno == EACCES) { - i_error("imap-urlauth-client: %s", + e_error(client->event, "imap-urlauth-client: %s", eacces_error_get("net_connect_unix", socket_path)); } else { - i_error("imap-urlauth-client: net_connect_unix(%s) failed: %m", + e_error(client->event, "imap-urlauth-client: " + "net_connect_unix(%s) failed: %m", socket_path); } return -1; @@ -169,10 +170,10 @@ static int client_worker_connect(struct client *client) if (ret <= 0) { if (ret < 0) { - i_error("fd_send(%s, %d) failed: %m", + e_error(client->event, "fd_send(%s, %d) failed: %m", socket_path, client->fd_ctrl); } else { - i_error("fd_send(%s, %d) failed to send byte", + e_error(client->event, "fd_send(%s, %d) failed to send byte", socket_path, client->fd_ctrl); } client_worker_disconnect(client); @@ -183,7 +184,8 @@ static int client_worker_connect(struct client *client) /* send protocol version handshake */ if (o_stream_send_str(client->ctrl_output, handshake) < 0) { - i_error("Error sending handshake to imap-urlauth worker: %m"); + e_error(client->event, + "Error sending handshake to imap-urlauth worker: %m"); client_worker_disconnect(client); return -1; } @@ -331,7 +333,7 @@ void client_destroy(struct client *client, const char *reason) i_assert(reason != NULL || client->disconnected); if (!client->disconnected) - i_info("Disconnected: %s", reason); + e_info(client->event, "Disconnected: %s", reason); imap_urlauth_client_count--; DLLIST_REMOVE(&imap_urlauth_clients, client); @@ -366,7 +368,7 @@ void client_disconnect(struct client *client, const char *reason) return; client->disconnected = TRUE; - i_info("Disconnected: %s", reason); + e_info(client->event, "Disconnected: %s", reason); client->to_idle = timeout_add(0, client_destroy_timeout, client); } diff --git a/src/imap-urlauth/imap-urlauth-login.c b/src/imap-urlauth/imap-urlauth-login.c index 7f1e58235d..e917a5b8d3 100644 --- a/src/imap-urlauth/imap-urlauth-login.c +++ b/src/imap-urlauth/imap-urlauth-login.c @@ -55,7 +55,8 @@ static void imap_urlauth_client_handle_input(struct client *client) if (!version_string_verify(line, "imap-urlauth", IMAP_URLAUTH_PROTOCOL_MAJOR_VERSION)) { - i_error("IMAP URLAUTH client not compatible with this server " + e_error(client->event, + "IMAP URLAUTH client not compatible with this server " "(mixed old and new binaries?) %s", line); client_destroy(client, "Version mismatch"); return; @@ -71,14 +72,16 @@ static void imap_urlauth_client_handle_input(struct client *client) args = t_strsplit_tabescaped(line); if (str_array_length(args) < AUTH_ARG_COUNT || strcmp(args[0], "AUTH") != 0 || str_to_pid(args[2], &pid) < 0) { - i_error("IMAP URLAUTH client sent unexpected AUTH input: %s", line); + e_error(client->event, + "IMAP URLAUTH client sent unexpected AUTH input: %s", line); client_destroy(client, "Unexpected input"); return; } /* only imap and submission have direct access to urlauth service */ if (strcmp(args[1], "imap") != 0 && strcmp(args[1], "submission") != 0) { - i_error("IMAP URLAUTH accessed from inappropriate service: %s", args[1]); + e_error(client->event, + "IMAP URLAUTH accessed from inappropriate service: %s", args[1]); client_destroy(client, "Unexpected input"); return; } @@ -86,7 +89,8 @@ static void imap_urlauth_client_handle_input(struct client *client) /* verify session pid if possible */ if (net_getunixcred(client->fd, &cred) == 0 && cred.pid != (pid_t)-1 && pid != cred.pid) { - i_error("IMAP URLAUTH client sent invalid session pid %ld in AUTH request: " + e_error(client->event, + "IMAP URLAUTH client sent invalid session pid %ld in AUTH request: " "it did not match peer credentials (pid=%ld, uid=%ld)", (long)pid, (long)cred.pid, (long)cred.uid); client_destroy(client, "Invalid AUTH request");