-
Notifications
You must be signed in to change notification settings - Fork 8
/
acl.h
53 lines (41 loc) · 1.02 KB
/
acl.h
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
#ifndef ACL_H
#define ACL_H
#include <stdint.h>
#include <stdlib.h>
/*
* Copied from acl_ea.h in libacl source; ACLs have to be sent to and from fuse
* in this format... at least on Linux.
*/
#define ACL_EA_ACCESS "system.posix_acl_access"
#define ACL_EA_DEFAULT "system.posix_acl_default"
#define ACL_EA_VERSION 0x0002
typedef struct {
uint16_t e_tag;
uint16_t e_perm;
uint32_t e_id;
} acl_ea_entry;
typedef struct {
u_int32_t a_version;
acl_ea_entry a_entries[0];
} acl_ea_header;
/*
* ext4 ACL structures, copied from fs/ext4/acl.h.
*/
#define EXT4_ACL_VERSION 0x0001
typedef struct {
uint16_t e_tag;
uint16_t e_perm;
uint32_t e_id;
} ext4_acl_entry;
typedef struct {
uint16_t e_tag;
uint16_t e_perm;
} ext4_acl_entry_short;
typedef struct {
uint32_t a_version;
} ext4_acl_header;
int fuse_to_ext4_acl(const acl_ea_header *facl, size_t facl_sz,
ext4_acl_header **eacl, size_t *eacl_sz);
int ext4_to_fuse_acl(acl_ea_header **facl, size_t *facl_sz,
const ext4_acl_header *eacl, size_t eacl_sz);
#endif