Re: Warning about invalid .pgpass passwords - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Warning about invalid .pgpass passwords
Date
Msg-id 3f0b79eb1003091931w2f379fe4r1ed53fea304ea1cf@mail.gmail.com
Whole thread Raw
In response to Warning about invalid .pgpass passwords  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Wed, Mar 10, 2010 at 11:52 AM, Bruce Momjian <bruce@momjian.us> wrote:
> The attached patch reports the fact that .pgpass was used if the libpq
> connection fails:

+    /*
+     *    If the connection failed, we should mention that
+     *    we got the password from .pgpass in case that
+     *    password is wrong.
+     */
+    if (conn->used_dot_pgpass && conn->password_needed)
+        appendPQExpBufferStr(&conn->errorMessage,
+            libpq_gettext("(password retrieved from .pgpass)\n"));

I think that this should be in PQconnectPoll() rather than connectDBComplete().
Otherwise, only when we make a connection to the server in a nonblocking manner
(i.e., use PQconnectStart() and PQconnectPoll()), that HINT message is
not output.
This looks odd for me. Thought?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Warning about invalid .pgpass passwords
Next
From: Tom Lane
Date:
Subject: Re: Warning about invalid .pgpass passwords