r1677: security descriptors are always little-endian, regardless of DCE/RPC
[kai/samba.git] / source4 / librpc / idl / misc.idl
1 #include "idl_types.h"
2
3 /*
4   miscellaneous IDL structures
5 */
6
7 [] 
8 interface misc
9 {
10         /* a NULL sid */
11         const string SID_NULL = "S-1-0-0";
12
13         /* the world domain */
14         const string SID_WORLD_DOMAIN = "S-1-1";
15         const string SID_WORLD        = "S-1-1-0";
16
17         /* SECURITY_CREATOR_SID_AUTHORITY */
18         const string SID_CREATOR_OWNER_DOMAIN = "S-1-3";
19         const string SID_CREATOR_OWNER        = "S-1-3-0";
20         const string SID_CREATOR_GROUP        = "S-1-3-1";
21
22         /* SECURITY_NT_AUTHORITY */
23         const string SID_NT_AUTHORITY        = "S-1-5";
24         const string SID_NETWORK             = "S-1-5-2";
25         const string SID_ANONYMOUS           = "S-1-5-7";
26         const string SID_AUTHENTICATED_USERS = "S-1-5-11";
27         const string SID_SYSTEM              = "S-1-5-18";
28
29         /* SECURITY_BUILTIN_DOMAIN_RID */
30         const string SID_BUILTIN                   = "S-1-5-32";
31         const string SID_BUILTIN_ADMINISTRATORS    = "S-1-5-32-544";
32         const string SID_BUILTIN_USERS             = "S-1-5-32-545";
33         const string SID_BUILTIN_GUESTS            = "S-1-5-32-546";
34         const string SID_BUILTIN_POWER_USERS       = "S-1-5-32-547";
35         const string SID_BUILTIN_ACCOUNT_OPERATORS = "S-1-5-32-548";
36         const string SID_BUILTIN_SERVER_OPERATORS  = "S-1-5-32-549";
37         const string SID_BUILTIN_PRINT_OPERATORS   = "S-1-5-32-550";
38         const string SID_BUILTIN_BACKUP_OPERATORS  = "S-1-5-32-551";
39         const string SID_BUILTIN_REPLICATOR        = "S-1-5-32-552";
40
41         typedef [public,noprint] struct {
42                 uint32 time_low;
43                 uint16 time_mid;
44                 uint16 time_hi_and_version;
45                 uint8  clock_seq[2];
46                 uint8  node[6];
47         } GUID;
48
49         /* a domain SID. Note that unlike Samba3 this contains a pointer,
50            so you can't copy them using assignment */
51         typedef [public,noprint] struct {
52                 uint8  sid_rev_num;             /**< SID revision number */
53                 uint8  num_auths;               /**< Number of sub-authorities */
54                 uint8  id_auth[6];              /**< Identifier Authority */
55                 uint32 sub_auths[num_auths];
56         } dom_sid;
57
58         typedef [public] struct {
59                 uint8 type;  /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */
60                 uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */
61                 [value(ndr_size_security_ace(r))] uint16 size;
62                 uint32 access_mask;
63
64 #if 0
65                 /* the 'obj' part is present when type is XXXX_TYPE_XXXX_OBJECT */
66                 struct {
67                         uint32 flags;
68                         GUID object_guid;
69                         GUID inherit_guid;
70                 } *obj;
71 #endif
72
73                 dom_sid trustee;
74         } security_ace;
75
76         typedef [public] struct {
77                 uint16 revision;
78                 [value(ndr_size_security_acl(r))] uint16 size;
79                 uint32 num_aces;
80                 security_ace aces[num_aces];
81         } security_acl;
82
83         /* default revision for new ACLs */
84         const int SD_REVISION                    = 1;
85
86         /* security_descriptor->type bits */
87         const int SEC_DESC_OWNER_DEFAULTED       = 0x0001;
88         const int SEC_DESC_GROUP_DEFAULTED       = 0x0002;
89         const int SEC_DESC_DACL_PRESENT          = 0x0004;
90         const int SEC_DESC_DACL_DEFAULTED        = 0x0008;
91         const int SEC_DESC_SACL_PRESENT          = 0x0010;
92         const int SEC_DESC_SACL_DEFAULTED        = 0x0020;
93         const int SEC_DESC_DACL_TRUSTED          = 0x0040;
94         const int SEC_DESC_SERVER_SECURITY       = 0x0080;
95         const int SEC_DESC_DACL_AUTO_INHERIT_REQ = 0x0100;
96         const int SEC_DESC_SACL_AUTO_INHERIT_REQ = 0x0200;
97         const int SEC_DESC_DACL_AUTO_INHERITED   = 0x0400;
98         const int SEC_DESC_SACL_AUTO_INHERITED   = 0x0800;
99         const int SEC_DESC_DACL_PROTECTED        = 0x1000;
100         const int SEC_DESC_SACL_PROTECTED        = 0x2000;
101         const int SEC_DESC_RM_CONTROL_VALID      = 0x4000;
102         const int SEC_DESC_SELF_RELATIVE         = 0x8000;
103
104         typedef [public,flag(NDR_LITTLE_ENDIAN)] struct {
105                 uint8 revision;
106                 uint16 type;     /* SEC_DESC_xxxx flags */
107                 [relative] dom_sid *owner_sid; 
108                 [relative] dom_sid *group_sid;
109                 [relative] security_acl *sacl; /* system ACL */
110                 [relative] security_acl *dacl; /* user (discretionary) ACL */
111         } security_descriptor;
112
113         typedef [public] struct {
114                 uint32 handle_type;
115                 GUID   uuid;
116         } policy_handle;
117
118         /* this is also used in samr and netlogon */
119         typedef [public, flag(NDR_PAHEX)] struct {
120                 uint16 units_per_week;
121                 [size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
122         } samr_LogonHours;
123
124         typedef [public, flag(NDR_PAHEX)] struct {
125                 uint8 hash[16];
126         } samr_Password;
127 }