Remove canonicalize_path() call for .pgpass socket directory comparison;

not worth adding path.c to libpq.
This commit is contained in:
Bruce Momjian 2006-05-18 16:26:44 +00:00
parent 0622821853
commit d0f9ca34bd
1 changed files with 7 additions and 13 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.329 2006/05/17 21:50:54 momjian Exp $ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.330 2006/05/18 16:26:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -3110,19 +3110,13 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
if (hostname == NULL) if (hostname == NULL)
hostname = DefaultHost; hostname = DefaultHost;
else if (is_absolute_path(hostname)) else if (is_absolute_path(hostname))
{ /*
char canon_host[MAXPGPATH]; * We should probably use canonicalize_path(), but then
char canon_def_socket[MAXPGPATH]; * we have to bring path.c into libpq, and it doesn't
* seem worth it.
StrNCpy(canon_host, hostname, MAXPGPATH); */
StrNCpy(canon_def_socket, DEFAULT_PGSOCKET_DIR, MAXPGPATH); if (strcmp(hostname, DEFAULT_PGSOCKET_DIR) == 0)
canonicalize_path(canon_host);
canonicalize_path(canon_def_socket);
if (strcmp(canon_host, canon_def_socket) == 0)
hostname = DefaultHost; hostname = DefaultHost;
}
if (port == NULL) if (port == NULL)
port = DEF_PGPORT_STR; port = DEF_PGPORT_STR;