2 * Header file for getcifsacl and setcifsacl utilities
4 * Copyright (C) Shirish Pargaonkar (shirishp@us.ibm.com) 2011
6 * Has various access rights, security descriptor fields defines
7 * and data structures related to security descriptor, DACL, ACE,
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #define ATTRNAME "system.cifs_acl"
29 #define MAX_NUM_AUTHS 6
31 /* File specific rights */
32 #define READ_DATA 0x00000001 /* R */
33 #define WRITE_DATA 0x00000002 /* W */
34 #define APPEND_DATA 0x00000004 /* A */
35 #define READ_EA 0x00000008 /* REA */
36 #define WRITE_EA 0x00000010 /* WEA */
37 #define EXEC 0x00000020 /* E */
38 #define DELDHLD 0x00000040 /* DC */
39 #define READ_ATTR 0x00000080 /* RA */
40 #define WRITE_ATTR 0x00000100 /* WA */
43 #define DELETE 0x00010000 /* D */
44 #define READ_CONTROL 0x00020000 /* RC */
45 #define WRITE_DAC 0x00040000 /* P */
46 #define WRITE_OWNER 0x00080000 /* O */
47 #define SYNC 0x00100000 /* S */
50 #define SYSSEC 0x01000000
51 #define MAX 0x02000000
52 #define ALL 0x10000000
53 #define EXECUTE 0x20000000 /* GE */
54 #define WRITE 0x40000000 /* GW */
55 #define READ 0x80000000 /* GR */
57 /* D | RC | P | O | S | R | W | A | E | DC | REA | WEA | RA | WA */
58 #define FULL_CONTROL 0x001f01ff
60 /* RC | S | R | E | REA | RA */
61 #define EREAD 0x001200a9
63 /* RC | S | R | E | REA | GR | GE */
64 #define OREAD 0xa01200a1
66 /* RC | S | R | REA | RA */
67 #define BREAD 0x00120089
69 /* W | A | WA | WEA| */
70 #define EWRITE 0x00000116
72 /* D | RC | S | R | W | A | E |REA | WEA | RA | WA */
73 #define CHANGE 0x001301bf
75 /* GR | RC | REA | RA | REA | R */
76 #define ALL_READ_BITS 0x80020089
78 /* WA | WEA | A | W */
79 #define ALL_WRITE_BITS 0x40000116
81 #define OBJECT_INHERIT_FLAG 0x01 /* OI */
82 #define CONTAINER_INHERIT_FLAG 0x02 /* CI */
83 #define NO_PROPAGATE_INHERIT_FLAG 0x04 /* NP */
84 #define INHERIT_ONLY_FLAG 0x08 /* IO */
85 #define INHERITED_ACE_FLAG 0x10 /* I */
86 #define VFLAGS (OBJECT_INHERIT_FLAG|CONTAINER_INHERIT_FLAG|NO_PROPAGATE_INHERIT_FLAG|INHERIT_ONLY_FLAG|INHERITED_ACE_FLAG)
88 #define ACCESS_ALLOWED 0 /* ALLOWED */
89 #define ACCESS_DENIED 1 /* DENIED */
90 #define ACCESS_ALLOWED_OBJECT 5 /* OBJECT_ALLOWED */
91 #define ACCESS_DENIED_OBJECT 6 /* OBJECT_DENIED */
97 #define COMPALL (COMPSID|COMPTYPE|COMPFLAG|COMPMASK)
99 #define NUM_AUTHS (6) /* number of authority fields */
100 #define SID_MAX_SUB_AUTHORITIES (15) /* max number of sub authority fields */
103 * While not indicated here, the structs below represent on-the-wire data
104 * structures. Any multi-byte values are expected to be little-endian!
106 * FIXME: should we change these to use endianness annotations?
109 uint16_t revision; /* revision level */
115 } __attribute__((packed));
118 uint8_t revision; /* revision level */
120 uint8_t authority[NUM_AUTHS];
121 uint32_t sub_auth[SID_MAX_SUB_AUTHORITIES];
122 } __attribute__((packed));
124 struct cifs_ctrl_acl {
125 uint16_t revision; /* revision level */
128 } __attribute__((packed));
135 struct cifs_sid sid; /* ie UUID of user or group who gets these perms */
136 } __attribute__((packed));
138 #endif /* CIFSACL_H */