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

PGDLLIMPORT int pg_dir_create_mode
 
PGDLLIMPORT int pg_file_create_mode
 
PGDLLIMPORT 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.

◆ PG_DIR_MODE_OWNER

#define PG_DIR_MODE_OWNER   S_IRWXU

Definition at line 32 of file file_perm.h.

◆ PG_FILE_MODE_GROUP

#define PG_FILE_MODE_GROUP   (S_IRUSR | S_IWUSR | S_IRGRP)

Definition at line 41 of file file_perm.h.

◆ PG_FILE_MODE_OWNER

#define PG_FILE_MODE_OWNER   (S_IRUSR | S_IWUSR)

Definition at line 38 of file file_perm.h.

◆ PG_MODE_MASK_GROUP

#define PG_MODE_MASK_GROUP   (S_IWGRP | S_IRWXO)

Definition at line 29 of file file_perm.h.

◆ PG_MODE_MASK_OWNER

#define PG_MODE_MASK_OWNER   (S_IRWXG | S_IRWXO)

Definition at line 24 of file file_perm.h.

Function Documentation

◆ GetDataDirectoryCreatePerm()

bool GetDataDirectoryCreatePerm ( const char *  dataDir)

Referenced by main().

◆ SetDataDirectoryCreatePerm()

void SetDataDirectoryCreatePerm ( int  dataDirMode)

Definition at line 34 of file file_perm.c.

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
int pg_mode_mask
Definition: file_perm.c:25
int pg_dir_create_mode
Definition: file_perm.c:18
#define PG_FILE_MODE_GROUP
Definition: file_perm.h:41
#define PG_FILE_MODE_OWNER
Definition: file_perm.h:38
#define PG_MODE_MASK_OWNER
Definition: file_perm.h:24
#define PG_DIR_MODE_OWNER
Definition: file_perm.h:32
#define PG_DIR_MODE_GROUP
Definition: file_perm.h:35
#define PG_MODE_MASK_GROUP
Definition: file_perm.h:29

References 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, and PG_MODE_MASK_OWNER.

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

Variable Documentation

◆ pg_dir_create_mode

◆ pg_file_create_mode

◆ pg_mode_mask

PGDLLIMPORT int pg_mode_mask
extern