commit c323ba88d5a9823765c68cd4c2c169493e4c269a Author: Jacob Champion Date: Tue Mar 9 09:53:03 2021 -0800 fixup! Log authenticated identity from all auth backends diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 65d10a5ad2..bfcffbdb3b 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -354,8 +354,6 @@ set_authn_id(Port *port, const char *id) { Assert(id); - /* TODO: should the identity strings be escaped before being logged? */ - if (port->authn_id) { /* @@ -2002,7 +2000,6 @@ auth_peer(hbaPort *port) gid_t gid; #ifndef WIN32 struct passwd *pw; - char *peer_user; int ret; #endif @@ -2038,12 +2035,9 @@ auth_peer(hbaPort *port) * Make a copy of static getpw*() result area. This is our authenticated * identity. */ - peer_user = pstrdup(pw->pw_name); - set_authn_id(port, peer_user); - - ret = check_usermap(port->hba->usermap, port->user_name, peer_user, false); + set_authn_id(port, pw->pw_name); - pfree(peer_user); + ret = check_usermap(port->hba->usermap, port->user_name, port->authn_id, false); return ret; #else