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
c93872d8
Commit
c93872d8
authored
Oct 06, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pg_hba.conf 'local' line for Win32 because it doesn't support unix domain
connections. Andrew Dunstan
parent
513e89b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
src/backend/libpq/pg_hba.conf.sample
src/backend/libpq/pg_hba.conf.sample
+4
-3
src/bin/initdb/initdb.c
src/bin/initdb/initdb.c
+38
-1
No files found.
src/backend/libpq/pg_hba.conf.sample
View file @
c93872d8
...
...
@@ -60,8 +60,9 @@
# TYPE DATABASE USER CIDR-ADDRESS METHOD
local all all @authmethod@
# IPv4-style local connections:
@remove-line-for-win32@# "local" is for Unix domain socket connections only
@remove-line-for-win32@local all all @authmethod@
# IPv4 local connections:
host all all 127.0.0.1/32 @authmethod@
# IPv6
-style
local connections:
# IPv6 local connections:
host all all ::1/128 @authmethod@
src/bin/initdb/initdb.c
View file @
c93872d8
...
...
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.5
4 2004/09/02 17:58:41 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.5
5 2004/10/06 09:01:18 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -147,6 +147,9 @@ char backend_exec[MAXPGPATH];
static
void
*
xmalloc
(
size_t
size
);
static
char
*
xstrdup
(
const
char
*
s
);
static
char
**
replace_token
(
char
**
lines
,
char
*
token
,
char
*
replacement
);
#ifdef WIN32
static
char
**
filter_lines_with_token
(
char
**
lines
,
char
*
token
);
#endif
static
char
**
readfile
(
char
*
path
);
static
void
writefile
(
char
*
path
,
char
**
lines
);
static
int
mkdir_p
(
char
*
path
,
mode_t
omode
);
...
...
@@ -310,6 +313,34 @@ replace_token(char **lines, char *token, char *replacement)
}
/*
* make a copy of lines without any that contain the token
* a sort of poor man's grep -v
*
*/
#ifdef WIN32
static
char
**
filter_lines_with_token
(
char
**
lines
,
char
*
token
)
{
int
numlines
=
1
;
int
i
,
src
,
dst
;
char
**
result
;
for
(
i
=
0
;
lines
[
i
];
i
++
)
numlines
++
;
result
=
(
char
**
)
xmalloc
(
numlines
*
sizeof
(
char
*
));
for
(
src
=
0
,
dst
=
0
;
src
<
numlines
;
src
++
)
{
if
(
lines
[
src
]
==
NULL
||
strstr
(
lines
[
src
],
token
)
==
NULL
)
result
[
dst
++
]
=
lines
[
src
];
}
return
result
;
}
#endif
/*
* get the lines from a text file
*/
...
...
@@ -1093,6 +1124,12 @@ setup_config(void)
conflines
=
readfile
(
hba_file
);
#ifdef WIN32
conflines
=
filter_lines_with_token
(
conflines
,
"@remove-line-for-win32@"
);
#else
conflines
=
replace_token
(
conflines
,
"@remove-line-for-win32@"
,
""
);
#endif
#ifndef HAVE_IPV6
conflines
=
replace_token
(
conflines
,
"host all all ::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