diff options
-rw-r--r-- | src/backend/postmaster/postmaster.c | 8 | ||||
-rw-r--r-- | src/common/file_perm.c | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index ccf63e93097..d948369f3ea 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -4802,6 +4802,14 @@ SubPostmasterMain(int argc, char *argv[]) read_nondefault_variables(); /* + * Check that the data directory looks valid, which will also check the + * privileges on the data directory and update our umask and file/group + * variables for creating files later. Note: this should really be done + * before we create any files or directories. + */ + checkDataDir(); + + /* * (re-)read control file, as it contains config. The postmaster will * already have read this, but this process doesn't know about that. */ diff --git a/src/common/file_perm.c b/src/common/file_perm.c index d640d6a1fdd..f2c8f846093 100644 --- a/src/common/file_perm.c +++ b/src/common/file_perm.c @@ -78,9 +78,14 @@ GetDataDirectoryCreatePerm(const char *dataDir) /* Set permissions */ SetDataDirectoryCreatePerm(statBuf.st_mode); - return true; -#endif /* !defined(WIN32) && !defined(__CYGWIN__) */ +#else /* !defined(WIN32) && !defined(__CYGWIN__) */ + /* + * On Windows, we don't have anything to do here since they don't have + * Unix-y permissions. + */ + return true; +#endif } |