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
f487e3da
Commit
f487e3da
authored
Aug 06, 2001
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that the data directory does not have group or world access; remove
a similar check on postgresql.conf.
parent
46e25214
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
22 deletions
+18
-22
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+17
-1
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc-file.l
+1
-21
No files found.
src/backend/utils/init/miscinit.c
View file @
f487e3da
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.7
3 2001/07/03 16:49:48 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.7
4 2001/08/06 13:45:15 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -120,6 +120,7 @@ void
SetDataDir
(
const
char
*
dir
)
{
char
*
new
;
struct
stat
stat_buf
;
AssertArg
(
dir
);
...
...
@@ -162,6 +163,21 @@ SetDataDir(const char *dir)
if
(
!
new
)
elog
(
FATAL
,
"out of memory"
);
}
/*
* Check if the directory has group or world access. If so, reject.
*/
if
(
stat
(
new
,
&
stat_buf
)
==
-
1
)
{
free
(
new
);
elog
(
FATAL
,
"could not read permissions of directory %s: %s"
,
new
,
strerror
(
errno
));
}
if
(
stat_buf
.
st_mode
&
(
S_IRWXG
|
S_IRWXO
))
{
free
(
new
);
elog
(
FATAL
,
"data directory %s has group or world access; permissions should be u=rwx (0700)"
,
new
);
}
if
(
DataDir
)
free
(
DataDir
);
...
...
src/backend/utils/misc/guc-file.l
View file @
f487e3da
...
...
@@ -4,7 +4,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.
8 2001/06/07 04:50:57 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.
9 2001/08/06 13:45:15 petere
Exp $
*/
%{
...
...
@@ -130,7 +130,6 @@ ProcessConfigFile(GucContext context)
int token, parse_state;
char *opt_name, *opt_value;
char *filename;
struct stat stat_buf;
struct name_value_pair *item, *head, *tail;
int elevel;
FILE * fp;
...
...
@@ -161,25 +160,6 @@ ProcessConfigFile(GucContext context)
return;
}
/*
* Check if the file is group or world writeable. If so, reject.
*/
if (fstat(fileno(fp), &stat_buf) == -1)
{
FreeFile(fp);
free(filename);
elog(elevel, "could not stat configuration file `" CONFIG_FILENAME "': %s", strerror(errno));
return;
}
if (stat_buf.st_mode & (S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH))
{
FreeFile(fp);
free(filename);
elog(elevel, "configuration file `" CONFIG_FILENAME "' has wrong permissions");
return;
}
/*
* Parse
*/
...
...
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