s3-security: use shared "Generic access rights".
[Samba/ekacnet.git] / source3 / include / rpc_secdes.h
blobf3efe27d7f381a0cc50067b6966055ff4ec79b8f
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
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.
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.
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/>.
21 #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
22 #define _RPC_SECDES_H
24 /* for ADS */
25 #define SEC_RIGHTS_FULL_CTRL 0xf01ff
27 /* A type to describe the mapping of generic access rights to object
28 specific access rights. */
30 struct generic_mapping {
31 uint32 generic_read;
32 uint32 generic_write;
33 uint32 generic_execute;
34 uint32 generic_all;
37 struct standard_mapping {
38 uint32 std_read;
39 uint32 std_write;
40 uint32 std_execute;
41 uint32 std_all;
44 /* Standard access rights. */
46 #define STD_RIGHT_DELETE_ACCESS 0x00010000
47 #define STD_RIGHT_READ_CONTROL_ACCESS 0x00020000
48 #define STD_RIGHT_WRITE_DAC_ACCESS 0x00040000
49 #define STD_RIGHT_WRITE_OWNER_ACCESS 0x00080000
50 #define STD_RIGHT_SYNCHRONIZE_ACCESS 0x00100000
52 #define STD_RIGHT_ALL_ACCESS 0x001F0000
54 /* File Object specific access rights */
56 #define SA_RIGHT_FILE_READ_DATA 0x00000001
57 #define SA_RIGHT_FILE_WRITE_DATA 0x00000002
58 #define SA_RIGHT_FILE_APPEND_DATA 0x00000004
59 #define SA_RIGHT_FILE_READ_EA 0x00000008
60 #define SA_RIGHT_FILE_WRITE_EA 0x00000010
61 #define SA_RIGHT_FILE_EXECUTE 0x00000020
62 #define SA_RIGHT_FILE_DELETE_CHILD 0x00000040
63 #define SA_RIGHT_FILE_READ_ATTRIBUTES 0x00000080
64 #define SA_RIGHT_FILE_WRITE_ATTRIBUTES 0x00000100
66 #define SA_RIGHT_FILE_ALL_ACCESS 0x000001FF
68 #define GENERIC_RIGHTS_FILE_ALL_ACCESS \
69 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
70 STD_RIGHT_SYNCHRONIZE_ACCESS | \
71 SA_RIGHT_FILE_ALL_ACCESS)
73 #define GENERIC_RIGHTS_FILE_READ \
74 (STANDARD_RIGHTS_READ_ACCESS | \
75 STD_RIGHT_SYNCHRONIZE_ACCESS | \
76 SA_RIGHT_FILE_READ_DATA | \
77 SA_RIGHT_FILE_READ_ATTRIBUTES | \
78 SA_RIGHT_FILE_READ_EA)
80 #define GENERIC_RIGHTS_FILE_WRITE \
81 (STANDARD_RIGHTS_WRITE_ACCESS | \
82 STD_RIGHT_SYNCHRONIZE_ACCESS | \
83 SA_RIGHT_FILE_WRITE_DATA | \
84 SA_RIGHT_FILE_WRITE_ATTRIBUTES | \
85 SA_RIGHT_FILE_WRITE_EA | \
86 SA_RIGHT_FILE_APPEND_DATA)
88 #define GENERIC_RIGHTS_FILE_EXECUTE \
89 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
90 STD_RIGHT_SYNCHRONIZE_ACCESS | \
91 SA_RIGHT_FILE_READ_ATTRIBUTES | \
92 SA_RIGHT_FILE_EXECUTE)
94 #define GENERIC_RIGHTS_FILE_MODIFY \
95 (STANDARD_RIGHTS_MODIFY_ACCESS | \
96 STD_RIGHT_SYNCHRONIZE_ACCESS | \
97 STD_RIGHT_DELETE_ACCESS | \
98 SA_RIGHT_FILE_WRITE_ATTRIBUTES | \
99 SA_RIGHT_FILE_READ_ATTRIBUTES | \
100 SA_RIGHT_FILE_EXECUTE | \
101 SA_RIGHT_FILE_WRITE_EA | \
102 SA_RIGHT_FILE_READ_EA | \
103 SA_RIGHT_FILE_APPEND_DATA | \
104 SA_RIGHT_FILE_WRITE_DATA | \
105 SA_RIGHT_FILE_READ_DATA)
107 #endif /* _RPC_SECDES_H */