r4805: Last planned change to the privileges infrastructure:
[tprouty/samba.git] / source / include / privileges.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell 1992-1997
5    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6    Copyright (C) Paul Ashton 1997
7    Copyright (C) Simo Sorce 2003
8    Copyright (C) Gerald (Jerry) Carter 2004
9    
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    
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19    
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25 #ifndef PRIVILEGES_H
26 #define PRIVILEGES_H
27
28 /* common privilege defines */
29
30 #define SE_END                          { { 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }
31 #define SE_NONE                         { { 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }
32 #define SE_ALL_PRIVS                    { { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF } }
33
34
35 /* 
36  * We will use our own set of privileges since it makes no sense
37  * to implement all of the Windows set when only a portion will
38  * be used.  Use 128-bit mask to give room to grow.
39  */
40
41 #define SE_NETWORK_LOGON                { { 0x00000001, 0x00000000, 0x00000000, 0x00000000 } }
42 #define SE_INTERACTIVE_LOGON            { { 0x00000002, 0x00000000, 0x00000000, 0x00000000 } }
43 #define SE_BATCH_LOGON                  { { 0x00000004, 0x00000000, 0x00000000, 0x00000000 } }
44 #define SE_SERVICE_LOGON                { { 0x00000008, 0x00000000, 0x00000000, 0x00000000 } }
45 #define SE_MACHINE_ACCOUNT              { { 0x00000010, 0x00000000, 0x00000000, 0x00000000 } }
46 #define SE_PRINT_OPERATOR               { { 0x00000020, 0x00000000, 0x00000000, 0x00000000 } }
47 #define SE_ADD_USERS                    { { 0x00000040, 0x00000000, 0x00000000, 0x00000000 } }
48
49 #if 0   /* not needed currently */
50
51 #define SE_ASSIGN_PRIMARY_TOKEN 
52 #define SE_CREATE_TOKEN         
53 #define SE_LOCK_MEMORY          
54 #define SE_INCREASE_QUOTA       
55 #define SE_UNSOLICITED_INPUT
56 #define SE_TCB  
57 #define SE_SECURITY     
58 #define SE_TAKE_OWNERSHIP
59 #define SE_LOAD_DRIVER  
60 #define SE_SYSTEM_PROFILE       
61 #define SE_SYSTEM_TIME  
62 #define SE_PROF_SINGLE_PROCESS  
63 #define SE_INC_BASE_PRIORITY
64 #define SE_CREATE_PAGEFILE
65 #define SE_CREATE_PERMANENT     
66 #define SE_BACKUP
67 #define SE_RESTORE
68 #define SE_SHUTDOWN     
69 #define SE_DEBUG
70 #define SE_AUDIT        
71 #define SE_SYSTEM_ENVIRONMENT   
72 #define SE_CHANGE_NOTIFY
73 #define SE_REMOTE_SHUTDOWN
74 #define SE_UNDOCK
75 #define SE_SYNC_AGENT   
76 #define SE_ENABLE_DELEGATION
77
78 #endif  /* not needed currently */
79
80 /*
81  * These are used in Lsa replies (srv_lsa_nt.c)
82  */
83 #define PR_NONE                0x0000
84 #define PR_LOG_ON_LOCALLY      0x0001
85 #define PR_ACCESS_FROM_NETWORK 0x0002
86 #define PR_LOG_ON_BATCH_JOB    0x0004
87 #define PR_LOG_ON_SERVICE      0x0010
88
89
90 #ifndef _BOOL
91 typedef int BOOL;
92 #define _BOOL       /* So we don't typedef BOOL again in vfs.h */
93 #endif
94
95 typedef struct LUID
96 {
97         uint32 low;
98         uint32 high;
99 } LUID;
100
101 typedef struct LUID_ATTR
102 {
103         LUID luid;
104         uint32 attr;
105 } LUID_ATTR;
106
107 typedef struct privilege_set
108 {
109         TALLOC_CTX *mem_ctx;
110         BOOL ext_ctx;
111         uint32 count;
112         uint32 control;
113         LUID_ATTR *set;
114 } PRIVILEGE_SET;
115
116 #define SE_PRIV_MASKSIZE 4
117
118 typedef struct {
119         uint32 mask[SE_PRIV_MASKSIZE];
120 } SE_PRIV;
121
122 typedef struct _PRIVS {
123         SE_PRIV se_priv;
124         const char *name;
125         const char *description;
126 } PRIVS;
127
128 #endif /* PRIVILEGES_H */