s3-security: use shared SECINFO_DACL define.
[samba.git] / source3 / include / rpc_secdes.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell              1992-2000
5    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
22 #define _RPC_SECDES_H 
23
24 /* for ADS */
25 #define SEC_RIGHTS_FULL_CTRL            0xf01ff
26
27 /* Extra W2K flags. */
28 #define UNPROTECTED_SACL_SECURITY_INFORMATION   0x10000000
29 #define UNPROTECTED_DACL_SECURITY_INFORMATION   0x20000000
30 #define PROTECTED_SACL_SECURITY_INFORMATION     0x40000000
31 #define PROTECTED_DACL_SECURITY_INFORMATION     0x80000000
32
33 #define ALL_SECURITY_INFORMATION (SECINFO_OWNER|SECINFO_GROUP|\
34                                         SECINFO_DACL|SECINFO_SACL|\
35                                         UNPROTECTED_SACL_SECURITY_INFORMATION|\
36                                         UNPROTECTED_DACL_SECURITY_INFORMATION|\
37                                         PROTECTED_SACL_SECURITY_INFORMATION|\
38                                         PROTECTED_DACL_SECURITY_INFORMATION)
39
40 /* A type to describe the mapping of generic access rights to object
41    specific access rights. */
42
43 struct generic_mapping {
44         uint32 generic_read;
45         uint32 generic_write;
46         uint32 generic_execute;
47         uint32 generic_all;
48 };
49
50 struct standard_mapping {
51         uint32 std_read;
52         uint32 std_write;
53         uint32 std_execute;
54         uint32 std_all;
55 };
56
57
58 /* Security Access Masks Rights */
59
60 #define SPECIFIC_RIGHTS_MASK    0x0000FFFF
61 #define STANDARD_RIGHTS_MASK    0x00FF0000
62 #define GENERIC_RIGHTS_MASK     0xF0000000
63
64 /* Generic access rights */
65
66 #define GENERIC_RIGHT_ALL_ACCESS        0x10000000
67 #define GENERIC_RIGHT_EXECUTE_ACCESS    0x20000000
68 #define GENERIC_RIGHT_WRITE_ACCESS      0x40000000
69 #define GENERIC_RIGHT_READ_ACCESS       0x80000000
70
71 /* Standard access rights. */
72
73 #define STD_RIGHT_DELETE_ACCESS         0x00010000
74 #define STD_RIGHT_READ_CONTROL_ACCESS   0x00020000
75 #define STD_RIGHT_WRITE_DAC_ACCESS      0x00040000
76 #define STD_RIGHT_WRITE_OWNER_ACCESS    0x00080000
77 #define STD_RIGHT_SYNCHRONIZE_ACCESS    0x00100000
78
79 #define STD_RIGHT_ALL_ACCESS            0x001F0000
80
81 /* File Object specific access rights */
82
83 #define SA_RIGHT_FILE_READ_DATA         0x00000001
84 #define SA_RIGHT_FILE_WRITE_DATA        0x00000002
85 #define SA_RIGHT_FILE_APPEND_DATA       0x00000004
86 #define SA_RIGHT_FILE_READ_EA           0x00000008
87 #define SA_RIGHT_FILE_WRITE_EA          0x00000010
88 #define SA_RIGHT_FILE_EXECUTE           0x00000020
89 #define SA_RIGHT_FILE_DELETE_CHILD      0x00000040
90 #define SA_RIGHT_FILE_READ_ATTRIBUTES   0x00000080
91 #define SA_RIGHT_FILE_WRITE_ATTRIBUTES  0x00000100
92
93 #define SA_RIGHT_FILE_ALL_ACCESS        0x000001FF
94
95 #define GENERIC_RIGHTS_FILE_ALL_ACCESS \
96                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
97                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
98                 SA_RIGHT_FILE_ALL_ACCESS)
99
100 #define GENERIC_RIGHTS_FILE_READ        \
101                 (STANDARD_RIGHTS_READ_ACCESS    | \
102                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
103                 SA_RIGHT_FILE_READ_DATA         | \
104                 SA_RIGHT_FILE_READ_ATTRIBUTES   | \
105                 SA_RIGHT_FILE_READ_EA)
106
107 #define GENERIC_RIGHTS_FILE_WRITE \
108                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
109                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
110                 SA_RIGHT_FILE_WRITE_DATA        | \
111                 SA_RIGHT_FILE_WRITE_ATTRIBUTES  | \
112                 SA_RIGHT_FILE_WRITE_EA          | \
113                 SA_RIGHT_FILE_APPEND_DATA)
114
115 #define GENERIC_RIGHTS_FILE_EXECUTE \
116                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
117                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
118                 SA_RIGHT_FILE_READ_ATTRIBUTES   | \
119                 SA_RIGHT_FILE_EXECUTE)            
120
121 #define GENERIC_RIGHTS_FILE_MODIFY \
122                 (STANDARD_RIGHTS_MODIFY_ACCESS  | \
123                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
124                 STD_RIGHT_DELETE_ACCESS         | \
125                 SA_RIGHT_FILE_WRITE_ATTRIBUTES  | \
126                 SA_RIGHT_FILE_READ_ATTRIBUTES   | \
127                 SA_RIGHT_FILE_EXECUTE           | \
128                 SA_RIGHT_FILE_WRITE_EA          | \
129                 SA_RIGHT_FILE_READ_EA           | \
130                 SA_RIGHT_FILE_APPEND_DATA       | \
131                 SA_RIGHT_FILE_WRITE_DATA        | \
132                 SA_RIGHT_FILE_READ_DATA)
133
134 #endif /* _RPC_SECDES_H */