Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
file_perm.h57 linesDownload Raw Back to common
1/*-------------------------------------------------------------------------2 *3 * File and directory permission definitions4 *5 *6 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group7 * Portions Copyright (c) 1994, Regents of the University of California8 *9 * src/include/common/file_perm.h10 *11 *-------------------------------------------------------------------------12 */13#ifndef FILE_PERM_H14#define FILE_PERM_H15 16#include <sys/stat.h>17 18/*19 * Mode mask for data directory permissions that only allows the owner to20 * read/write directories and files.21 *22 * This is the default.23 */24#define PG_MODE_MASK_OWNER		    (S_IRWXG | S_IRWXO)25 26/*27 * Mode mask for data directory permissions that also allows group read/execute.28 */29#define PG_MODE_MASK_GROUP			(S_IWGRP | S_IRWXO)30 31/* Default mode for creating directories */32#define PG_DIR_MODE_OWNER			S_IRWXU33 34/* Mode for creating directories that allows group read/execute */35#define PG_DIR_MODE_GROUP			(S_IRWXU | S_IRGRP | S_IXGRP)36 37/* Default mode for creating files */38#define PG_FILE_MODE_OWNER		    (S_IRUSR | S_IWUSR)39 40/* Mode for creating files that allows group read */41#define PG_FILE_MODE_GROUP			(S_IRUSR | S_IWUSR | S_IRGRP)42 43/* Modes for creating directories and files in the data directory */44extern PGDLLIMPORT int pg_dir_create_mode;45extern PGDLLIMPORT int pg_file_create_mode;46 47/* Mode mask to pass to umask() */48extern PGDLLIMPORT int pg_mode_mask;49 50/* Set permissions and mask based on the provided mode */51extern void SetDataDirectoryCreatePerm(int dataDirMode);52 53/* Set permissions and mask based on the mode of the data directory */54extern bool GetDataDirectoryCreatePerm(const char *dataDir);55 56#endif							/* FILE_PERM_H */57 
codekingpro/portable-devtools · Team Ai