Re: Patch to be verbose about being unable to read ~/.pgpasss...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sean Chittenden <sean(at)chittenden(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch to be verbose about being unable to read ~/.pgpasss...
Date: 2003-06-20 18:27:25
Message-ID: 19478.1056133645@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Sean Chittenden <sean(at)chittenden(dot)org> writes:
> stderr is hooked up to the error logs under Apache, which is the
> normal error reporting mechanism. I thought about adding a test to
> see if stderr is writable, but given that better than 99% of the time
> it will be, I didn't see the point, esp since the above case regarding
> the permissions, doesn't.

If you are inside a GUI application, it's entirely likely that stderr
is hooked up to /dev/null. I think Peter's complaint has great force
--- libpq has no business assuming it's okay to write on stderr. The
entire reason we provided a notice-processor hook is to get away from
that assumption.

>> But it's not an error; we must not fail the connection attempt just
>> because of this.

> Agreed, though one train of thought is that if someone did put a
> .pgpass file in place that isn't readable, it should be known that
> their efforts are being wasted in vein.

Yeah, in fact I've been reconsidering that. If we fail to stat the
file, we should just return quietly; but if we can stat it but not
open it, it's reasonable to assume there's something wrong that ought
to be fixed. It's difficult to say that this shouldn't be a hard error
if you accept my suggestion that world readability should be an error.

If we do take that viewpoint then the problem goes away, since we can
just report all the reportable conditions as connection-failure
messages.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Sean Chittenden 2003-06-20 18:48:20 Re: Patch to be verbose about being unable to read ~/.pgpasss...
Previous Message Sean Chittenden 2003-06-20 18:03:26 Re: Patch to be verbose about being unable to read ~/.pgpasss...