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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#![allow(non_camel_case_types)]
extern crate libc;
use libc::{c_void, c_uint, c_int, c_char, ssize_t};
pub type acl_t = *mut c_void;
pub type acl_permset_t = *mut c_void;
pub type acl_entry_t = *mut c_void;
pub type acl_type_t = c_uint;
pub type acl_tag_t = c_int;
pub type acl_perm_t = c_uint;
pub const ACL_TYPE_ACCESS: acl_type_t = 0x8000;
pub const ACL_TYPE_DEFAULT: acl_type_t = 0x4000;
pub const ACL_READ: acl_perm_t = 0x04;
pub const ACL_WRITE: acl_perm_t = 0x02;
pub const ACL_EXECUTE: acl_perm_t = 0x01;
pub const ACL_UNDEFINED_TAG: acl_tag_t = 0x00;
pub const ACL_USER_OBJ: acl_tag_t = 0x01;
pub const ACL_USER: acl_tag_t = 0x02;
pub const ACL_GROUP_OBJ: acl_tag_t = 0x04;
pub const ACL_GROUP: acl_tag_t = 0x08;
pub const ACL_MASK: acl_tag_t = 0x10;
pub const ACL_OTHER: acl_tag_t = 0x20;
#[link(name = "acl")]
extern "C" {
pub fn acl_init(count: c_int) -> acl_t;
pub fn acl_dup(acl: acl_t) -> acl_t;
pub fn acl_free(data: *mut c_void) -> c_int;
pub fn acl_valid(acl: acl_t) -> c_int;
pub fn acl_copy_entry(dest: acl_entry_t, src: acl_entry_t) -> c_int;
pub fn acl_create_entry(acl: *mut acl_t, entry: *mut acl_entry_t) -> c_int;
pub fn acl_delete_entry(acl: acl_t, entry: acl_entry_t) -> c_int;
pub fn acl_get_entry(acl: acl_t, entry_id: c_int, entry: *mut acl_entry_t) -> c_int;
pub fn acl_add_perm(permset: acl_permset_t, perm: acl_perm_t) -> c_int;
pub fn acl_calc_mask(acl: *mut acl_t) -> c_int;
pub fn acl_clear_perms(permset: acl_permset_t) -> c_int;
pub fn acl_delete_perms(permset: acl_permset_t, perm: acl_perm_t) -> c_int;
pub fn acl_get_permset(entry: acl_entry_t, permset: *mut acl_permset_t) -> c_int;
pub fn acl_set_permset(entry: acl_entry_t, permset: acl_permset_t) -> c_int;
pub fn acl_get_qualifier(entry: acl_entry_t) -> *mut c_void;
pub fn acl_get_tag_type(entry: acl_entry_t, tag_type: *const acl_tag_t) -> c_int;
pub fn acl_set_qualifier(entry: acl_entry_t, tag_qualifier: *const c_void) -> c_int;
pub fn acl_set_tag_type(entry: acl_entry_t, tag_type: acl_tag_t) -> c_int;
pub fn acl_copy_ext(buf: *mut c_void, acl: acl_t, size: ssize_t) -> ssize_t;
pub fn acl_copy_int(buf: *const c_void) -> acl_t;
pub fn acl_from_text(buf: *const c_char) -> acl_t;
pub fn acl_size(acl: acl_t) -> ssize_t;
pub fn acl_to_text(acl: acl_t, len: *mut ssize_t) -> *mut c_char;
pub fn acl_delete_def_file(path: *const c_char) -> c_int;
pub fn acl_get_fd(fd: c_int) -> acl_t;
pub fn acl_get_file(path: *const c_char, typ: acl_type_t) -> acl_t;
pub fn acl_set_fd(fd: c_int, acl: acl_t) -> c_int;
pub fn acl_set_file(path: *const c_char, typ: acl_type_t, acl: acl_t) -> c_int;
}