PostgreSQL Source Code  git master
file_perm.h File Reference
#include <sys/stat.h>
Include dependency graph for file_perm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PG_MODE_MASK_OWNER   (S_IRWXG | S_IRWXO)
 
#define PG_MODE_MASK_GROUP   (S_IWGRP | S_IRWXO)
 
#define PG_DIR_MODE_OWNER   S_IRWXU
 
#define PG_DIR_MODE_GROUP   (S_IRWXU | S_IRGRP | S_IXGRP)
 
#define PG_FILE_MODE_OWNER   (S_IRUSR | S_IWUSR)
 
#define PG_FILE_MODE_GROUP   (S_IRUSR | S_IWUSR | S_IRGRP)
 

Functions

void SetDataDirectoryCreatePerm (int dataDirMode)
 
bool GetDataDirectoryCreatePerm (const char *dataDir)
 

Variables

int pg_dir_create_mode
 
int pg_file_create_mode
 
int pg_mode_mask
 

Macro Definition Documentation

◆ PG_DIR_MODE_GROUP

#define PG_DIR_MODE_GROUP   (S_IRWXU | S_IRGRP | S_IXGRP)

Definition at line 35 of file file_perm.h.

Referenced by main(), SetDataDirectoryCreatePerm(), and setup_config().

◆ PG_DIR_MODE_OWNER

#define PG_DIR_MODE_OWNER   S_IRWXU

Definition at line 32 of file file_perm.h.

Referenced by SetDataDirectoryCreatePerm().

◆ PG_FILE_MODE_GROUP

#define PG_FILE_MODE_GROUP   (S_IRUSR | S_IWUSR | S_IRGRP)

Definition at line 41 of file file_perm.h.

Referenced by SetDataDirectoryCreatePerm().

◆ PG_FILE_MODE_OWNER

#define PG_FILE_MODE_OWNER   (S_IRUSR | S_IWUSR)

Definition at line 38 of file file_perm.h.

Referenced by dsm_impl_op(), and SetDataDirectoryCreatePerm().

◆ PG_MODE_MASK_GROUP

#define PG_MODE_MASK_GROUP   (S_IWGRP | S_IRWXO)

Definition at line 29 of file file_perm.h.

Referenced by checkDataDir(), and SetDataDirectoryCreatePerm().

◆ PG_MODE_MASK_OWNER

#define PG_MODE_MASK_OWNER   (S_IRWXG | S_IRWXO)

Definition at line 24 of file file_perm.h.

Referenced by main(), PostmasterMain(), and SetDataDirectoryCreatePerm().

Function Documentation

◆ GetDataDirectoryCreatePerm()

bool GetDataDirectoryCreatePerm ( const char *  dataDir)

Referenced by main(), and SetDataDirectoryCreatePerm().

◆ 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

int pg_mode_mask