fix regression in .pgpass handling

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: fix regression in .pgpass handling
Date: 2003-01-28 19:44:28
Message-ID: 1043783068.9543.64.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

The handling of .pgpass files in libpq was recently "fixed" to work with
all connection methods (a patch applied to both REL7_3_STABLE and HEAD),
but that change broke .pgpass usage in PQsetdbLogin().

This patch fixes the regression, so .pgpass should now be able to work
with all of the appropriate database connection methods in libpq.

I also fixed a bug in the parsing of .pgpass: if the file was not
terminated by a newline, the password would be slightly mangled. I
didn't bother to account for a CRLF line ending -- is getenv("HOME")
defined on Win32?

I also refactored a bit of code in PasswordFromFile(), and added some
missing environmental variables to the libpq docs.

This patch is against CVS HEAD, but it should apply to REL7_3_STABLE
with just a few offsets. Please apply to both.

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

Attachment Content-Type Size
libpq-pgpass-1.patch text/x-patch 6.6 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2003-01-28 21:58:31 Re: minor doc / usage fixes
Previous Message Alex Cichowski 2003-01-28 07:37:04 getpeereid() for local ident