Re: Patch to be verbose about being unable to read ~/.pgpasss... - Mailing list pgsql-patches

From Tom Lane
Subject Re: Patch to be verbose about being unable to read ~/.pgpasss...
Date
Msg-id 11049.1056395129@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch to be verbose about being unable to read ~/.pgpasss...  (Sean Chittenden <sean@chittenden.org>)
Responses Re: Patch to be verbose about being unable to read ~/.pgpasss...
List pgsql-patches
Sean Chittenden <sean@chittenden.org> writes:
> I maintain that having a security concern in PasswordFromFile() cause
> the connection to abort as the default behavior is a bad idea.

That is a legitimate concern.  Doesn't seem like we have any really
clean way to satisfy all the needs here.

One idea I was toying with was to have PasswordFromFile set a flag in
the PGconn struct indicating that .pgpass has permissions problems.
Then some later routine could check the flag and issue the notice if
needed, giving the app a chance to install its notice handler
beforehand.  However, this begs the question of *which* later routine
should do this.  PQexec would once have been the obvious choice, but
as of 7.4 it's quite possible that some apps would never use it.
And I don't want to sprinkle the issue through a bunch of different
routines.  Maybe PQgetResult would be a safe bet that all apps would
go through (directly or indirectly).  Comments?

            regards, tom lane

pgsql-patches by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: Patch to be verbose about being unable to read ~/.pgpasss...
Next
From: "Greg Sabino Mullane"
Date:
Subject: Consistent timestamp input