Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-05 Thread Joshua Tolley
On Thu, Mar 05, 2009 at 08:19:05PM +0100, Magnus Hagander wrote: > Peter Eisentraut wrote: > > On Thursday 05 March 2009 18:04:42 Joshua Tolley wrote: > >> As an aside, is access() adequately portable, ok to use within the > >> backend, etc.? I just sort of took a shot in the dark. > > > > Using a

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-05 Thread Magnus Hagander
Peter Eisentraut wrote: > On Thursday 05 March 2009 18:04:42 Joshua Tolley wrote: >> As an aside, is access() adequately portable, ok to use within the >> backend, etc.? I just sort of took a shot in the dark. > > Using access() is usually not a good idea. In this case it would be better > to >

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-05 Thread Peter Eisentraut
On Thursday 05 March 2009 18:04:42 Joshua Tolley wrote: > As an aside, is access() adequately portable, ok to use within the > backend, etc.? I just sort of took a shot in the dark. Using access() is usually not a good idea. In this case it would be better to check the return of the actual open(

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-05 Thread Joshua Tolley
On Thu, Mar 05, 2009 at 09:47:55AM -0500, Tom Lane wrote: > Magnus Hagander writes: > > Yeah, the big question is if we want to backport something like this at > > all... Thoughts? > > The issue never even came up before, so I'd vote to not take any risks > for it. How often do people mess up th

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-05 Thread Tom Lane
Magnus Hagander writes: > Yeah, the big question is if we want to backport something like this at > all... Thoughts? The issue never even came up before, so I'd vote to not take any risks for it. How often do people mess up the protections on pg_hba.conf? regards, tom la

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-05 Thread Magnus Hagander
Joshua Tolley wrote: > On Wed, Mar 04, 2009 at 10:28:42AM +0100, Magnus Hagander wrote: >> Joshua Tolley wrote: >>> On Wed, Mar 04, 2009 at 09:43:55AM +0100, Magnus Hagander wrote: So. I've updated the comment, and applied your patch. Thanks! >>> What would it take to get it applied to a few e

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-04 Thread Joshua Tolley
On Wed, Mar 04, 2009 at 10:28:42AM +0100, Magnus Hagander wrote: > Joshua Tolley wrote: > > On Wed, Mar 04, 2009 at 09:43:55AM +0100, Magnus Hagander wrote: > >> So. I've updated the comment, and applied your patch. Thanks! > > > > What would it take to get it applied to a few earlier versions as

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-04 Thread Magnus Hagander
Joshua Tolley wrote: > On Wed, Mar 04, 2009 at 09:43:55AM +0100, Magnus Hagander wrote: >> So. I've updated the comment, and applied your patch. Thanks! > > What would it take to get it applied to a few earlier versions as well? I guess you maintaining your own fork? ;-) Simply put, earlier ver

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-04 Thread Joshua Tolley
On Wed, Mar 04, 2009 at 09:43:55AM +0100, Magnus Hagander wrote: > So. I've updated the comment, and applied your patch. Thanks! What would it take to get it applied to a few earlier versions as well? - Josh signature.asc Description: Digital signature

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-04 Thread Magnus Hagander
Selena Deckelmann wrote: > Tom Lane wrote: >> Selena Deckelmann writes: >>> From the comment in hba.c, it appears that the desired behavior is to >>> have the system ignore the failure, >> I'm not sure how you could possibly read that comment that way. > > Right. Sorry, poor choice of words. I me

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-03 Thread Selena Deckelmann
Tom Lane wrote: > Selena Deckelmann writes: >> From the comment in hba.c, it appears that the desired behavior is to >> have the system ignore the failure, > > I'm not sure how you could possibly read that comment that way. Right. Sorry, poor choice of words. I meant "don't die on reload", essen

Re: [HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-03 Thread Tom Lane
Selena Deckelmann writes: > From the comment in hba.c, it appears that the desired behavior is to > have the system ignore the failure, I'm not sure how you could possibly read that comment that way. It might be sane to distinguish initial load from reload, but I think the behavior is correct as

[HACKERS] Make SIGHUP less painful if pg_hba.conf is not readable

2009-03-03 Thread Selena Deckelmann
This is my first patch. I hope it's not stupid. We ran into a little issue today where permission/ownership on pg_hba.conf was accidentally changed to something that the postgres user could not read. When a SIGHUP was issued, the postmaster quit. That was kind of a bummer. >From the comment in