pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: marc@msys.ch
Subject: Documentation of .pgpass for Unix is incomplete
Date: Thu, 08 Aug 2024 09:44:51 +0000
Message-ID: <172311029184.915368.14898011794686876553@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/libpq-pgpass.html
Description:

The documentation of the .pgpass password file is incomplete in the Unix
case (https://www.postgresql.org/docs/16/libpq-pgpass.html):

It does not mention how the .pgpass File is actually found.  One would
assume it uses the getpwent() function to find the current users
homedirectory and locate the .pgpass file there, but this is not the case. 
It only looks at the HOME environment variable.

If you change the user using setuid() and do not change HOME as well, the
file not be found.  Or assume you start a DB client as root by using su to
change the user id, things will not work:

# /bin/su -c "startx -- " - xpos

This starts X11 and changes to the user xpos, but it does only change the
user id, not $HOME.


view thread (7+ messages)  latest in thread

Message-ID: <172311029184.915368.14898011794686876553@wrigleys.postgresql.org>
Permalink:  ../172311029184.915368.14898011794686876553@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/172311029184.915368.14898011794686876553@wrigleys.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, marc@msys.ch
  Subject: Re: Documentation of .pgpass for Unix is incomplete
  In-Reply-To: <172311029184.915368.14898011794686876553@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox