#ifndef _CONFIG_ACL_H
#define _CONFIG_ACL_H
#include "conf.h"
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _acl_conf ACLConfig;
typedef struct _acl_file {
ConfigParser parser;
UcxList *namedACLs;
UcxList *uriACLs;
UcxList *pathACLs;
ACLConfig *cur;
} ACLFile;
struct _acl_conf {
sstr_t id;
sstr_t type;
UcxList *authparam;
UcxList *entries;
};
typedef struct _ace_conf {
sstr_t who;
uint32_t access_mask;
uint16_t flags;
uint16_t type;
} ACEConfig;
#define ACLCFG_READ_DATA 0x0001
#define ACLCFG_WRITE_DATA 0x0002
#define ACLCFG_APPEND 0x0002
#define ACLCFG_ADD_FILE 0x0004
#define ACLCFG_ADD_SUBDIRECTORY 0x0004
#define ACLCFG_READ_XATTR 0x0008
#define ACLCFG_WRITE_XATTR 0x0010
#define ACLCFG_EXECUTE 0x0020
#define ACLCFG_DELETE_CHILD 0x0040
#define ACLCFG_DELETE 0x0040
#define ACLCFG_READ_ATTRIBUTES 0x0080
#define ACLCFG_WRITE_ATTRIBUTES 0x0100
#define ACLCFG_LIST 0x0200
#define ACLCFG_READ_ACL 0x0400
#define ACLCFG_WRITE_ACL 0x0800
#define ACLCFG_WRITE_OWNER 0x1000
#define ACLCFG_SYNCHRONIZE 0x2000
#define ACLCFG_READ \
(
ACLCFG_READ_DATA|
ACLCFG_READ_XATTR|
ACLCFG_READ_ATTRIBUTES)
#define ACLCFG_WRITE \
(
ACLCFG_WRITE_DATA|
ACLCFG_WRITE_XATTR|
ACLCFG_WRITE_ATTRIBUTES)
#define ACLCFG_FILE_INHERIT 0x0001
#define ACLCFG_DIR_INHERIT 0x0002
#define ACLCFG_NO_PROPAGATE 0x0004
#define ACLCFG_INHERIT_ONLY 0x0008
#define ACLCFG_SUCCESSFUL_ACCESS_FLAG 0x0010
#define ACLCFG_FAILED_ACCESS_ACE_FLAG 0x0020
#define ACLCFG_IDENTIFIER_GROUP 0x0040
#define ACLCFG_OWNER 0x1000
#define ACLCFG_GROUP 0x2000
#define ACLCFG_EVERYONE 0x4000
#define ACLCFG_TYPE_ALLOWED 0x01
#define ACLCFG_TYPE_DENIED 0x02
#define ACLCFG_TYPE_AUDIT 0x03
#define ACLCFG_TYPE_ALARM 0x04
ACLFile* load_acl_file(
char *file);
void free_acl_file(ACLFile *aclfile);
int acl_parse(
void *p, ConfigLine *begin, ConfigLine *end,
sstr_t line);
int parse_ace(ACLFile *f,
sstr_t line);
uint32_t accstr2int(
sstr_t access);
#ifdef __cplusplus
}
#endif
#endif