Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory - Mailing list pgsql-bugs

From Diego Elio Pettenò
Subject Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory
Date
Msg-id 1321898611.5998.3.camel@titan.home.flameeyes.eu
Whole thread Raw
In response to Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory  (Magnus Hagander <magnus@hagander.net>)
Responses Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory  (Magnus Hagander <magnus@hagander.net>)
List pgsql-bugs
Il giorno lun, 21/11/2011 alle 18.59 +0100, Magnus Hagander ha scritto:
> So a simple extension of the check to be for both ENOENT and ENOTDIR
> would work, right?

In this case, yes...

> Without validating the server certificate, however, it's kind of hard
> to actually call it secure.

As you said, that's a different beast altogether and is not what it's
doing right now ;)

> So yes, you'd fail. But in a scenario where you had say the wrong
> permissions on the file, we'd silently ignore it - this doesn't seem
> like the right thing to do. And it will cause scenarios hard to debug.

I would say that the proper solution would be something like:

Check if the file is reachable with stat; if any error happens during
stat(), log it (eventually) but let it pass; if the file is present but
with wrong (too wide?) permissions, throw an error, otherwise just use
it.

This way it doesn't really matter if the error is ENOENT, ENOTDIR,
ETOOLONG, or whatever else, if the file is unusable just tell me so and
don't use it.. authentication may proceed just fine.

> That's a different thing though. We'd have to do both though - but let
> $HOME override it.

That would be the preferred option indeed.

Thanks,

--
Diego Elio Pettenò <flameeyes@flameeyes.eu>



pgsql-bugs by date:

Previous
From: Diego Elio Pettenò
Date:
Subject: Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory
Next
From: Robert Haas
Date:
Subject: Re: BUG #6300: duplicate key value violates unique constraint