PostgreSQL Source Code  git master
file_perm.c File Reference
#include "c.h"
#include "common/file_perm.h"
Include dependency graph for file_perm.c:

Go to the source code of this file.

Functions

void SetDataDirectoryCreatePerm (int dataDirMode)
 

Variables

int pg_dir_create_mode = PG_DIR_MODE_OWNER
 
int pg_file_create_mode = PG_FILE_MODE_OWNER
 
int pg_mode_mask = PG_MODE_MASK_OWNER
 

Function Documentation

◆ SetDataDirectoryCreatePerm()

void SetDataDirectoryCreatePerm ( int  dataDirMode)

Definition at line 34 of file file_perm.c.

References GetDataDirectoryCreatePerm(), pg_dir_create_mode, PG_DIR_MODE_GROUP, PG_DIR_MODE_OWNER, pg_file_create_mode, PG_FILE_MODE_GROUP, PG_FILE_MODE_OWNER, pg_mode_mask, PG_MODE_MASK_GROUP, PG_MODE_MASK_OWNER, SetDataDirectoryCreatePerm(), and stat.

Referenced by checkDataDir(), main(), RetrieveDataDirCreatePerm(), and SetDataDirectoryCreatePerm().

35 {
36  /* If the data directory mode has group access */
37  if ((PG_DIR_MODE_GROUP & dataDirMode) == PG_DIR_MODE_GROUP)
38  {
42  }
43  /* Else use default permissions */
44  else
45  {
49  }
50 }
int pg_file_create_mode
Definition: file_perm.c:19
#define PG_DIR_MODE_OWNER
Definition: file_perm.h:32
#define PG_FILE_MODE_GROUP
Definition: file_perm.h:41
#define PG_MODE_MASK_GROUP
Definition: file_perm.h:29
int pg_dir_create_mode
Definition: file_perm.c:18
#define PG_DIR_MODE_GROUP
Definition: file_perm.h:35
#define PG_MODE_MASK_OWNER
Definition: file_perm.h:24
#define PG_FILE_MODE_OWNER
Definition: file_perm.h:38
int pg_mode_mask
Definition: file_perm.c:25

Variable Documentation

◆ pg_dir_create_mode

◆ pg_file_create_mode

◆ pg_mode_mask