Re: Thoughts on pg_hba.conf rejection - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Thoughts on pg_hba.conf rejection
Date
Msg-id 5856.1271709021@sss.pgh.pa.us
Whole thread Raw
In response to Re: Thoughts on pg_hba.conf rejection  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Thoughts on pg_hba.conf rejection  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Thoughts on pg_hba.conf rejection  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> Point of note on giving information to the bad guys: if a
> should-be-rejected connection request attempts to connect to a
> non-existent database, we say "database does not exist".

Yeah.  This was an acknowledged shortcoming of the changes to eliminate
flat-file storage of authentication information --- as of 9.0, it's
necessary to connect to some database in order to proceed with auth
checking.  We discussed it at the time and agreed it was an acceptable
loss.

The only way I can think of to improve that without going back to flat
files would be to develop a way for backends to switch databases after
initial startup, so that auth could be done in a predetermined database
(say, "postgres") before switching to the requested DB.  This has enough
potential gotchas, in regards to catalog caching for instance, that I'm
not eager to go there.

Alternatively we could lie, and produce an auth failure message of some
sort rather than admitting the DB doesn't exist.  But that seems like
it's going to create enough confusion to not be acceptable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Standalone backends run StartupXLOG in an incorrect environment
Next
From: Simon Riggs
Date:
Subject: Re: Thoughts on pg_hba.conf rejection