MCPcopy Create free account
hub / github.com/apache/cloudberry / SetDataDirectoryCreatePerm

Function SetDataDirectoryCreatePerm

src/common/file_perm.c:33–50  ·  view source on GitHub ↗

* Set create modes and mask to use when writing to PGDATA based on the data * directory mode passed. If group read/execute are present in the mode, then * create modes and mask will be relaxed to allow group read/execute on all * newly created files and directories. */

Source from the content-addressed store, hash-verified

31 * newly created files and directories.
32 */
33void
34SetDataDirectoryCreatePerm(int dataDirMode)
35{
36 /* If the data directory mode has group access */
37 if ((PG_DIR_MODE_GROUP & dataDirMode) == PG_DIR_MODE_GROUP)
38 {
39 pg_dir_create_mode = PG_DIR_MODE_GROUP;
40 pg_file_create_mode = PG_FILE_MODE_GROUP;
41 pg_mode_mask = PG_MODE_MASK_GROUP;
42 }
43 /* Else use default permissions */
44 else
45 {
46 pg_dir_create_mode = PG_DIR_MODE_OWNER;
47 pg_file_create_mode = PG_FILE_MODE_OWNER;
48 pg_mode_mask = PG_MODE_MASK_OWNER;
49 }
50}
51
52#ifdef FRONTEND
53

Callers 4

checkDataDirFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected