1 /* parser auto-generated by pidl */
4 #include "../librpc/gen_ndr/ndr_security.h"
6 #include "librpc/gen_ndr/ndr_misc.h"
7 _PUBLIC_
enum ndr_err_code
ndr_push_security_ace_flags(struct ndr_push
*ndr
, int ndr_flags
, uint8_t r
)
9 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
));
10 return NDR_ERR_SUCCESS
;
13 _PUBLIC_
enum ndr_err_code
ndr_pull_security_ace_flags(struct ndr_pull
*ndr
, int ndr_flags
, uint8_t *r
)
16 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &v
));
18 return NDR_ERR_SUCCESS
;
21 _PUBLIC_
void ndr_print_security_ace_flags(struct ndr_print
*ndr
, const char *name
, uint8_t r
)
23 ndr_print_uint8(ndr
, name
, r
);
25 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_OBJECT_INHERIT", SEC_ACE_FLAG_OBJECT_INHERIT
, r
);
26 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_CONTAINER_INHERIT", SEC_ACE_FLAG_CONTAINER_INHERIT
, r
);
27 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", SEC_ACE_FLAG_NO_PROPAGATE_INHERIT
, r
);
28 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_INHERIT_ONLY", SEC_ACE_FLAG_INHERIT_ONLY
, r
);
29 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_INHERITED_ACE", SEC_ACE_FLAG_INHERITED_ACE
, r
);
30 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_VALID_INHERIT", SEC_ACE_FLAG_VALID_INHERIT
, r
);
31 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", SEC_ACE_FLAG_SUCCESSFUL_ACCESS
, r
);
32 ndr_print_bitmap_flag(ndr
, sizeof(uint8_t), "SEC_ACE_FLAG_FAILED_ACCESS", SEC_ACE_FLAG_FAILED_ACCESS
, r
);
36 _PUBLIC_
enum ndr_err_code
ndr_push_security_ace_type(struct ndr_push
*ndr
, int ndr_flags
, enum security_ace_type r
)
38 NDR_CHECK(ndr_push_enum_uint8(ndr
, NDR_SCALARS
, r
));
39 return NDR_ERR_SUCCESS
;
42 _PUBLIC_
enum ndr_err_code
ndr_pull_security_ace_type(struct ndr_pull
*ndr
, int ndr_flags
, enum security_ace_type
*r
)
45 NDR_CHECK(ndr_pull_enum_uint8(ndr
, NDR_SCALARS
, &v
));
47 return NDR_ERR_SUCCESS
;
50 _PUBLIC_
void ndr_print_security_ace_type(struct ndr_print
*ndr
, const char *name
, enum security_ace_type r
)
52 const char *val
= NULL
;
55 case SEC_ACE_TYPE_ACCESS_ALLOWED
: val
= "SEC_ACE_TYPE_ACCESS_ALLOWED"; break;
56 case SEC_ACE_TYPE_ACCESS_DENIED
: val
= "SEC_ACE_TYPE_ACCESS_DENIED"; break;
57 case SEC_ACE_TYPE_SYSTEM_AUDIT
: val
= "SEC_ACE_TYPE_SYSTEM_AUDIT"; break;
58 case SEC_ACE_TYPE_SYSTEM_ALARM
: val
= "SEC_ACE_TYPE_SYSTEM_ALARM"; break;
59 case SEC_ACE_TYPE_ALLOWED_COMPOUND
: val
= "SEC_ACE_TYPE_ALLOWED_COMPOUND"; break;
60 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT
: val
= "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT"; break;
61 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT
: val
= "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT"; break;
62 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT
: val
= "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT"; break;
63 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT
: val
= "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT"; break;
65 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
68 static enum ndr_err_code
ndr_push_security_ace_object_flags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
70 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
71 return NDR_ERR_SUCCESS
;
74 static enum ndr_err_code
ndr_pull_security_ace_object_flags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
77 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
79 return NDR_ERR_SUCCESS
;
82 _PUBLIC_
void ndr_print_security_ace_object_flags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
84 ndr_print_uint32(ndr
, name
, r
);
86 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_ACE_OBJECT_TYPE_PRESENT", SEC_ACE_OBJECT_TYPE_PRESENT
, r
);
87 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
, r
);
91 static enum ndr_err_code
ndr_push_security_ace_object_type(struct ndr_push
*ndr
, int ndr_flags
, const union security_ace_object_type
*r
)
93 if (ndr_flags
& NDR_SCALARS
) {
94 int level
= ndr_push_get_switch_value(ndr
, r
);
95 NDR_CHECK(ndr_push_union_align(ndr
, 4));
97 case SEC_ACE_OBJECT_TYPE_PRESENT
: {
98 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->type
));
106 if (ndr_flags
& NDR_BUFFERS
) {
107 int level
= ndr_push_get_switch_value(ndr
, r
);
109 case SEC_ACE_OBJECT_TYPE_PRESENT
:
117 return NDR_ERR_SUCCESS
;
120 static enum ndr_err_code
ndr_pull_security_ace_object_type(struct ndr_pull
*ndr
, int ndr_flags
, union security_ace_object_type
*r
)
123 level
= ndr_pull_get_switch_value(ndr
, r
);
124 if (ndr_flags
& NDR_SCALARS
) {
125 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
127 case SEC_ACE_OBJECT_TYPE_PRESENT
: {
128 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->type
));
136 if (ndr_flags
& NDR_BUFFERS
) {
138 case SEC_ACE_OBJECT_TYPE_PRESENT
:
146 return NDR_ERR_SUCCESS
;
149 _PUBLIC_
void ndr_print_security_ace_object_type(struct ndr_print
*ndr
, const char *name
, const union security_ace_object_type
*r
)
152 level
= ndr_print_get_switch_value(ndr
, r
);
153 ndr_print_union(ndr
, name
, level
, "security_ace_object_type");
155 case SEC_ACE_OBJECT_TYPE_PRESENT
:
156 ndr_print_GUID(ndr
, "type", &r
->type
);
165 static enum ndr_err_code
ndr_push_security_ace_object_inherited_type(struct ndr_push
*ndr
, int ndr_flags
, const union security_ace_object_inherited_type
*r
)
167 if (ndr_flags
& NDR_SCALARS
) {
168 int level
= ndr_push_get_switch_value(ndr
, r
);
169 NDR_CHECK(ndr_push_union_align(ndr
, 4));
171 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
: {
172 NDR_CHECK(ndr_push_GUID(ndr
, NDR_SCALARS
, &r
->inherited_type
));
180 if (ndr_flags
& NDR_BUFFERS
) {
181 int level
= ndr_push_get_switch_value(ndr
, r
);
183 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
:
191 return NDR_ERR_SUCCESS
;
194 static enum ndr_err_code
ndr_pull_security_ace_object_inherited_type(struct ndr_pull
*ndr
, int ndr_flags
, union security_ace_object_inherited_type
*r
)
197 level
= ndr_pull_get_switch_value(ndr
, r
);
198 if (ndr_flags
& NDR_SCALARS
) {
199 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
201 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
: {
202 NDR_CHECK(ndr_pull_GUID(ndr
, NDR_SCALARS
, &r
->inherited_type
));
210 if (ndr_flags
& NDR_BUFFERS
) {
212 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
:
220 return NDR_ERR_SUCCESS
;
223 _PUBLIC_
void ndr_print_security_ace_object_inherited_type(struct ndr_print
*ndr
, const char *name
, const union security_ace_object_inherited_type
*r
)
226 level
= ndr_print_get_switch_value(ndr
, r
);
227 ndr_print_union(ndr
, name
, level
, "security_ace_object_inherited_type");
229 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
:
230 ndr_print_GUID(ndr
, "inherited_type", &r
->inherited_type
);
239 static enum ndr_err_code
ndr_push_security_ace_object(struct ndr_push
*ndr
, int ndr_flags
, const struct security_ace_object
*r
)
241 if (ndr_flags
& NDR_SCALARS
) {
242 NDR_CHECK(ndr_push_align(ndr
, 4));
243 NDR_CHECK(ndr_push_security_ace_object_flags(ndr
, NDR_SCALARS
, r
->flags
));
244 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->type
, r
->flags
& SEC_ACE_OBJECT_TYPE_PRESENT
));
245 NDR_CHECK(ndr_push_security_ace_object_type(ndr
, NDR_SCALARS
, &r
->type
));
246 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->inherited_type
, r
->flags
& SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
));
247 NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr
, NDR_SCALARS
, &r
->inherited_type
));
248 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
250 if (ndr_flags
& NDR_BUFFERS
) {
251 NDR_CHECK(ndr_push_security_ace_object_type(ndr
, NDR_BUFFERS
, &r
->type
));
252 NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr
, NDR_BUFFERS
, &r
->inherited_type
));
254 return NDR_ERR_SUCCESS
;
257 static enum ndr_err_code
ndr_pull_security_ace_object(struct ndr_pull
*ndr
, int ndr_flags
, struct security_ace_object
*r
)
259 if (ndr_flags
& NDR_SCALARS
) {
260 NDR_CHECK(ndr_pull_align(ndr
, 4));
261 NDR_CHECK(ndr_pull_security_ace_object_flags(ndr
, NDR_SCALARS
, &r
->flags
));
262 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->type
, r
->flags
& SEC_ACE_OBJECT_TYPE_PRESENT
));
263 NDR_CHECK(ndr_pull_security_ace_object_type(ndr
, NDR_SCALARS
, &r
->type
));
264 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->inherited_type
, r
->flags
& SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
));
265 NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr
, NDR_SCALARS
, &r
->inherited_type
));
266 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
268 if (ndr_flags
& NDR_BUFFERS
) {
269 NDR_CHECK(ndr_pull_security_ace_object_type(ndr
, NDR_BUFFERS
, &r
->type
));
270 NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr
, NDR_BUFFERS
, &r
->inherited_type
));
272 return NDR_ERR_SUCCESS
;
275 _PUBLIC_
void ndr_print_security_ace_object(struct ndr_print
*ndr
, const char *name
, const struct security_ace_object
*r
)
277 ndr_print_struct(ndr
, name
, "security_ace_object");
279 ndr_print_security_ace_object_flags(ndr
, "flags", r
->flags
);
280 ndr_print_set_switch_value(ndr
, &r
->type
, r
->flags
& SEC_ACE_OBJECT_TYPE_PRESENT
);
281 ndr_print_security_ace_object_type(ndr
, "type", &r
->type
);
282 ndr_print_set_switch_value(ndr
, &r
->inherited_type
, r
->flags
& SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT
);
283 ndr_print_security_ace_object_inherited_type(ndr
, "inherited_type", &r
->inherited_type
);
287 _PUBLIC_
enum ndr_err_code
ndr_push_security_ace_object_ctr(struct ndr_push
*ndr
, int ndr_flags
, const union security_ace_object_ctr
*r
)
289 if (ndr_flags
& NDR_SCALARS
) {
290 int level
= ndr_push_get_switch_value(ndr
, r
);
291 NDR_CHECK(ndr_push_union_align(ndr
, 4));
293 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT
: {
294 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
297 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT
: {
298 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
301 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT
: {
302 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
305 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT
: {
306 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
314 if (ndr_flags
& NDR_BUFFERS
) {
315 int level
= ndr_push_get_switch_value(ndr
, r
);
317 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT
:
318 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
321 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT
:
322 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
325 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT
:
326 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
329 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT
:
330 NDR_CHECK(ndr_push_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
338 return NDR_ERR_SUCCESS
;
341 _PUBLIC_
enum ndr_err_code
ndr_pull_security_ace_object_ctr(struct ndr_pull
*ndr
, int ndr_flags
, union security_ace_object_ctr
*r
)
344 level
= ndr_pull_get_switch_value(ndr
, r
);
345 if (ndr_flags
& NDR_SCALARS
) {
346 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
348 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT
: {
349 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
352 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT
: {
353 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
356 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT
: {
357 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
360 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT
: {
361 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_SCALARS
, &r
->object
));
369 if (ndr_flags
& NDR_BUFFERS
) {
371 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT
:
372 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
375 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT
:
376 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
379 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT
:
380 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
383 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT
:
384 NDR_CHECK(ndr_pull_security_ace_object(ndr
, NDR_BUFFERS
, &r
->object
));
392 return NDR_ERR_SUCCESS
;
395 _PUBLIC_
void ndr_print_security_ace_object_ctr(struct ndr_print
*ndr
, const char *name
, const union security_ace_object_ctr
*r
)
398 level
= ndr_print_get_switch_value(ndr
, r
);
399 ndr_print_union(ndr
, name
, level
, "security_ace_object_ctr");
401 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT
:
402 ndr_print_security_ace_object(ndr
, "object", &r
->object
);
405 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT
:
406 ndr_print_security_ace_object(ndr
, "object", &r
->object
);
409 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT
:
410 ndr_print_security_ace_object(ndr
, "object", &r
->object
);
413 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT
:
414 ndr_print_security_ace_object(ndr
, "object", &r
->object
);
423 _PUBLIC_
enum ndr_err_code
ndr_push_security_ace(struct ndr_push
*ndr
, int ndr_flags
, const struct security_ace
*r
)
425 if (ndr_flags
& NDR_SCALARS
) {
426 NDR_CHECK(ndr_push_align(ndr
, 4));
427 NDR_CHECK(ndr_push_security_ace_type(ndr
, NDR_SCALARS
, r
->type
));
428 NDR_CHECK(ndr_push_security_ace_flags(ndr
, NDR_SCALARS
, r
->flags
));
429 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_security_ace(r
, ndr
->iconv_convenience
, ndr
->flags
)));
430 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->access_mask
));
431 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->object
, r
->type
));
432 NDR_CHECK(ndr_push_security_ace_object_ctr(ndr
, NDR_SCALARS
, &r
->object
));
433 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, &r
->trustee
));
434 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
436 if (ndr_flags
& NDR_BUFFERS
) {
437 NDR_CHECK(ndr_push_security_ace_object_ctr(ndr
, NDR_BUFFERS
, &r
->object
));
439 return NDR_ERR_SUCCESS
;
442 _PUBLIC_
void ndr_print_security_ace(struct ndr_print
*ndr
, const char *name
, const struct security_ace
*r
)
444 ndr_print_struct(ndr
, name
, "security_ace");
446 ndr_print_security_ace_type(ndr
, "type", r
->type
);
447 ndr_print_security_ace_flags(ndr
, "flags", r
->flags
);
448 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_size_security_ace(r
, ndr
->iconv_convenience
, ndr
->flags
):r
->size
);
449 ndr_print_uint32(ndr
, "access_mask", r
->access_mask
);
450 ndr_print_set_switch_value(ndr
, &r
->object
, r
->type
);
451 ndr_print_security_ace_object_ctr(ndr
, "object", &r
->object
);
452 ndr_print_dom_sid(ndr
, "trustee", &r
->trustee
);
456 static enum ndr_err_code
ndr_push_security_acl_revision(struct ndr_push
*ndr
, int ndr_flags
, enum security_acl_revision r
)
458 NDR_CHECK(ndr_push_enum_uint1632(ndr
, NDR_SCALARS
, r
));
459 return NDR_ERR_SUCCESS
;
462 static enum ndr_err_code
ndr_pull_security_acl_revision(struct ndr_pull
*ndr
, int ndr_flags
, enum security_acl_revision
*r
)
465 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &v
));
467 return NDR_ERR_SUCCESS
;
470 _PUBLIC_
void ndr_print_security_acl_revision(struct ndr_print
*ndr
, const char *name
, enum security_acl_revision r
)
472 const char *val
= NULL
;
475 case SECURITY_ACL_REVISION_NT4
: val
= "SECURITY_ACL_REVISION_NT4"; break;
476 case SECURITY_ACL_REVISION_ADS
: val
= "SECURITY_ACL_REVISION_ADS"; break;
478 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
481 _PUBLIC_
enum ndr_err_code
ndr_push_security_acl(struct ndr_push
*ndr
, int ndr_flags
, const struct security_acl
*r
)
483 uint32_t cntr_aces_0
;
484 if (ndr_flags
& NDR_SCALARS
) {
485 NDR_CHECK(ndr_push_align(ndr
, 4));
486 NDR_CHECK(ndr_push_security_acl_revision(ndr
, NDR_SCALARS
, r
->revision
));
487 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_security_acl(r
, ndr
->iconv_convenience
, ndr
->flags
)));
488 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_aces
));
489 for (cntr_aces_0
= 0; cntr_aces_0
< r
->num_aces
; cntr_aces_0
++) {
490 NDR_CHECK(ndr_push_security_ace(ndr
, NDR_SCALARS
, &r
->aces
[cntr_aces_0
]));
492 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
494 if (ndr_flags
& NDR_BUFFERS
) {
495 for (cntr_aces_0
= 0; cntr_aces_0
< r
->num_aces
; cntr_aces_0
++) {
496 NDR_CHECK(ndr_push_security_ace(ndr
, NDR_BUFFERS
, &r
->aces
[cntr_aces_0
]));
499 return NDR_ERR_SUCCESS
;
502 _PUBLIC_
enum ndr_err_code
ndr_pull_security_acl(struct ndr_pull
*ndr
, int ndr_flags
, struct security_acl
*r
)
504 uint32_t cntr_aces_0
;
505 TALLOC_CTX
*_mem_save_aces_0
;
506 if (ndr_flags
& NDR_SCALARS
) {
507 NDR_CHECK(ndr_pull_align(ndr
, 4));
508 NDR_CHECK(ndr_pull_security_acl_revision(ndr
, NDR_SCALARS
, &r
->revision
));
509 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->size
));
510 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_aces
));
511 if (r
->num_aces
> 1000) {
512 return ndr_pull_error(ndr
, NDR_ERR_RANGE
, "value out of range");
514 NDR_PULL_ALLOC_N(ndr
, r
->aces
, r
->num_aces
);
515 _mem_save_aces_0
= NDR_PULL_GET_MEM_CTX(ndr
);
516 NDR_PULL_SET_MEM_CTX(ndr
, r
->aces
, 0);
517 for (cntr_aces_0
= 0; cntr_aces_0
< r
->num_aces
; cntr_aces_0
++) {
518 NDR_CHECK(ndr_pull_security_ace(ndr
, NDR_SCALARS
, &r
->aces
[cntr_aces_0
]));
520 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_aces_0
, 0);
521 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
523 if (ndr_flags
& NDR_BUFFERS
) {
524 _mem_save_aces_0
= NDR_PULL_GET_MEM_CTX(ndr
);
525 NDR_PULL_SET_MEM_CTX(ndr
, r
->aces
, 0);
526 for (cntr_aces_0
= 0; cntr_aces_0
< r
->num_aces
; cntr_aces_0
++) {
527 NDR_CHECK(ndr_pull_security_ace(ndr
, NDR_BUFFERS
, &r
->aces
[cntr_aces_0
]));
529 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_aces_0
, 0);
531 return NDR_ERR_SUCCESS
;
534 _PUBLIC_
void ndr_print_security_acl(struct ndr_print
*ndr
, const char *name
, const struct security_acl
*r
)
536 uint32_t cntr_aces_0
;
537 ndr_print_struct(ndr
, name
, "security_acl");
539 ndr_print_security_acl_revision(ndr
, "revision", r
->revision
);
540 ndr_print_uint16(ndr
, "size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_size_security_acl(r
, ndr
->iconv_convenience
, ndr
->flags
):r
->size
);
541 ndr_print_uint32(ndr
, "num_aces", r
->num_aces
);
542 ndr
->print(ndr
, "%s: ARRAY(%d)", "aces", (int)r
->num_aces
);
544 for (cntr_aces_0
=0;cntr_aces_0
<r
->num_aces
;cntr_aces_0
++) {
546 if (asprintf(&idx_0
, "[%d]", cntr_aces_0
) != -1) {
547 ndr_print_security_ace(ndr
, "aces", &r
->aces
[cntr_aces_0
]);
555 _PUBLIC_
enum ndr_err_code
ndr_push_security_descriptor_revision(struct ndr_push
*ndr
, int ndr_flags
, enum security_descriptor_revision r
)
557 NDR_CHECK(ndr_push_enum_uint8(ndr
, NDR_SCALARS
, r
));
558 return NDR_ERR_SUCCESS
;
561 _PUBLIC_
enum ndr_err_code
ndr_pull_security_descriptor_revision(struct ndr_pull
*ndr
, int ndr_flags
, enum security_descriptor_revision
*r
)
564 NDR_CHECK(ndr_pull_enum_uint8(ndr
, NDR_SCALARS
, &v
));
566 return NDR_ERR_SUCCESS
;
569 _PUBLIC_
void ndr_print_security_descriptor_revision(struct ndr_print
*ndr
, const char *name
, enum security_descriptor_revision r
)
571 const char *val
= NULL
;
574 case SECURITY_DESCRIPTOR_REVISION_1
: val
= "SECURITY_DESCRIPTOR_REVISION_1"; break;
576 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
579 _PUBLIC_
enum ndr_err_code
ndr_push_security_descriptor_type(struct ndr_push
*ndr
, int ndr_flags
, uint16_t r
)
581 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
));
582 return NDR_ERR_SUCCESS
;
585 _PUBLIC_
enum ndr_err_code
ndr_pull_security_descriptor_type(struct ndr_pull
*ndr
, int ndr_flags
, uint16_t *r
)
588 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &v
));
590 return NDR_ERR_SUCCESS
;
593 _PUBLIC_
void ndr_print_security_descriptor_type(struct ndr_print
*ndr
, const char *name
, uint16_t r
)
595 ndr_print_uint16(ndr
, name
, r
);
597 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_OWNER_DEFAULTED", SEC_DESC_OWNER_DEFAULTED
, r
);
598 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_GROUP_DEFAULTED", SEC_DESC_GROUP_DEFAULTED
, r
);
599 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_DACL_PRESENT", SEC_DESC_DACL_PRESENT
, r
);
600 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_DACL_DEFAULTED", SEC_DESC_DACL_DEFAULTED
, r
);
601 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SACL_PRESENT", SEC_DESC_SACL_PRESENT
, r
);
602 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SACL_DEFAULTED", SEC_DESC_SACL_DEFAULTED
, r
);
603 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_DACL_TRUSTED", SEC_DESC_DACL_TRUSTED
, r
);
604 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SERVER_SECURITY", SEC_DESC_SERVER_SECURITY
, r
);
605 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERIT_REQ", SEC_DESC_DACL_AUTO_INHERIT_REQ
, r
);
606 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERIT_REQ", SEC_DESC_SACL_AUTO_INHERIT_REQ
, r
);
607 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERITED", SEC_DESC_DACL_AUTO_INHERITED
, r
);
608 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERITED", SEC_DESC_SACL_AUTO_INHERITED
, r
);
609 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_DACL_PROTECTED", SEC_DESC_DACL_PROTECTED
, r
);
610 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SACL_PROTECTED", SEC_DESC_SACL_PROTECTED
, r
);
611 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_RM_CONTROL_VALID", SEC_DESC_RM_CONTROL_VALID
, r
);
612 ndr_print_bitmap_flag(ndr
, sizeof(uint16_t), "SEC_DESC_SELF_RELATIVE", SEC_DESC_SELF_RELATIVE
, r
);
616 _PUBLIC_
enum ndr_err_code
ndr_push_security_descriptor(struct ndr_push
*ndr
, int ndr_flags
, const struct security_descriptor
*r
)
619 uint32_t _flags_save_STRUCT
= ndr
->flags
;
620 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_LITTLE_ENDIAN
);
621 if (ndr_flags
& NDR_SCALARS
) {
622 NDR_CHECK(ndr_push_align(ndr
, 5));
623 NDR_CHECK(ndr_push_security_descriptor_revision(ndr
, NDR_SCALARS
, r
->revision
));
624 NDR_CHECK(ndr_push_security_descriptor_type(ndr
, NDR_SCALARS
, r
->type
));
625 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->owner_sid
));
626 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->group_sid
));
627 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->sacl
));
628 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->dacl
));
629 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
631 if (ndr_flags
& NDR_BUFFERS
) {
633 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->owner_sid
));
634 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, r
->owner_sid
));
635 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->owner_sid
));
638 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->group_sid
));
639 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, r
->group_sid
));
640 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->group_sid
));
643 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->sacl
));
644 NDR_CHECK(ndr_push_security_acl(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sacl
));
645 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->sacl
));
648 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->dacl
));
649 NDR_CHECK(ndr_push_security_acl(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->dacl
));
650 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->dacl
));
653 ndr
->flags
= _flags_save_STRUCT
;
655 return NDR_ERR_SUCCESS
;
658 _PUBLIC_
enum ndr_err_code
ndr_pull_security_descriptor(struct ndr_pull
*ndr
, int ndr_flags
, struct security_descriptor
*r
)
660 uint32_t _ptr_owner_sid
;
661 TALLOC_CTX
*_mem_save_owner_sid_0
;
662 uint32_t _ptr_group_sid
;
663 TALLOC_CTX
*_mem_save_group_sid_0
;
665 TALLOC_CTX
*_mem_save_sacl_0
;
667 TALLOC_CTX
*_mem_save_dacl_0
;
669 uint32_t _flags_save_STRUCT
= ndr
->flags
;
670 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_LITTLE_ENDIAN
);
671 if (ndr_flags
& NDR_SCALARS
) {
672 NDR_CHECK(ndr_pull_align(ndr
, 5));
673 NDR_CHECK(ndr_pull_security_descriptor_revision(ndr
, NDR_SCALARS
, &r
->revision
));
674 NDR_CHECK(ndr_pull_security_descriptor_type(ndr
, NDR_SCALARS
, &r
->type
));
675 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_owner_sid
));
676 if (_ptr_owner_sid
) {
677 NDR_PULL_ALLOC(ndr
, r
->owner_sid
);
678 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->owner_sid
, _ptr_owner_sid
));
682 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_group_sid
));
683 if (_ptr_group_sid
) {
684 NDR_PULL_ALLOC(ndr
, r
->group_sid
);
685 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->group_sid
, _ptr_group_sid
));
689 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sacl
));
691 NDR_PULL_ALLOC(ndr
, r
->sacl
);
692 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->sacl
, _ptr_sacl
));
696 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_dacl
));
698 NDR_PULL_ALLOC(ndr
, r
->dacl
);
699 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->dacl
, _ptr_dacl
));
703 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
705 if (ndr_flags
& NDR_BUFFERS
) {
707 uint32_t _relative_save_offset
;
708 _relative_save_offset
= ndr
->offset
;
709 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->owner_sid
));
710 _mem_save_owner_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
711 NDR_PULL_SET_MEM_CTX(ndr
, r
->owner_sid
, 0);
712 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, r
->owner_sid
));
713 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_owner_sid_0
, 0);
714 if (ndr
->offset
> ndr
->relative_highest_offset
) {
715 ndr
->relative_highest_offset
= ndr
->offset
;
717 ndr
->offset
= _relative_save_offset
;
720 uint32_t _relative_save_offset
;
721 _relative_save_offset
= ndr
->offset
;
722 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->group_sid
));
723 _mem_save_group_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
724 NDR_PULL_SET_MEM_CTX(ndr
, r
->group_sid
, 0);
725 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, r
->group_sid
));
726 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_group_sid_0
, 0);
727 if (ndr
->offset
> ndr
->relative_highest_offset
) {
728 ndr
->relative_highest_offset
= ndr
->offset
;
730 ndr
->offset
= _relative_save_offset
;
733 uint32_t _relative_save_offset
;
734 _relative_save_offset
= ndr
->offset
;
735 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->sacl
));
736 _mem_save_sacl_0
= NDR_PULL_GET_MEM_CTX(ndr
);
737 NDR_PULL_SET_MEM_CTX(ndr
, r
->sacl
, 0);
738 NDR_CHECK(ndr_pull_security_acl(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sacl
));
739 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sacl_0
, 0);
740 if (ndr
->offset
> ndr
->relative_highest_offset
) {
741 ndr
->relative_highest_offset
= ndr
->offset
;
743 ndr
->offset
= _relative_save_offset
;
746 uint32_t _relative_save_offset
;
747 _relative_save_offset
= ndr
->offset
;
748 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->dacl
));
749 _mem_save_dacl_0
= NDR_PULL_GET_MEM_CTX(ndr
);
750 NDR_PULL_SET_MEM_CTX(ndr
, r
->dacl
, 0);
751 NDR_CHECK(ndr_pull_security_acl(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->dacl
));
752 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_dacl_0
, 0);
753 if (ndr
->offset
> ndr
->relative_highest_offset
) {
754 ndr
->relative_highest_offset
= ndr
->offset
;
756 ndr
->offset
= _relative_save_offset
;
759 ndr
->flags
= _flags_save_STRUCT
;
761 return NDR_ERR_SUCCESS
;
764 _PUBLIC_
void ndr_print_security_descriptor(struct ndr_print
*ndr
, const char *name
, const struct security_descriptor
*r
)
766 ndr_print_struct(ndr
, name
, "security_descriptor");
768 uint32_t _flags_save_STRUCT
= ndr
->flags
;
769 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_LITTLE_ENDIAN
);
771 ndr_print_security_descriptor_revision(ndr
, "revision", r
->revision
);
772 ndr_print_security_descriptor_type(ndr
, "type", r
->type
);
773 ndr_print_ptr(ndr
, "owner_sid", r
->owner_sid
);
776 ndr_print_dom_sid(ndr
, "owner_sid", r
->owner_sid
);
779 ndr_print_ptr(ndr
, "group_sid", r
->group_sid
);
782 ndr_print_dom_sid(ndr
, "group_sid", r
->group_sid
);
785 ndr_print_ptr(ndr
, "sacl", r
->sacl
);
788 ndr_print_security_acl(ndr
, "sacl", r
->sacl
);
791 ndr_print_ptr(ndr
, "dacl", r
->dacl
);
794 ndr_print_security_acl(ndr
, "dacl", r
->dacl
);
798 ndr
->flags
= _flags_save_STRUCT
;
802 _PUBLIC_
enum ndr_err_code
ndr_push_sec_desc_buf(struct ndr_push
*ndr
, int ndr_flags
, const struct sec_desc_buf
*r
)
804 if (ndr_flags
& NDR_SCALARS
) {
805 NDR_CHECK(ndr_push_align(ndr
, 5));
806 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, ndr_size_security_descriptor(r
->sd
, ndr
->iconv_convenience
, ndr
->flags
)));
807 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sd
));
808 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
810 if (ndr_flags
& NDR_BUFFERS
) {
813 struct ndr_push
*_ndr_sd
;
814 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_sd
, 4, -1));
815 NDR_CHECK(ndr_push_security_descriptor(_ndr_sd
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd
));
816 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_sd
, 4, -1));
820 return NDR_ERR_SUCCESS
;
823 _PUBLIC_
enum ndr_err_code
ndr_pull_sec_desc_buf(struct ndr_pull
*ndr
, int ndr_flags
, struct sec_desc_buf
*r
)
826 TALLOC_CTX
*_mem_save_sd_0
;
827 if (ndr_flags
& NDR_SCALARS
) {
828 NDR_CHECK(ndr_pull_align(ndr
, 5));
829 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->sd_size
));
830 if (r
->sd_size
> 0x40000) {
831 return ndr_pull_error(ndr
, NDR_ERR_RANGE
, "value out of range");
833 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sd
));
835 NDR_PULL_ALLOC(ndr
, r
->sd
);
839 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
841 if (ndr_flags
& NDR_BUFFERS
) {
843 _mem_save_sd_0
= NDR_PULL_GET_MEM_CTX(ndr
);
844 NDR_PULL_SET_MEM_CTX(ndr
, r
->sd
, 0);
846 struct ndr_pull
*_ndr_sd
;
847 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_sd
, 4, -1));
848 NDR_CHECK(ndr_pull_security_descriptor(_ndr_sd
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd
));
849 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_sd
, 4, -1));
851 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sd_0
, 0);
854 return NDR_ERR_SUCCESS
;
857 _PUBLIC_
void ndr_print_sec_desc_buf(struct ndr_print
*ndr
, const char *name
, const struct sec_desc_buf
*r
)
859 ndr_print_struct(ndr
, name
, "sec_desc_buf");
861 ndr_print_uint32(ndr
, "sd_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_size_security_descriptor(r
->sd
, ndr
->iconv_convenience
, ndr
->flags
):r
->sd_size
);
862 ndr_print_ptr(ndr
, "sd", r
->sd
);
865 ndr_print_security_descriptor(ndr
, "sd", r
->sd
);
871 _PUBLIC_
enum ndr_err_code
ndr_push_security_token(struct ndr_push
*ndr
, int ndr_flags
, const struct security_token
*r
)
873 uint32_t cntr_sids_0
;
874 if (ndr_flags
& NDR_SCALARS
) {
875 NDR_CHECK(ndr_push_align(ndr
, 5));
876 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->user_sid
));
877 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->group_sid
));
878 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_sids
));
879 NDR_CHECK(ndr_push_uint3264(ndr
, NDR_SCALARS
, r
->num_sids
));
880 for (cntr_sids_0
= 0; cntr_sids_0
< r
->num_sids
; cntr_sids_0
++) {
881 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sids
[cntr_sids_0
]));
883 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->privilege_mask
));
884 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
886 if (ndr_flags
& NDR_BUFFERS
) {
888 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, r
->user_sid
));
891 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, r
->group_sid
));
893 for (cntr_sids_0
= 0; cntr_sids_0
< r
->num_sids
; cntr_sids_0
++) {
894 if (r
->sids
[cntr_sids_0
]) {
895 NDR_CHECK(ndr_push_dom_sid(ndr
, NDR_SCALARS
, r
->sids
[cntr_sids_0
]));
899 return NDR_ERR_SUCCESS
;
902 _PUBLIC_
enum ndr_err_code
ndr_pull_security_token(struct ndr_pull
*ndr
, int ndr_flags
, struct security_token
*r
)
904 uint32_t _ptr_user_sid
;
905 TALLOC_CTX
*_mem_save_user_sid_0
;
906 uint32_t _ptr_group_sid
;
907 TALLOC_CTX
*_mem_save_group_sid_0
;
909 uint32_t cntr_sids_0
;
910 TALLOC_CTX
*_mem_save_sids_0
;
911 TALLOC_CTX
*_mem_save_sids_1
;
912 if (ndr_flags
& NDR_SCALARS
) {
913 NDR_CHECK(ndr_pull_align(ndr
, 5));
914 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_user_sid
));
916 NDR_PULL_ALLOC(ndr
, r
->user_sid
);
920 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_group_sid
));
921 if (_ptr_group_sid
) {
922 NDR_PULL_ALLOC(ndr
, r
->group_sid
);
926 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_sids
));
927 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->sids
));
928 NDR_PULL_ALLOC_N(ndr
, r
->sids
, ndr_get_array_size(ndr
, &r
->sids
));
929 _mem_save_sids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
930 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
931 for (cntr_sids_0
= 0; cntr_sids_0
< r
->num_sids
; cntr_sids_0
++) {
932 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sids
));
934 NDR_PULL_ALLOC(ndr
, r
->sids
[cntr_sids_0
]);
936 r
->sids
[cntr_sids_0
] = NULL
;
939 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_0
, 0);
940 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->privilege_mask
));
942 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->sids
, r
->num_sids
));
944 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
946 if (ndr_flags
& NDR_BUFFERS
) {
948 _mem_save_user_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
949 NDR_PULL_SET_MEM_CTX(ndr
, r
->user_sid
, 0);
950 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, r
->user_sid
));
951 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_user_sid_0
, 0);
954 _mem_save_group_sid_0
= NDR_PULL_GET_MEM_CTX(ndr
);
955 NDR_PULL_SET_MEM_CTX(ndr
, r
->group_sid
, 0);
956 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, r
->group_sid
));
957 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_group_sid_0
, 0);
959 _mem_save_sids_0
= NDR_PULL_GET_MEM_CTX(ndr
);
960 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
, 0);
961 for (cntr_sids_0
= 0; cntr_sids_0
< r
->num_sids
; cntr_sids_0
++) {
962 if (r
->sids
[cntr_sids_0
]) {
963 _mem_save_sids_1
= NDR_PULL_GET_MEM_CTX(ndr
);
964 NDR_PULL_SET_MEM_CTX(ndr
, r
->sids
[cntr_sids_0
], 0);
965 NDR_CHECK(ndr_pull_dom_sid(ndr
, NDR_SCALARS
, r
->sids
[cntr_sids_0
]));
966 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_1
, 0);
969 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sids_0
, 0);
971 return NDR_ERR_SUCCESS
;
974 _PUBLIC_
void ndr_print_security_token(struct ndr_print
*ndr
, const char *name
, const struct security_token
*r
)
976 uint32_t cntr_sids_0
;
977 ndr_print_struct(ndr
, name
, "security_token");
979 ndr_print_ptr(ndr
, "user_sid", r
->user_sid
);
982 ndr_print_dom_sid(ndr
, "user_sid", r
->user_sid
);
985 ndr_print_ptr(ndr
, "group_sid", r
->group_sid
);
988 ndr_print_dom_sid(ndr
, "group_sid", r
->group_sid
);
991 ndr_print_uint32(ndr
, "num_sids", r
->num_sids
);
992 ndr
->print(ndr
, "%s: ARRAY(%d)", "sids", (int)r
->num_sids
);
994 for (cntr_sids_0
=0;cntr_sids_0
<r
->num_sids
;cntr_sids_0
++) {
996 if (asprintf(&idx_0
, "[%d]", cntr_sids_0
) != -1) {
997 ndr_print_ptr(ndr
, "sids", r
->sids
[cntr_sids_0
]);
999 if (r
->sids
[cntr_sids_0
]) {
1000 ndr_print_dom_sid(ndr
, "sids", r
->sids
[cntr_sids_0
]);
1007 ndr_print_udlong(ndr
, "privilege_mask", r
->privilege_mask
);
1011 _PUBLIC_
enum ndr_err_code
ndr_push_security_secinfo(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
1013 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
1014 return NDR_ERR_SUCCESS
;
1017 _PUBLIC_
enum ndr_err_code
ndr_pull_security_secinfo(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
1020 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
1022 return NDR_ERR_SUCCESS
;
1025 _PUBLIC_
void ndr_print_security_secinfo(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
1027 ndr_print_uint32(ndr
, name
, r
);
1029 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_OWNER", SECINFO_OWNER
, r
);
1030 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_GROUP", SECINFO_GROUP
, r
);
1031 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_DACL", SECINFO_DACL
, r
);
1032 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_SACL", SECINFO_SACL
, r
);
1033 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_UNPROTECTED_SACL", SECINFO_UNPROTECTED_SACL
, r
);
1034 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_UNPROTECTED_DACL", SECINFO_UNPROTECTED_DACL
, r
);
1035 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_PROTECTED_SACL", SECINFO_PROTECTED_SACL
, r
);
1036 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SECINFO_PROTECTED_DACL", SECINFO_PROTECTED_DACL
, r
);
1040 _PUBLIC_
enum ndr_err_code
ndr_push_kerb_EncTypes(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
1042 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
1043 return NDR_ERR_SUCCESS
;
1046 _PUBLIC_
enum ndr_err_code
ndr_pull_kerb_EncTypes(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
1049 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
1051 return NDR_ERR_SUCCESS
;
1054 _PUBLIC_
void ndr_print_kerb_EncTypes(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
1056 ndr_print_uint32(ndr
, name
, r
);
1058 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_CRC", KERB_ENCTYPE_DES_CBC_CRC
, r
);
1059 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "KERB_ENCTYPE_DES_CBC_MD5", KERB_ENCTYPE_DES_CBC_MD5
, r
);
1060 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "KERB_ENCTYPE_RC4_HMAC_MD5", KERB_ENCTYPE_RC4_HMAC_MD5
, r
);
1061 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96
, r
);
1062 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96
, r
);
1066 _PUBLIC_
enum ndr_err_code
ndr_push_security_autoinherit(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
1068 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
1069 return NDR_ERR_SUCCESS
;
1072 _PUBLIC_
enum ndr_err_code
ndr_pull_security_autoinherit(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
1075 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
1077 return NDR_ERR_SUCCESS
;
1080 _PUBLIC_
void ndr_print_security_autoinherit(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
1082 ndr_print_uint32(ndr
, name
, r
);
1084 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_DACL_AUTO_INHERIT", SEC_DACL_AUTO_INHERIT
, r
);
1085 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_SACL_AUTO_INHERIT", SEC_SACL_AUTO_INHERIT
, r
);
1086 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_DEFAULT_DESCRIPTOR", SEC_DEFAULT_DESCRIPTOR
, r
);
1087 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_OWNER_FROM_PARENT", SEC_OWNER_FROM_PARENT
, r
);
1088 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "SEC_GROUP_FROM_PARENT", SEC_GROUP_FROM_PARENT
, r
);