pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Hillman <david@kapitaltrading.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
Date: Thu, 28 Oct 2021 10:33:08 -0500
Message-ID: <e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com> (raw)
In-Reply-To: <287305.1635380278@sss.pgh.pa.us>
References: <17249-c2fa2b1085dfb2f7@postgresql.org>
	<287305.1635380278@sss.pgh.pa.us>

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@dbserver:~# cat ~/.pgpass
cat: /root/.pgpass: No such file or directory
root@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@kapitaltrading.com






view thread (5+ messages)  latest in thread

Message-ID: <e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com>
Permalink:  ../e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com/
Also on:    postgresql.org/message-id/e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david@kapitaltrading.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #17249: Bug in .pgpass search and/or documentation thereof, Ubuntu 13.4-4
  In-Reply-To: <e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com>
  References: <17249-c2fa2b1085dfb2f7@postgresql.org> <287305.1635380278@sss.pgh.pa.us> <e06bb190-7afb-9002-2333-ff3b8ef4e153@kapitaltrading.com>

* 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