Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4

From: David Hillman <david(at)kapitaltrading(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
Date: 2021-10-28 15:33:08
Message-ID: e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 10/27/21 7:17 PM, Tom Lane wrote:

> Notice it says "peer authentication", not "password authentication".
> So the password was never asked for, and the problem is that you're
> not logged in as "valid_user" (rather, it looks like, as "root").

This is still a bug, since per your description, the -U flag doesn't
work correctly -- or is meaningless.  And, the -U flag works differently
depending on which other flags are set ( -h in his case ), as my example
does show, and that's not documented anywhere, as far as I know.

> This is evidently going to a different pg_hba.conf line, which
> might or might not be selecting password auth --- we can't see it.

There exist no such lines which pertain to "valid_user" here.

Furthermore, if I remove .pgpass, this case's result changes.

root(at)dbserver:~# cat ~/.pgpass
cat: /root/.pgpass: No such file or directory
root(at)dbserver:~# psql -d postgres -U valid_user -h localhost
Password for user valid_user:

Clearly, .pgpass is being utilized in the second example, and not in the
first, contrary to the apparent intent and the documentation.

--
David Hillman
david(at)kapitaltrading(dot)com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-10-28 15:47:01 Re: conchuela timeouts since 2021-10-09 system upgrade
Previous Message Noah Misch 2021-10-28 14:04:59 Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data