summaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/ext4_acl.h
blob: 8d4d97450c521f09e506989902d64c8ffc138d3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Ext4's on-disk acl format.  From linux/fs/ext4/acl.h
 */

#define EXT4_ACL_VERSION        0x0001

/* 23.2.5 acl_tag_t values */

#define ACL_UNDEFINED_TAG	(0x00)
#define ACL_USER_OBJ		(0x01)
#define ACL_USER		(0x02)
#define ACL_GROUP_OBJ		(0x04)
#define ACL_GROUP		(0x08)
#define ACL_MASK		(0x10)
#define ACL_OTHER		(0x20)

/* 23.3.6 acl_type_t values */

#define ACL_TYPE_ACCESS		(0x8000)
#define ACL_TYPE_DEFAULT	(0x4000)

/* 23.2.7 ACL qualifier constants */

#define ACL_UNDEFINED_ID	((id_t)-1)

typedef struct {
        __le16          e_tag;
        __le16          e_perm;
        __le32          e_id;
 } ext4_acl_entry;
 
typedef struct {
        __le16          e_tag;
        __le16          e_perm;
} ext4_acl_entry_short;

typedef struct {
         __le32          a_version;
} ext4_acl_header;


/* Supported ACL a_version fields */
 #define POSIX_ACL_XATTR_VERSION 0x0002

typedef struct {
        __le16                  e_tag;
        __le16                  e_perm;
        __le32                  e_id;
} posix_acl_xattr_entry;

typedef struct {
        __le32                  a_version;
#if __GNUC_PREREQ (4, 8)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
        posix_acl_xattr_entry   a_entries[0];
#if __GNUC_PREREQ (4, 8)
#pragma GCC diagnostic pop
#endif
} posix_acl_xattr_header;