From: Timo Sirainen Date: Mon, 25 Nov 2019 17:46:52 +0000 (+0200) Subject: lib: connection: Fix remote_pid and remote_uid in UNIX client connection log prefixes X-Git-Tag: 2.3.10~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03300585529d67f5d0d847b4e2f3b4492d067c08;p=thirdparty%2Fdovecot%2Fcore.git lib: connection: Fix remote_pid and remote_uid in UNIX client connection log prefixes They previously weren't included in the log prefixes, because unix_peer_known was set to TRUE too early. --- diff --git a/src/lib/connection.c b/src/lib/connection.c index 8565443ddc..c532f4ade6 100644 --- a/src/lib/connection.c +++ b/src/lib/connection.c @@ -383,7 +383,9 @@ connection_update_properties(struct connection *conn) if (conn->remote_ip.family != 0) i_assert(conn->remote_port != 0); - else if (conn->fd_in != conn->fd_out || fd < 0 || + else if (fd < 0) { + /* not connected yet - wait */ + } else if (conn->fd_in != conn->fd_out || fd < 0 || net_getpeername(fd, &conn->remote_ip, &conn->remote_port) < 0 || conn->remote_ip.family == 0) {