mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Check that the data directory does not have group or world access; remove
a similar check on postgresql.conf.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user