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
18627c55
Commit
18627c55
authored
May 17, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the .pgpass hostname to match the default socket directory, as
well as a blank pghost.
parent
71233492
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
doc/src/sgml/libpq.sgml
doc/src/sgml/libpq.sgml
+4
-4
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+16
-1
No files found.
doc/src/sgml/libpq.sgml
View file @
18627c55
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.20
8 2006/05/06 16:25:11
momjian Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.20
9 2006/05/17 21:50:54
momjian Exp $ -->
<chapter id="libpq">
<chapter id="libpq">
<title><application>libpq</application> - C Library</title>
<title><application>libpq</application> - C Library</title>
...
@@ -4000,9 +4000,9 @@ current connection parameters will be used. (Therefore, put more-specific
...
@@ -4000,9 +4000,9 @@ current connection parameters will be used. (Therefore, put more-specific
entries first when you are using wildcards.)
entries first when you are using wildcards.)
If an entry needs to contain <literal>:</literal> or
If an entry needs to contain <literal>:</literal> or
<literal>\</literal>, escape this character with <literal>\</literal>.
<literal>\</literal>, escape this character with <literal>\</literal>.
A hostname of <literal>localhost</> matches both
<literal>host</> (TCP
)
A hostname of <literal>localhost</> matches both
TCP <literal>host</> (hostname <literal>localhost</>
)
and
<literal>local</> (Unix domain socket) connections coming from the
and
Unix domain socket <literal>local</> (<literal>pghost</> empty or the default socket directory)
local machine.
connections coming from the
local machine.
</para>
</para>
<para>
<para>
...
...
src/interfaces/libpq/fe-connect.c
View file @
18627c55
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.32
8 2006/03/14 22:48:23 tgl
Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.32
9 2006/05/17 21:50:54 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -3106,8 +3106,23 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
...
@@ -3106,8 +3106,23 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
if
(
username
==
NULL
||
strlen
(
username
)
==
0
)
if
(
username
==
NULL
||
strlen
(
username
)
==
0
)
return
NULL
;
return
NULL
;
/* 'localhost' matches pghost of '' or the default socket directory */
if
(
hostname
==
NULL
)
if
(
hostname
==
NULL
)
hostname
=
DefaultHost
;
hostname
=
DefaultHost
;
else
if
(
is_absolute_path
(
hostname
))
{
char
canon_host
[
MAXPGPATH
];
char
canon_def_socket
[
MAXPGPATH
];
StrNCpy
(
canon_host
,
hostname
,
MAXPGPATH
);
StrNCpy
(
canon_def_socket
,
DEFAULT_PGSOCKET_DIR
,
MAXPGPATH
);
canonicalize_path
(
canon_host
);
canonicalize_path
(
canon_def_socket
);
if
(
strcmp
(
canon_host
,
canon_def_socket
)
==
0
)
hostname
=
DefaultHost
;
}
if
(
port
==
NULL
)
if
(
port
==
NULL
)
port
=
DEF_PGPORT_STR
;
port
=
DEF_PGPORT_STR
;
...
...
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