/* [<][>][^][v][top][bottom][index][help] */
1 /*
2 Unix SMB/CIFS implementation.
3 Portable SMB ACL interface
4 Copyright (C) Jeremy Allison 2000
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _SMB_ACLS_H
21 #define _SMB_ACLS_H
22
23 typedef int SMB_ACL_TYPE_T;
24 typedef mode_t *SMB_ACL_PERMSET_T;
25 typedef mode_t SMB_ACL_PERM_T;
26 #define SMB_ACL_READ 4
27 #define SMB_ACL_WRITE 2
28 #define SMB_ACL_EXECUTE 1
29
30 /* Types of ACLs. */
31 enum smb_acl_tag_t {
32 SMB_ACL_TAG_INVALID=0,
33 SMB_ACL_USER=1,
34 SMB_ACL_USER_OBJ,
35 SMB_ACL_GROUP,
36 SMB_ACL_GROUP_OBJ,
37 SMB_ACL_OTHER,
38 SMB_ACL_MASK
39 };
40
41 typedef enum smb_acl_tag_t SMB_ACL_TAG_T;
42
43 struct smb_acl_entry {
44 enum smb_acl_tag_t a_type;
45 SMB_ACL_PERM_T a_perm;
46 uid_t uid;
47 gid_t gid;
48 };
49
50 typedef struct smb_acl_t {
51 int size;
52 int count;
53 int next;
54 struct smb_acl_entry acl[1];
55 } *SMB_ACL_T;
56
57 typedef struct smb_acl_entry *SMB_ACL_ENTRY_T;
58
59 #define SMB_ACL_FIRST_ENTRY 0
60 #define SMB_ACL_NEXT_ENTRY 1
61
62 #define SMB_ACL_TYPE_ACCESS 0
63 #define SMB_ACL_TYPE_DEFAULT 1
64
65 #endif /* _SMB_ACLS_H */