44 #include <sys/types.h>
55 #define WINSEC_MAX_SUBAUTHS 15
57 #define WINSEC_DESC_HEADER_SIZE (5 * sizeof(uint32_t))
58 #define WINSEC_ACL_HEADER_SIZE (2 * sizeof(uint32_t))
59 #define WINSEC_ACE_MIN_SIZE 16
65 #define WINSEC_DESC_SELF_RELATIVE 0x8000
66 #define WINSEC_DESC_SACL_PRESENT 0x0010
67 #define WINSEC_DESC_DACL_PRESENT 0x0004
69 #define WINSEC_ACE_OBJECT_PRESENT 0x00000001
70 #define WINSEC_ACE_OBJECT_INHERITED_PRESENT 0x00000002
71 #define WINSEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT 0x5
72 #define WINSEC_ACE_TYPE_ACCESS_DENIED_OBJECT 0x6
73 #define WINSEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT 0x7
74 #define WINSEC_ACE_TYPE_SYSTEM_ALARM_OBJECT 0x8
78 typedef struct _winsec_uuid
98 typedef struct _winsec_sid
114 uint32_t sub_auths[WINSEC_MAX_SUBAUTHS];
119 typedef struct _winsec_ace
153 typedef struct _winsec_acl
171 typedef struct _winsec_desc
237 const uint8_t* buf, uint32_t buf_len);
245 const uint8_t* buf, uint32_t buf_len);
253 const uint8_t* buf, uint32_t buf_len);
261 const uint8_t* buf, uint32_t buf_len);
269 const uint8_t* buf, uint32_t buf_len);
This file implements macros for machine independent short and int manipulation.
XXX: document this.
Definition: winsec.h:120
uint8_t flags
xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE
Definition: winsec.h:125
uint16_t size
XXX: finish documenting.
Definition: winsec.h:128
uint8_t type
xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc
Definition: winsec.h:122
WINSEC_UUID * obj_guid
Object GUID.
Definition: winsec.h:139
uint32_t obj_flags
xxxx_ACE_OBJECT_xxxx e.g present/inherited present etc
Definition: winsec.h:136
WINSEC_UUID * inh_guid
Inherited object GUID.
Definition: winsec.h:142
WINSEC_DOM_SID * trustee
XXX: finish documenting.
Definition: winsec.h:147
uint32_t access_mask
XXX: finish documenting.
Definition: winsec.h:131
XXX: document this.
Definition: winsec.h:154
WINSEC_ACE ** aces
XXX: document this.
Definition: winsec.h:165
uint16_t size
Size, in bytes, of the entire ACL structure.
Definition: winsec.h:159
uint32_t num_aces
Number of Access Control Entries.
Definition: winsec.h:162
uint16_t revision
0x0003
Definition: winsec.h:156
XXX: document this.
Definition: winsec.h:172
uint8_t sbz1
XXX: better explain this.
Definition: winsec.h:184
uint8_t revision
0x01
Definition: winsec.h:174
uint32_t off_sacl
Offset to system list of permissions.
Definition: winsec.h:196
WINSEC_ACL * dacl
User ACL.
Definition: winsec.h:211
uint16_t control
WINSEC_DESC_* flags.
Definition: winsec.h:187
uint32_t off_grp_sid
Offset to group sid.
Definition: winsec.h:193
WINSEC_ACL * sacl
System ACL.
Definition: winsec.h:208
WINSEC_DOM_SID * grp_sid
XXX: document this.
Definition: winsec.h:205
uint32_t off_owner_sid
Offset to owner sid.
Definition: winsec.h:190
uint32_t off_dacl
Offset to list of permissions.
Definition: winsec.h:199
WINSEC_DOM_SID * owner_sid
XXX: document this.
Definition: winsec.h:202
XXX: document this.
Definition: winsec.h:99
uint8_t num_auths
Number of sub-authorities.
Definition: winsec.h:104
uint8_t sid_rev_num
SID revision number.
Definition: winsec.h:101
XXX: document this.
Definition: winsec.h:79
uint16_t time_mid
XXX: document this.
Definition: winsec.h:84
uint32_t time_low
XXX: document this.
Definition: winsec.h:81
uint16_t time_hi_and_version
XXX: document this.
Definition: winsec.h:87
void winsec_free_descriptor(WINSEC_DESC *desc)
XXX: finish documenting.
Definition: winsec.c:39
WINSEC_UUID * winsec_parse_uuid(void *talloc_ctx, const uint8_t *buf, uint32_t buf_len)
XXX: finish documenting.
Definition: winsec.c:315
bool winsec_ace_equal(WINSEC_ACE *s1, WINSEC_ACE *s2)
XXX: finish documenting.
Definition: winsec.c:525
int winsec_sid_compare(const WINSEC_DOM_SID *sid1, const WINSEC_DOM_SID *sid2)
XXX: finish documenting.
Definition: winsec.c:377
WINSEC_DOM_SID * winsec_parse_dom_sid(void *talloc_ctx, const uint8_t *buf, uint32_t buf_len)
XXX: finish documenting.
Definition: winsec.c:278
bool winsec_ace_object(uint8_t type)
XXX: finish documenting.
Definition: winsec.c:549
bool winsec_acl_equal(WINSEC_ACL *s1, WINSEC_ACL *s2)
XXX: finish documenting.
Definition: winsec.c:481
size_t winsec_sid_size(const WINSEC_DOM_SID *sid)
XXX: finish documenting.
Definition: winsec.c:340
bool winsec_sid_equal(const WINSEC_DOM_SID *sid1, const WINSEC_DOM_SID *sid2)
XXX: finish documenting.
Definition: winsec.c:403
WINSEC_ACL * winsec_parse_acl(void *talloc_ctx, const uint8_t *buf, uint32_t buf_len)
XXX: finish documenting.
Definition: winsec.c:144
int winsec_sid_compare_auth(const WINSEC_DOM_SID *sid1, const WINSEC_DOM_SID *sid2)
XXX: finish documenting.
Definition: winsec.c:352
WINSEC_DESC * winsec_parse_descriptor(const uint8_t *buf, uint32_t buf_len)
XXX: finish documenting.
Definition: winsec.c:30
WINSEC_ACE * winsec_parse_ace(void *talloc_ctx, const uint8_t *buf, uint32_t buf_len)
XXX: finish documenting.
Definition: winsec.c:212
char * winsec_sid2str(const WINSEC_DOM_SID *sid)
XXX: finish documenting.
Definition: winsec.c:411
bool winsec_desc_equal(WINSEC_DESC *s1, WINSEC_DESC *s2)
XXX: finish documenting.
Definition: winsec.c:441
WINSEC_DESC * winsec_parse_desc(void *talloc_ctx, const uint8_t *buf, uint32_t buf_len)
XXX: finish documenting.
Definition: winsec.c:48