struct auth_mech_desc mech_desc;
if (args[0] == NULL) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server sent broken MECH line");
return -1;
}
const char *const *args)
{
if (str_to_uint(args[0], &conn->server_pid) < 0) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server sent invalid PID");
return -1;
}
{
if (args[0] == NULL ||
str_to_uint(args[0], &conn->connect_uid) < 0) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server sent broken CUID line");
return -1;
}
const char *const *args)
{
if (conn->cookie != NULL) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server already sent cookie");
return -1;
}
static int auth_server_input_done(struct auth_client_connection *conn)
{
if (array_count(&conn->available_auth_mechs) == 0) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server returned no mechanisms");
return -1;
}
if (conn->cookie == NULL) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server didn't send a cookie");
return -1;
}
args[1] != NULL && args[2] != NULL) {
if (str_to_uint(args[1], &major_version) < 0 ||
str_to_uint(args[2], &minor_version) < 0) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"Auth server sent invalid version line: %s",
line);
return -1;
return auth_server_input_done(conn);
}
- e_error(conn->event, "Auth server sent unknown handshake: %s", line);
+ e_error(conn->conn.event, "Auth server sent unknown handshake: %s", line);
return -1;
}
unsigned int id;
if (id_arg == NULL || str_to_uint(id_arg, &id) < 0) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server input missing ID");
return -1;
}
request = hash_table_lookup(conn->requests, POINTER_CAST(id));
if (request == NULL) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"Authentication server sent unknown id %u", id);
return 0;
}
int ret;
if (str_array_length(args) < 2) {
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Authentication server sent broken CONT line");
return -1;
}
{
const char *const *args;
- e_debug(conn->event, "auth input: %s", line);
+ e_debug(conn->conn.event, "auth input: %s", line);
args = t_strsplit_tabescaped(line);
if (args[0] == NULL) {
- e_error(conn->event, "Auth server sent empty line");
+ e_error(conn->conn.event, "Auth server sent empty line");
return -1;
}
if (strcmp(args[0], "OK") == 0)
else if (strcmp(args[0], "FAIL") == 0)
return auth_server_input_fail(conn, args + 1);
else {
- e_error(conn->event,
+ e_error(conn->conn.event,
"Auth server sent unknown response: %s", args[0]);
return -1;
}
conn->conn.event_parent = client->event;
connection_init_client_unix(client->clist, &conn->conn,
client->auth_socket_path);
- conn->event = conn->conn.event;
hash_table_create_direct(&conn->requests, pool, 100);
i_array_init(&conn->available_auth_mechs, 8);
hash_table_clear(conn->requests, FALSE);
if (request_count > 0) {
- e_warning(conn->event,
+ e_warning(conn->conn.event,
"Auth connection closed with %u pending requests "
"(max %u secs, pid=%s, %s)", request_count,
(unsigned int)(ioloop_time - oldest),
break;
case CONNECTION_DISCONNECT_BUFFER_FULL:
/* buffer full - can't happen unless auth is buggy */
- e_error(conn->event,
+ e_error(conn->conn.event,
"BUG: Auth server sent us more than %d bytes of data",
AUTH_SERVER_CONN_MAX_LINE_LENGTH);
auth_client_connection_disconnect(conn, "Buffer full");
static void auth_client_handshake_timeout(struct auth_client_connection *conn)
{
- e_error(conn->event, "Timeout waiting for handshake from auth server. "
+ e_error(conn->conn.event, "Timeout waiting for handshake from auth server. "
"my pid=%u, input bytes=%"PRIuUOFF_T,
conn->client->client_pid, conn->conn.input->v_offset);
auth_client_connection_reconnect(conn, "auth server timeout");
/* max. 1 second wait here. */
if (connection_client_connect(&conn->conn) < 0) {
if (errno == EACCES) {
- e_error(conn->event, "%s",
+ e_error(conn->conn.event, "%s",
eacces_error_get("connect",
conn->client->auth_socket_path));
} else {
- e_error(conn->event, "connect(%s) failed: %m",
+ e_error(conn->conn.event, "connect(%s) failed: %m",
conn->client->auth_socket_path);
};
return -1;
AUTH_CLIENT_PROTOCOL_MINOR_VERSION,
conn->client->client_pid);
if (o_stream_send_str(conn->conn.output, handshake) < 0) {
- e_warning(conn->event,
+ e_warning(conn->conn.event,
"Error sending handshake to auth server: %s",
o_stream_get_error(conn->conn.output));
auth_client_connection_disconnect(conn,