#ifndef __PCLT_H_ #define __PCLT_H_ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if ENABLE_REGEX # include #endif #include "ft.h" #define PCL_SET(m, t) ((m) |= (t)) #define PCL_UNSET(m, t) ((m) &= !(t)) #define PCL_ISSET(m, t) ((m) & (t)) /* PCLEUID */ typedef struct { uid_t pcl_luid; uid_t pcl_ruid; #define PCLEUID_S 1 #define PCLEUID_L 2 #define PCLEUID_R 3 #define PCLEUID_LR 4 uint8_t pcl_type; } PCLEUID; /* PCLEGID */ typedef struct { int pcl_lgid; int pcl_rgid; #define PCLEGID_S 1 #define PCLEGID_L 2 #define PCLEGID_R 3 #define PCLEGID_LR 4 uint8_t pcl_type; } PCLEGID; /* PCLENT */ typedef struct { char **pcl_name; uint16_t pcl_namesize; #if ENABLE_REGEX char **pcl_pattern; regex_t *pcl_ename; uint16_t pcl_enamesize; #endif PCLEGID *pcl_egid; uint16_t pcl_egidsize; PCLEUID *pcl_euid; uint16_t pcl_euidsize; #define PCL_TF 0x01 #define PCL_TC 0x02 #define PCL_TD 0x04 #define PCL_TB 0x08 #define PCL_TR 0x10 #define PCL_TL 0x20 #define PCL_TS 0x40 uint8_t pcl_type; #define PCL_MMATCH 0x01 #define PCL_MSTOP 0x02 #define PCL_MINH 0x04 uint8_t pcl_marks; /* for programmers using */ uint16_t pcl_opt; } PCLENT; PCLENT * pclent_init(); void pclent_close(); void pclent_clear(); PCLENT * pclent_addname(); PCLENT * pclent_addename(); PCLENT * pclent_addegid(); PCLENT * pclent_addeuid(); void pclent_addtype(); void pclent_settype(); /* PCL */ typedef struct { PCLENT *pcl_entries; uint8_t pcl_size; #define PCL_INO 0x01 #define PCL_IPRE 0x02 #define PCL_IPOST 0x03 uint8_t pcl_inh; } PCL; PCL * pcl_init(); void pcl_close(); void pcl_clear(); PCL * pcl_add(); const PCLENT * pcl_match(); /* PCLT */ typedef FT PCLT; PCLT * pclt_init(); void pclt_close(); PCL * pclt_add(); int pclt_merge(); PCL * pclt_get(); #endif /* __PCLT_H_ */