Re: Silent failure with invalid hba_file setting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Silent failure with invalid hba_file setting
Date
Msg-id 26359.1318977483@sss.pgh.pa.us
Whole thread Raw
In response to Silent failure with invalid hba_file setting  (Thom Brown <thom@linux.com>)
Responses Re: Silent failure with invalid hba_file setting
Re: Silent failure with invalid hba_file setting
List pgsql-hackers
Thom Brown <thom@linux.com> writes:
> I noticed that if the hba_file setting in the config is uncommented
> and set to a directory instead of the full path to the file, no error
> occurs when the service starts.

When I try that, I get a boatload of errors ending with
FATAL:  could not load pg_hba.conf

I suspect what happened to you is that the directory read like an empty
file, so Postgres didn't see any error condition.  I suppose we could
add an fstat test to see if we'd opened something other than a regular
file, but I'm not terribly excited about it.

> The problem with this is you cannot get into the database as it acts
> as if it did find the hba file but found it empty.

Well, an actually empty pg_hba.conf file would have the same problem,
and it's pretty hard to see any situation where it would be useful to
start the postmaster and not let it accept any connections.  Should we
add a check to consider it an error if the file doesn't contain at least
one HBA record?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: new compiler warnings
Next
From: Thom Brown
Date:
Subject: Re: Silent failure with invalid hba_file setting