Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
84f878f5
Commit
84f878f5
authored
Aug 19, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use get_home_path so libpq doesn't pull path.c into the library.
parent
76dd2333
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
doc/src/sgml/libpq.sgml
doc/src/sgml/libpq.sgml
+3
-2
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+12
-5
No files found.
doc/src/sgml/libpq.sgml
View file @
84f878f5
<!--
$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.16
0 2004/08/17 16:54:46
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.16
1 2004/08/19 00:00:34
momjian Exp $
-->
<chapter id="libpq">
...
...
@@ -136,7 +136,8 @@ PGconn *PQconnectdb(const char *conninfo);
likely to fail if <application>libpq</application> is passed a host name
that is not the name of the machine at <literal>hostaddr</>.) Also,
<literal>host</> rather than <literal>hostaddr</> is used to identify
the connection in <filename>$HOME/.pgpass</>.
the connection in <filename>$HOME/.pgpass</> (or
<filename>%USERPROFILE%/.pgpass</> on Win32).
</para>
<para>
Without either a host name or host address,
...
...
src/interfaces/libpq/fe-connect.c
View file @
84f878f5
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.28
1 2004/08/18 02:59:11
momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.28
2 2004/08/19 00:00:34
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -3093,7 +3093,7 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
{
FILE
*
fp
;
char
*
pgpassfile
;
char
home
[
MAXPGPATH
]
;
char
*
home
;
struct
stat
stat_buf
;
#define LINELEN NAMEDATALEN*5
...
...
@@ -3111,8 +3111,11 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
if
(
port
==
NULL
)
port
=
DEF_PGPORT_STR
;
/* Look for it in the home dir */
if
(
!
get_home_path
(
home
))
/*
* Look for it in the home dir.
* We don't use get_home_path() so we don't pull path.c into our library.
*/
if
(
!
(
home
=
getenv
(
HOMEDIR
)))
return
NULL
;
pgpassfile
=
malloc
(
strlen
(
home
)
+
1
+
strlen
(
PGPASSFILE
)
+
1
);
...
...
@@ -3122,7 +3125,11 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
return
NULL
;
}
#ifndef WIN32
sprintf
(
pgpassfile
,
"%s/%s"
,
home
,
PGPASSFILE
);
#else
sprintf
(
pgpassfile
,
"%s
\\
%s"
,
home
,
PGPASSFILE
);
#endif
/* If password file cannot be opened, ignore it. */
if
(
stat
(
pgpassfile
,
&
stat_buf
)
==
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment