s3-privs Move source3/ privileges implmentation into common
[abartlet/samba.git/.git] / libcli / security / privileges.h
1
2 /*
3    Unix SMB/CIFS implementation.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    Copyright (C) Paul Ashton 1997
8    Copyright (C) Simo Sorce 2003
9    Copyright (C) Gerald (Jerry) Carter 2005
10    Copyright (C) Andrew Bartlett 2010
11
12    This program is free software; you can redistribute it and/or modify
13    it under the terms of the GNU General Public License as published by
14    the Free Software Foundation; either version 3 of the License, or
15    (at your option) any later version.
16
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License for more details.
21
22    You should have received a copy of the GNU General Public License
23    along with this program.  If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #ifndef PRIVILEGES_H
27 #define PRIVILEGES_H
28
29 #include "../librpc/gen_ndr/lsa.h"
30 #include "../librpc/gen_ndr/security.h"
31
32 /* privilege bitmask */
33
34 /* common privilege defines */
35
36 #define SE_END                          0x0
37 #define SE_NONE                         0x0
38 #define SE_ALL_PRIVS                    (uint64_t)-1
39
40
41 /* defined in lib/privilegs_basic.c */
42
43 extern const uint64_t se_priv_all;
44
45 extern const uint64_t se_priv_none;
46 extern const uint64_t se_machine_account;
47 extern const uint64_t se_print_operator;
48 extern const uint64_t se_add_users;
49 extern const uint64_t se_disk_operators;
50 extern const uint64_t se_remote_shutdown;
51 extern const uint64_t se_restore;
52 extern const uint64_t se_take_ownership;
53
54
55 /*
56  * These are used in Lsa replies (srv_lsa_nt.c)
57  */
58
59 typedef struct {
60         TALLOC_CTX *mem_ctx;
61         bool ext_ctx;
62         uint32 count;
63         uint32 control;
64         struct lsa_LUIDAttribute *set;
65 } PRIVILEGE_SET;
66
67 typedef struct {
68         uint64_t privilege_mask;
69         const char *name;
70         const char *description;
71         enum sec_privilege luid;
72 } PRIVS;
73
74 #endif /* PRIVILEGES_H */