Skip to content

Commit 2b74022

Browse files
committed
Fix EXEC BACKEND + Windows builds for group privs
Under EXEC BACKEND we also need to be going through the group privileges setup since we do support that on Unixy systems, so add that to SubPostmasterMain(). Under Windows, we need to simply return true from GetDataDirectoryCreatePerm(), but that wasn't happening due to a missing #else clause. Per buildfarm.
1 parent c37b3d0 commit 2b74022

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4801,6 +4801,14 @@ SubPostmasterMain(int argc, char *argv[])
48014801
/* Read in remaining GUC variables */
48024802
read_nondefault_variables();
48034803

4804+
/*
4805+
* Check that the data directory looks valid, which will also check the
4806+
* privileges on the data directory and update our umask and file/group
4807+
* variables for creating files later. Note: this should really be done
4808+
* before we create any files or directories.
4809+
*/
4810+
checkDataDir();
4811+
48044812
/*
48054813
* (re-)read control file, as it contains config. The postmaster will
48064814
* already have read this, but this process doesn't know about that.

src/common/file_perm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ GetDataDirectoryCreatePerm(const char *dataDir)
7878

7979
/* Set permissions */
8080
SetDataDirectoryCreatePerm(statBuf.st_mode);
81-
8281
return true;
83-
#endif /* !defined(WIN32) && !defined(__CYGWIN__) */
82+
#else /* !defined(WIN32) && !defined(__CYGWIN__) */
83+
/*
84+
* On Windows, we don't have anything to do here since they don't have
85+
* Unix-y permissions.
86+
*/
87+
return true;
88+
#endif
8489
}
8590

8691

0 commit comments

Comments
 (0)