Skip to content

Commit d0f9ca3

Browse files
committed
Remove canonicalize_path() call for .pgpass socket directory comparison;
not worth adding path.c to libpq.
1 parent 0622821 commit d0f9ca3

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.329 2006/05/17 21:50:54 momjian Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.330 2006/05/18 16:26:44 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3110,19 +3110,13 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
31103110
if (hostname == NULL)
31113111
hostname = DefaultHost;
31123112
else if (is_absolute_path(hostname))
3113-
{
3114-
char canon_host[MAXPGPATH];
3115-
char canon_def_socket[MAXPGPATH];
3116-
3117-
StrNCpy(canon_host, hostname, MAXPGPATH);
3118-
StrNCpy(canon_def_socket, DEFAULT_PGSOCKET_DIR, MAXPGPATH);
3119-
3120-
canonicalize_path(canon_host);
3121-
canonicalize_path(canon_def_socket);
3122-
3123-
if (strcmp(canon_host, canon_def_socket) == 0)
3113+
/*
3114+
* We should probably use canonicalize_path(), but then
3115+
* we have to bring path.c into libpq, and it doesn't
3116+
* seem worth it.
3117+
*/
3118+
if (strcmp(hostname, DEFAULT_PGSOCKET_DIR) == 0)
31243119
hostname = DefaultHost;
3125-
}
31263120

31273121
if (port == NULL)
31283122
port = DEF_PGPORT_STR;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy