1*6a54128fSAndroid Build Coastguard Worker /* 2*6a54128fSAndroid Build Coastguard Worker * Ext4's on-disk acl format. From linux/fs/ext4/acl.h 3*6a54128fSAndroid Build Coastguard Worker */ 4*6a54128fSAndroid Build Coastguard Worker 5*6a54128fSAndroid Build Coastguard Worker #define EXT4_ACL_VERSION 0x0001 6*6a54128fSAndroid Build Coastguard Worker 7*6a54128fSAndroid Build Coastguard Worker /* 23.2.5 acl_tag_t values */ 8*6a54128fSAndroid Build Coastguard Worker 9*6a54128fSAndroid Build Coastguard Worker #define ACL_UNDEFINED_TAG (0x00) 10*6a54128fSAndroid Build Coastguard Worker #define ACL_USER_OBJ (0x01) 11*6a54128fSAndroid Build Coastguard Worker #define ACL_USER (0x02) 12*6a54128fSAndroid Build Coastguard Worker #define ACL_GROUP_OBJ (0x04) 13*6a54128fSAndroid Build Coastguard Worker #define ACL_GROUP (0x08) 14*6a54128fSAndroid Build Coastguard Worker #define ACL_MASK (0x10) 15*6a54128fSAndroid Build Coastguard Worker #define ACL_OTHER (0x20) 16*6a54128fSAndroid Build Coastguard Worker 17*6a54128fSAndroid Build Coastguard Worker /* 23.3.6 acl_type_t values */ 18*6a54128fSAndroid Build Coastguard Worker 19*6a54128fSAndroid Build Coastguard Worker #define ACL_TYPE_ACCESS (0x8000) 20*6a54128fSAndroid Build Coastguard Worker #define ACL_TYPE_DEFAULT (0x4000) 21*6a54128fSAndroid Build Coastguard Worker 22*6a54128fSAndroid Build Coastguard Worker /* 23.2.7 ACL qualifier constants */ 23*6a54128fSAndroid Build Coastguard Worker 24*6a54128fSAndroid Build Coastguard Worker #define ACL_UNDEFINED_ID ((id_t)-1) 25*6a54128fSAndroid Build Coastguard Worker 26*6a54128fSAndroid Build Coastguard Worker typedef struct { 27*6a54128fSAndroid Build Coastguard Worker __le16 e_tag; 28*6a54128fSAndroid Build Coastguard Worker __le16 e_perm; 29*6a54128fSAndroid Build Coastguard Worker __le32 e_id; 30*6a54128fSAndroid Build Coastguard Worker } ext4_acl_entry; 31*6a54128fSAndroid Build Coastguard Worker 32*6a54128fSAndroid Build Coastguard Worker typedef struct { 33*6a54128fSAndroid Build Coastguard Worker __le16 e_tag; 34*6a54128fSAndroid Build Coastguard Worker __le16 e_perm; 35*6a54128fSAndroid Build Coastguard Worker } ext4_acl_entry_short; 36*6a54128fSAndroid Build Coastguard Worker 37*6a54128fSAndroid Build Coastguard Worker typedef struct { 38*6a54128fSAndroid Build Coastguard Worker __le32 a_version; 39*6a54128fSAndroid Build Coastguard Worker } ext4_acl_header; 40*6a54128fSAndroid Build Coastguard Worker 41*6a54128fSAndroid Build Coastguard Worker 42*6a54128fSAndroid Build Coastguard Worker /* Supported ACL a_version fields */ 43*6a54128fSAndroid Build Coastguard Worker #define POSIX_ACL_XATTR_VERSION 0x0002 44*6a54128fSAndroid Build Coastguard Worker 45*6a54128fSAndroid Build Coastguard Worker typedef struct { 46*6a54128fSAndroid Build Coastguard Worker __le16 e_tag; 47*6a54128fSAndroid Build Coastguard Worker __le16 e_perm; 48*6a54128fSAndroid Build Coastguard Worker __le32 e_id; 49*6a54128fSAndroid Build Coastguard Worker } posix_acl_xattr_entry; 50*6a54128fSAndroid Build Coastguard Worker 51*6a54128fSAndroid Build Coastguard Worker typedef struct { 52*6a54128fSAndroid Build Coastguard Worker __le32 a_version; 53*6a54128fSAndroid Build Coastguard Worker #if __GNUC_PREREQ (4, 8) 54*6a54128fSAndroid Build Coastguard Worker #pragma GCC diagnostic push 55*6a54128fSAndroid Build Coastguard Worker #pragma GCC diagnostic ignored "-Wpedantic" 56*6a54128fSAndroid Build Coastguard Worker #endif 57*6a54128fSAndroid Build Coastguard Worker posix_acl_xattr_entry a_entries[0]; 58*6a54128fSAndroid Build Coastguard Worker #if __GNUC_PREREQ (4, 8) 59*6a54128fSAndroid Build Coastguard Worker #pragma GCC diagnostic pop 60*6a54128fSAndroid Build Coastguard Worker #endif 61*6a54128fSAndroid Build Coastguard Worker } posix_acl_xattr_header; 62*6a54128fSAndroid Build Coastguard Worker 63