]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: connection: Fix remote_pid and remote_uid in UNIX client connection log prefixes
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 25 Nov 2019 17:46:52 +0000 (19:46 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 25 Nov 2019 17:49:29 +0000 (19:49 +0200)
They previously weren't included in the log prefixes, because
unix_peer_known was set to TRUE too early.

src/lib/connection.c

index 8565443ddcb7a3305d662793956f8c5321e8fbc6..c532f4ade6a78ac2c3846ccbb9e98e467444413f 100644 (file)
@@ -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) {