s3:privileges Change SE_PRIV to be just a uint64_t
[samba.git] / source3 / include / 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    
11    This program is free software; you can redistribute it and/or modify
12    it under the terms of the GNU General Public License as published by
13    the Free Software Foundation; either version 3 of the License, or
14    (at your option) any later version.
15    
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19    GNU General Public License for more details.
20    
21    You should have received a copy of the GNU General Public License
22    along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 */
24
25 #ifndef PRIVILEGES_H
26 #define PRIVILEGES_H
27
28 #include "../librpc/gen_ndr/lsa.h"
29
30 /* privilege bitmask */
31
32 typedef uint64_t SE_PRIV;
33
34 /* common privilege defines */
35
36 #define SE_END                          0x0
37 #define SE_NONE                         0x0
38 #define SE_ALL_PRIVS                    (SE_PRIV)-1
39
40
41 /* 
42  * We will use our own set of privileges since it makes no sense
43  * to implement all of the Windows set when only a portion will
44  * be used.  Use 64-bit mask to give room to grow.
45  */
46
47 #define SE_NETWORK_LOGON                0x00000001
48 #define SE_INTERACTIVE_LOGON            0x00000002
49 #define SE_BATCH_LOGON                  0x00000004
50 #define SE_SERVICE_LOGON                0x00000008
51 #define SE_MACHINE_ACCOUNT              0x00000010
52 #define SE_PRINT_OPERATOR               0x00000020
53 #define SE_ADD_USERS                    0x00000040
54 #define SE_DISK_OPERATOR                0x00000080
55 #define SE_REMOTE_SHUTDOWN              0x00000100
56 #define SE_BACKUP                       0x00000200
57 #define SE_RESTORE                      0x00000400
58 #define SE_TAKE_OWNERSHIP               0x00000800
59
60 /* defined in lib/privilegs_basic.c */
61
62 extern const SE_PRIV se_priv_all;
63
64 extern const SE_PRIV se_priv_none;
65 extern const SE_PRIV se_machine_account;
66 extern const SE_PRIV se_print_operator;
67 extern const SE_PRIV se_add_users;
68 extern const SE_PRIV se_disk_operators;
69 extern const SE_PRIV se_remote_shutdown;
70 extern const SE_PRIV se_restore;
71 extern const SE_PRIV se_take_ownership;
72
73
74 /*
75  * These are used in Lsa replies (srv_lsa_nt.c)
76  */
77
78 typedef struct {
79         TALLOC_CTX *mem_ctx;
80         bool ext_ctx;
81         uint32 count;
82         uint32 control;
83         struct lsa_LUIDAttribute *set;
84 } PRIVILEGE_SET;
85
86 typedef struct {
87         SE_PRIV se_priv;
88         const char *name;
89         const char *description;
90         struct lsa_LUID luid;
91 } PRIVS;
92
93 #endif /* PRIVILEGES_H */