pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Magnus Hagander <magnus@hagander.net>
To: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory
Date: Sat, 3 Dec 2011 15:09:16 +0100
Message-ID: <CABUevEzbAzNC2s592MqmCT6XZMKGFqMxBnXc_MkY-+Rfmdar3g@mail.gmail.com> (raw)
In-Reply-To: <1321898611.5998.3.camel@titan.home.flameeyes.eu>
References: <201111201345.pAKDjbH5068726@wwwmaster.postgresql.org>
	<CABUevEx3yjv=8DFh8cJZ214vgJ9kbrnQ8LkLLKo91eU0jPpB7w@mail.gmail.com>
	<1321897436.2703.4.camel@titan.home.flameeyes.eu>
	<CABUevEzPSc=JyehN2pUA8_3Bh47jrSVZM91R=Eh3pp6tTvU_6w@mail.gmail.com>
	<1321898611.5998.3.camel@titan.home.flameeyes.eu>

On Mon, Nov 21, 2011 at 19:03, Diego Elio Pettenò
<flameeyes@flameeyes.eu> wrote:
> 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...

Ok, I've applied this quick-fix for head, 9.1 and 9.0 (which is as far
back as that code goes).

Unfortunately I forgot about the push earlier this week, so it's going
to miss the releases that go out early next week. But it will be in
the next ones.


>> 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.

We don't really have a way to log warnings in the libpq client. In
theory we could just spit it to stderr, but that seems like a really
bad idea.

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/



view thread (6+ messages)

Message-ID: <CABUevEzbAzNC2s592MqmCT6XZMKGFqMxBnXc_MkY-+Rfmdar3g@mail.gmail.com>
Permalink:  ../CABUevEzbAzNC2s592MqmCT6XZMKGFqMxBnXc_MkY-+Rfmdar3g@mail.gmail.com/
Also on:    postgresql.org/message-id/CABUevEzbAzNC2s592MqmCT6XZMKGFqMxBnXc_MkY-+Rfmdar3g@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: magnus@hagander.net, flameeyes@flameeyes.eu
  Subject: Re: BUG #6302: Certificate lookup fails for users with /dev/null as home directory
  In-Reply-To: <CABUevEzbAzNC2s592MqmCT6XZMKGFqMxBnXc_MkY-+Rfmdar3g@mail.gmail.com>
  References: <201111201345.pAKDjbH5068726@wwwmaster.postgresql.org> <CABUevEx3yjv=8DFh8cJZ214vgJ9kbrnQ8LkLLKo91eU0jPpB7w@mail.gmail.com> <1321897436.2703.4.camel@titan.home.flameeyes.eu> <CABUevEzPSc=JyehN2pUA8_3Bh47jrSVZM91R=Eh3pp6tTvU_6w@mail.gmail.com> <1321898611.5998.3.camel@titan.home.flameeyes.eu> <CABUevEzbAzNC2s592MqmCT6XZMKGFqMxBnXc_MkY-+Rfmdar3g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox