bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Boschbool doveadm_client_is_allowed_command(const struct doveadm_settings *set,
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch t_strsplit(set->doveadm_allowed_commands, ",");
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Boschstatic int client_connection_read_settings(struct client_connection *conn)
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch const struct setting_parser_info *set_roots[] = {
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch if (master_service_settings_read(master_service, &input,
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch i_error("Error reading configuration: %s", error);
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch set = master_service_settings_get_others(master_service)[0];
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch conn->set = settings_dup(&doveadm_setting_parser_info, set, conn->pool);
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Boschint client_connection_init(struct client_connection *conn,
6fc40674e5a33787ae7fcd47a77a77ea20977994Aki Tuomi enum doveadm_client_type type, pool_t pool, int fd)
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch (void)net_getsockname(fd, &conn->local_ip, &conn->local_port);
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch (void)net_getpeername(fd, &conn->remote_ip, &conn->remote_port);
80a225c0b1f4bf322a562cc7c21d5891fb6895eeStephan Bosch conn->name = conn->remote_ip.family == 0 ? "<local>" :
80a225c0b1f4bf322a562cc7c21d5891fb6895eeStephan Bosch p_strdup(pool, net_ip2addr(&conn->remote_ip));
80a225c0b1f4bf322a562cc7c21d5891fb6895eeStephan Boschvoid client_connection_destroy(struct client_connection **_conn)
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch master_service_client_connection_destroyed(master_service);
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Boschvoid client_connection_set_proctitle(struct client_connection *conn,
4e08875e53e96c8af3bfcb7c4aaa9c3a132101f8Stephan Bosch str = t_strdup_printf("[%s %s]", conn->name, text);