1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

Get rid of pgpass_from_client tracking inside libpq --- given the conclusion

that presence of the password in the conninfo string must be checked *before*
risking a connection attempt, there is no point in checking it afterwards.
This makes the specification of PQconnectionUsedPassword() a bit simpler
and perhaps more generally useful, too.
This commit is contained in:
Tom Lane
2008-09-22 14:21:44 +00:00
parent cae7ad906a
commit c52aab5525
3 changed files with 12 additions and 35 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.264 2008/09/22 13:55:13 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.265 2008/09/22 14:21:44 tgl Exp $ -->
<chapter id="libpq">
<title><application>libpq</application> - C Library</title>
@ -1201,7 +1201,6 @@ PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg);
<synopsis>
int PQconnectionNeedsPassword(const PGconn *conn);
</synopsis>
</para>
<para>
@ -1216,19 +1215,16 @@ PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg);
<listitem>
<para>
Returns true (1) if the connection authentication method
used a caller-supplied password. Returns false (0) if not.
used a password. Returns false (0) if not.
<synopsis>
int PQconnectionUsedPassword(const PGconn *conn);
</synopsis>
</para>
<para>
This function detects whether a password supplied to the connection
function was actually used. Passwords obtained from other
sources (such as the <filename>.pgpass</> file) are not considered
caller-supplied.
This function can be applied after either a failed or successful
connection attempt to detect whether the server demanded a password.
</para>
</listitem>
</varlistentry>