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;
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);
/* 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;
}
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);
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);
}
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;
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;
}
/* 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");