pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christian Kastner <debian@kvr.at>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Possible regression: libpq + SSL aborts when user has no home directory
Date: Thu, 03 Mar 2011 18:58:14 -0500
Message-ID: <10824.1299196694@sss.pgh.pa.us> (raw)
In-Reply-To: <8295.1299189555@sss.pgh.pa.us>
References: <4D6FF05E.1050201@kvr.at>
	<8295.1299189555@sss.pgh.pa.us>

I wrote:
> Christian Kastner <debian@kvr.at> writes:
>> Using libpq 9.0.3, when an SSL connection is attempted from a client
>> whose EUID is not in a password database, the connection fails because
>> the home directory cannot be determined. With libpq 8.4.7, everything is
>> fine.

> Hmm.  Offhand I agree that that seems like an unnecessary regression.
> It should act just the same as if it could not find any of those files.
> A quick look with git blame suggests that this got broken in my
> commit 4ed4b6c54e5fab24ab2624d80e26f7546edc88ad, and I don't think
> that it was intentional.

> One small problem is that if the sslmode is "verify-ca" or
> "verify-full", failure to find the root cert file is an error,
> and that error message normally includes the pathname at which
> the cert file was sought.  What shall we print if we couldn't
> identify the home directory?

Attached is an untested patch which I'd appreciate if you (or somebody
else who uses SSL connections more than I do) could test.  I resolved
the last mentioned problem by printing "~/.postgresql/root.crt", which
is a bit of a Unix-ism but doesn't seem too unreasonable, and anyway we
weren't printing anything terribly useful before either.  We could
change that message though if we wanted, since AFAICS the only way to
get there is pqGetHomeDirectory failure.  So we could just print the
"could not get home directory" message instead.  Thoughts?

			regards, tom lane

view thread (7+ messages)  latest in thread

Message-ID: <10824.1299196694@sss.pgh.pa.us>
Permalink:  ../10824.1299196694@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10824.1299196694@sss.pgh.pa.us

 ·  · 

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: tgl@sss.pgh.pa.us, debian@kvr.at
  Subject: Re: Possible regression: libpq + SSL aborts when user has no home directory
  In-Reply-To: <10824.1299196694@sss.pgh.pa.us>
  References: <4D6FF05E.1050201@kvr.at> <8295.1299189555@sss.pgh.pa.us> <10824.1299196694@sss.pgh.pa.us>

* 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