Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdac983

Browse files
committed
libpq: Fix inadvertent change in .pgpass lookup behavior.
Commit274bb2b caused password filelookups to use the hostaddr in preference to the host, but that wasnot intended and the documented behavior is the opposite.Report and patch by Kyotaro Horiguchi.Discussion:http://postgr.es/m/20170428.165432.60857995.horiguchi.kyotaro@lab.ntt.co.jp
1 parentfed6df4 commitbdac983

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,18 @@ connectOptions2(PGconn *conn)
978978

979979
for (i=0;i<conn->nconnhost;i++)
980980
{
981-
/* Try to get a password for this host from pgpassfile */
981+
/*
982+
* Try to get a password for this host from pgpassfile. We use host
983+
* name rather than host address in the same manner to PQhost().
984+
*/
985+
char*pwhost=conn->connhost[i].host;
986+
987+
if (conn->connhost[i].type==CHT_HOST_ADDRESS&&
988+
conn->pghost!=NULL&&conn->pghost[0]!='\0')
989+
pwhost=conn->pghost;
990+
982991
conn->connhost[i].password=
983-
passwordFromFile(conn->connhost[i].host,
992+
passwordFromFile(pwhost,
984993
conn->connhost[i].port,
985994
conn->dbName,
986995
conn->pguser,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp