Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_security.h"
12 :
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 718451 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 718451 : switch (var_size) {
35 150 : case 8:
36 150 : return UINT64_MAX;
37 359092 : case 4:
38 359092 : return UINT32_MAX;
39 353359 : case 2:
40 353359 : return UINT16_MAX;
41 5850 : case 1:
42 5850 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 0 : switch (var_size) {
51 0 : case 8:
52 0 : return INT64_MAX;
53 0 : case 4:
54 0 : return INT32_MAX;
55 0 : case 2:
56 0 : return INT16_MAX;
57 0 : case 1:
58 0 : return INT8_MAX;
59 : }
60 :
61 0 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : static PyTypeObject dom_sid_Type;
66 : static PyTypeObject security_ace_object_type_Type;
67 : static PyTypeObject security_ace_object_inherited_type_Type;
68 : static PyTypeObject security_ace_object_Type;
69 : static PyTypeObject claim_values_Type;
70 : static PyTypeObject CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type;
71 : static PyTypeObject security_ace_object_ctr_Type;
72 : static PyTypeObject security_ace_coda_Type;
73 : static PyTypeObject security_ace_Type;
74 : static PyTypeObject security_acl_Type;
75 : static PyTypeObject security_descriptor_Type;
76 : static PyTypeObject sec_desc_buf_Type;
77 : static PyTypeObject security_token_Type;
78 : static PyTypeObject security_token_descriptor_fuzzing_pair_Type;
79 : static PyTypeObject security_unix_token_Type;
80 : static PyTypeObject LSAP_TOKEN_INFO_INTEGRITY_Type;
81 : static PyTypeObject generic_mapping_Type;
82 : static PyTypeObject standard_mapping_Type;
83 : static PyTypeObject security_InterfaceType;
84 :
85 : static PyTypeObject *BaseObject_Type;
86 : static PyTypeObject *GUID_Type;
87 : static PyTypeObject *ClientConnection_Type;
88 : static PyTypeObject *ndr_syntax_id_Type;
89 : #include "librpc/ndr/py_security.c"
90 :
91 :
92 0 : static PyObject *py_dom_sid_get_sid_rev_num(PyObject *obj, void *closure)
93 : {
94 0 : struct dom_sid *object = pytalloc_get_ptr(obj);
95 0 : PyObject *py_sid_rev_num;
96 0 : py_sid_rev_num = PyLong_FromLong((uint16_t)(object->sid_rev_num));
97 0 : return py_sid_rev_num;
98 : }
99 :
100 0 : static int py_dom_sid_set_sid_rev_num(PyObject *py_obj, PyObject *value, void *closure)
101 : {
102 0 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
103 0 : if (value == NULL) {
104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_rev_num");
105 0 : return -1;
106 : }
107 : {
108 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_rev_num));
109 0 : if (PyLong_Check(value)) {
110 0 : unsigned long long test_var;
111 0 : test_var = PyLong_AsUnsignedLongLong(value);
112 0 : if (PyErr_Occurred() != NULL) {
113 0 : return -1;
114 : }
115 0 : if (test_var > uint_max) {
116 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
117 : PyLong_Type.tp_name, uint_max, test_var);
118 0 : return -1;
119 : }
120 0 : object->sid_rev_num = test_var;
121 : } else {
122 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
123 : PyLong_Type.tp_name);
124 0 : return -1;
125 : }
126 : }
127 0 : return 0;
128 : }
129 :
130 144 : static PyObject *py_dom_sid_get_num_auths(PyObject *obj, void *closure)
131 : {
132 144 : struct dom_sid *object = pytalloc_get_ptr(obj);
133 0 : PyObject *py_num_auths;
134 144 : py_num_auths = PyLong_FromLong(object->num_auths);
135 144 : return py_num_auths;
136 : }
137 :
138 0 : static int py_dom_sid_set_num_auths(PyObject *py_obj, PyObject *value, void *closure)
139 : {
140 0 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
141 0 : if (value == NULL) {
142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_auths");
143 0 : return -1;
144 : }
145 : {
146 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->num_auths));
147 0 : const long long int_min = -int_max - 1;
148 0 : if (PyLong_Check(value)) {
149 0 : long long test_var;
150 0 : test_var = PyLong_AsLongLong(value);
151 0 : if (PyErr_Occurred() != NULL) {
152 0 : return -1;
153 : }
154 0 : if (test_var < int_min || test_var > int_max) {
155 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
156 : PyLong_Type.tp_name, int_min, int_max, test_var);
157 0 : return -1;
158 : }
159 0 : object->num_auths = test_var;
160 : } else {
161 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
162 : PyLong_Type.tp_name);
163 0 : return -1;
164 : }
165 : }
166 0 : return 0;
167 : }
168 :
169 0 : static PyObject *py_dom_sid_get_id_auth(PyObject *obj, void *closure)
170 : {
171 0 : struct dom_sid *object = pytalloc_get_ptr(obj);
172 0 : PyObject *py_id_auth;
173 0 : py_id_auth = PyList_New(6);
174 0 : if (py_id_auth == NULL) {
175 0 : return NULL;
176 : }
177 : {
178 : int id_auth_cntr_0;
179 0 : for (id_auth_cntr_0 = 0; id_auth_cntr_0 < (6); id_auth_cntr_0++) {
180 0 : PyObject *py_id_auth_0;
181 0 : py_id_auth_0 = PyLong_FromLong((uint16_t)((object->id_auth)[id_auth_cntr_0]));
182 0 : PyList_SetItem(py_id_auth, id_auth_cntr_0, py_id_auth_0);
183 : }
184 : }
185 0 : return py_id_auth;
186 : }
187 :
188 0 : static int py_dom_sid_set_id_auth(PyObject *py_obj, PyObject *value, void *closure)
189 : {
190 0 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
191 0 : if (value == NULL) {
192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->id_auth");
193 0 : return -1;
194 : }
195 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
196 : {
197 0 : int id_auth_cntr_0;
198 0 : if (ARRAY_SIZE(object->id_auth) != PyList_GET_SIZE(value)) {
199 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->id_auth), PyList_GET_SIZE(value));
200 0 : return -1;
201 : }
202 0 : for (id_auth_cntr_0 = 0; id_auth_cntr_0 < PyList_GET_SIZE(value); id_auth_cntr_0++) {
203 0 : if (PyList_GET_ITEM(value, id_auth_cntr_0) == NULL) {
204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->id_auth)[id_auth_cntr_0]");
205 0 : return -1;
206 : }
207 : {
208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->id_auth)[id_auth_cntr_0]));
209 0 : if (PyLong_Check(PyList_GET_ITEM(value, id_auth_cntr_0))) {
210 0 : unsigned long long test_var;
211 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, id_auth_cntr_0));
212 0 : if (PyErr_Occurred() != NULL) {
213 0 : return -1;
214 : }
215 0 : if (test_var > uint_max) {
216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
217 : PyLong_Type.tp_name, uint_max, test_var);
218 0 : return -1;
219 : }
220 0 : (object->id_auth)[id_auth_cntr_0] = test_var;
221 : } else {
222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
223 : PyLong_Type.tp_name);
224 0 : return -1;
225 : }
226 : }
227 : }
228 : }
229 0 : return 0;
230 : }
231 :
232 0 : static PyObject *py_dom_sid_get_sub_auths(PyObject *obj, void *closure)
233 : {
234 0 : struct dom_sid *object = pytalloc_get_ptr(obj);
235 0 : PyObject *py_sub_auths;
236 0 : py_sub_auths = PyList_New(15);
237 0 : if (py_sub_auths == NULL) {
238 0 : return NULL;
239 : }
240 : {
241 : int sub_auths_cntr_0;
242 0 : for (sub_auths_cntr_0 = 0; sub_auths_cntr_0 < (15); sub_auths_cntr_0++) {
243 0 : PyObject *py_sub_auths_0;
244 0 : py_sub_auths_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->sub_auths)[sub_auths_cntr_0]));
245 0 : PyList_SetItem(py_sub_auths, sub_auths_cntr_0, py_sub_auths_0);
246 : }
247 : }
248 0 : return py_sub_auths;
249 : }
250 :
251 0 : static int py_dom_sid_set_sub_auths(PyObject *py_obj, PyObject *value, void *closure)
252 : {
253 0 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
254 0 : if (value == NULL) {
255 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sub_auths");
256 0 : return -1;
257 : }
258 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
259 : {
260 0 : int sub_auths_cntr_0;
261 0 : if (ARRAY_SIZE(object->sub_auths) != PyList_GET_SIZE(value)) {
262 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->sub_auths), PyList_GET_SIZE(value));
263 0 : return -1;
264 : }
265 0 : for (sub_auths_cntr_0 = 0; sub_auths_cntr_0 < PyList_GET_SIZE(value); sub_auths_cntr_0++) {
266 0 : if (PyList_GET_ITEM(value, sub_auths_cntr_0) == NULL) {
267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sub_auths)[sub_auths_cntr_0]");
268 0 : return -1;
269 : }
270 : {
271 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->sub_auths)[sub_auths_cntr_0]));
272 0 : if (PyLong_Check(PyList_GET_ITEM(value, sub_auths_cntr_0))) {
273 0 : unsigned long long test_var;
274 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, sub_auths_cntr_0));
275 0 : if (PyErr_Occurred() != NULL) {
276 0 : return -1;
277 : }
278 0 : if (test_var > uint_max) {
279 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
280 : PyLong_Type.tp_name, uint_max, test_var);
281 0 : return -1;
282 : }
283 0 : (object->sub_auths)[sub_auths_cntr_0] = test_var;
284 : } else {
285 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
286 : PyLong_Type.tp_name);
287 0 : return -1;
288 : }
289 : }
290 : }
291 : }
292 0 : return 0;
293 : }
294 :
295 : static PyGetSetDef py_dom_sid_getsetters[] = {
296 : {
297 : .name = discard_const_p(char, "sid_rev_num"),
298 : .get = py_dom_sid_get_sid_rev_num,
299 : .set = py_dom_sid_set_sid_rev_num,
300 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
301 : },
302 : {
303 : .name = discard_const_p(char, "num_auths"),
304 : .get = py_dom_sid_get_num_auths,
305 : .set = py_dom_sid_set_num_auths,
306 : .doc = discard_const_p(char, "PIDL-generated element of base type int8")
307 : },
308 : {
309 : .name = discard_const_p(char, "id_auth"),
310 : .get = py_dom_sid_get_id_auth,
311 : .set = py_dom_sid_set_id_auth,
312 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
313 : },
314 : {
315 : .name = discard_const_p(char, "sub_auths"),
316 : .get = py_dom_sid_get_sub_auths,
317 : .set = py_dom_sid_set_sub_auths,
318 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
319 : },
320 : { .name = NULL }
321 : };
322 :
323 123621 : static PyObject *py_dom_sid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
324 : {
325 123621 : return pytalloc_new(struct dom_sid, type);
326 : }
327 :
328 333 : static PyObject *py_dom_sid_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
329 : {
330 333 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
331 333 : PyObject *ret = NULL;
332 28 : DATA_BLOB blob;
333 28 : enum ndr_err_code err;
334 333 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
335 333 : if (tmp_ctx == NULL) {
336 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
337 0 : return NULL;
338 : }
339 333 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dom_sid);
340 333 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
341 0 : TALLOC_FREE(tmp_ctx);
342 0 : PyErr_SetNdrError(err);
343 0 : return NULL;
344 : }
345 :
346 333 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
347 333 : TALLOC_FREE(tmp_ctx);
348 333 : return ret;
349 : }
350 :
351 28497 : static PyObject *py_dom_sid_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
352 : {
353 28497 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
354 28497 : DATA_BLOB blob = {.data = NULL, .length = 0};
355 28497 : Py_ssize_t blob_length = 0;
356 111 : enum ndr_err_code err;
357 28497 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
358 28497 : PyObject *allow_remaining_obj = NULL;
359 28497 : bool allow_remaining = false;
360 :
361 28497 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
362 : discard_const_p(char *, kwnames),
363 : &blob.data, &blob_length,
364 : &allow_remaining_obj)) {
365 0 : return NULL;
366 : }
367 28497 : blob.length = blob_length;
368 :
369 28497 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
370 0 : allow_remaining = true;
371 : }
372 :
373 28386 : if (allow_remaining) {
374 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
375 : } else {
376 28497 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
377 : }
378 28497 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
379 0 : PyErr_SetNdrError(err);
380 0 : return NULL;
381 : }
382 :
383 28497 : Py_RETURN_NONE;
384 : }
385 :
386 0 : static PyObject *py_dom_sid_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
387 : {
388 0 : struct dom_sid *object = pytalloc_get_ptr(py_obj);
389 0 : PyObject *ret;
390 0 : char *retstr;
391 :
392 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dom_sid, "dom_sid", object);
393 0 : ret = PyUnicode_FromString(retstr);
394 0 : talloc_free(retstr);
395 :
396 0 : return ret;
397 : }
398 :
399 : static PyMethodDef py_dom_sid_methods[] = {
400 : { "__ndr_pack__", (PyCFunction)py_dom_sid_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
401 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dom_sid_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
402 : { "__ndr_print__", (PyCFunction)py_dom_sid_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
403 : { NULL, NULL, 0, NULL }
404 : };
405 :
406 :
407 : static PyTypeObject dom_sid_Type = {
408 : PyVarObject_HEAD_INIT(NULL, 0)
409 : .tp_name = "security.dom_sid",
410 : .tp_getset = py_dom_sid_getsetters,
411 : .tp_methods = py_dom_sid_methods,
412 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
413 : .tp_new = py_dom_sid_new,
414 : };
415 :
416 0 : static PyObject *py_import_security_ace_object_type(TALLOC_CTX *mem_ctx, int level, union security_ace_object_type *in)
417 : {
418 0 : PyObject *ret;
419 :
420 0 : switch (level) {
421 0 : case SEC_ACE_OBJECT_TYPE_PRESENT:
422 0 : ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->type);
423 0 : return ret;
424 :
425 0 : default:
426 0 : ret = Py_None;
427 0 : Py_INCREF(ret);
428 0 : return ret;
429 :
430 : }
431 : PyErr_SetString(PyExc_TypeError, "unknown union level");
432 : return NULL;
433 : }
434 :
435 4 : static union security_ace_object_type *py_export_security_ace_object_type(TALLOC_CTX *mem_ctx, int level, PyObject *in)
436 : {
437 4 : union security_ace_object_type *ret = talloc_zero(mem_ctx, union security_ace_object_type);
438 4 : switch (level) {
439 4 : case SEC_ACE_OBJECT_TYPE_PRESENT:
440 4 : if (in == NULL) {
441 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->type");
442 0 : talloc_free(ret); return NULL;
443 : }
444 4 : PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
445 4 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
446 0 : PyErr_NoMemory();
447 0 : talloc_free(ret); return NULL;
448 : }
449 4 : ret->type = *(struct GUID *)pytalloc_get_ptr(in);
450 4 : break;
451 :
452 0 : default:
453 0 : break;
454 :
455 : }
456 :
457 4 : return ret;
458 : }
459 :
460 0 : static PyObject *py_security_ace_object_type_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
461 : {
462 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
463 0 : PyObject *mem_ctx_obj = NULL;
464 0 : TALLOC_CTX *mem_ctx = NULL;
465 0 : int level = 0;
466 0 : PyObject *in_obj = NULL;
467 0 : union security_ace_object_type *in = NULL;
468 :
469 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
470 : discard_const_p(char *, kwnames),
471 : &mem_ctx_obj,
472 : &level,
473 : &in_obj)) {
474 0 : return NULL;
475 : }
476 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
477 0 : if (mem_ctx == NULL) {
478 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
479 0 : return NULL;
480 : }
481 0 : in = (union security_ace_object_type *)pytalloc_get_ptr(in_obj);
482 0 : if (in == NULL) {
483 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_type!");
484 0 : return NULL;
485 : }
486 :
487 0 : return py_import_security_ace_object_type(mem_ctx, level, in);
488 : }
489 :
490 4 : static PyObject *py_security_ace_object_type_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
491 : {
492 4 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
493 4 : PyObject *mem_ctx_obj = NULL;
494 4 : TALLOC_CTX *mem_ctx = NULL;
495 4 : int level = 0;
496 4 : PyObject *in = NULL;
497 4 : union security_ace_object_type *out = NULL;
498 :
499 4 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
500 : discard_const_p(char *, kwnames),
501 : &mem_ctx_obj,
502 : &level,
503 : &in)) {
504 0 : return NULL;
505 : }
506 4 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
507 4 : if (mem_ctx == NULL) {
508 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
509 0 : return NULL;
510 : }
511 :
512 4 : out = py_export_security_ace_object_type(mem_ctx, level, in);
513 4 : if (out == NULL) {
514 0 : return NULL;
515 : }
516 :
517 4 : return pytalloc_GenericObject_reference(out);
518 : }
519 :
520 : static PyMethodDef py_security_ace_object_type_methods[] = {
521 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_type_import),
522 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
523 : "T.__import__(mem_ctx, level, in) => ret." },
524 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_type_export),
525 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
526 : "T.__export__(mem_ctx, level, in) => ret." },
527 : { NULL, NULL, 0, NULL }
528 : };
529 :
530 0 : static PyObject *py_security_ace_object_type_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
531 : {
532 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
533 0 : return NULL;
534 : }
535 :
536 :
537 : static PyTypeObject security_ace_object_type_Type = {
538 : PyVarObject_HEAD_INIT(NULL, 0)
539 : .tp_name = "security.ace_object_type",
540 : .tp_getset = NULL,
541 : .tp_methods = py_security_ace_object_type_methods,
542 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
543 : .tp_new = py_security_ace_object_type_new,
544 : };
545 :
546 28794 : static PyObject *py_import_security_ace_object_inherited_type(TALLOC_CTX *mem_ctx, int level, union security_ace_object_inherited_type *in)
547 : {
548 3647 : PyObject *ret;
549 :
550 28794 : switch (level) {
551 28794 : case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
552 28794 : ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->inherited_type);
553 28794 : return ret;
554 :
555 0 : default:
556 0 : ret = Py_None;
557 0 : Py_INCREF(ret);
558 0 : return ret;
559 :
560 : }
561 : PyErr_SetString(PyExc_TypeError, "unknown union level");
562 : return NULL;
563 : }
564 :
565 0 : static union security_ace_object_inherited_type *py_export_security_ace_object_inherited_type(TALLOC_CTX *mem_ctx, int level, PyObject *in)
566 : {
567 0 : union security_ace_object_inherited_type *ret = talloc_zero(mem_ctx, union security_ace_object_inherited_type);
568 0 : switch (level) {
569 0 : case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
570 0 : if (in == NULL) {
571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->inherited_type");
572 0 : talloc_free(ret); return NULL;
573 : }
574 0 : PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
575 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
576 0 : PyErr_NoMemory();
577 0 : talloc_free(ret); return NULL;
578 : }
579 0 : ret->inherited_type = *(struct GUID *)pytalloc_get_ptr(in);
580 0 : break;
581 :
582 0 : default:
583 0 : break;
584 :
585 : }
586 :
587 0 : return ret;
588 : }
589 :
590 28794 : static PyObject *py_security_ace_object_inherited_type_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
591 : {
592 28794 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
593 28794 : PyObject *mem_ctx_obj = NULL;
594 28794 : TALLOC_CTX *mem_ctx = NULL;
595 28794 : int level = 0;
596 28794 : PyObject *in_obj = NULL;
597 28794 : union security_ace_object_inherited_type *in = NULL;
598 :
599 28794 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
600 : discard_const_p(char *, kwnames),
601 : &mem_ctx_obj,
602 : &level,
603 : &in_obj)) {
604 0 : return NULL;
605 : }
606 28794 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
607 28794 : if (mem_ctx == NULL) {
608 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
609 0 : return NULL;
610 : }
611 28794 : in = (union security_ace_object_inherited_type *)pytalloc_get_ptr(in_obj);
612 28794 : if (in == NULL) {
613 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_inherited_type!");
614 0 : return NULL;
615 : }
616 :
617 28794 : return py_import_security_ace_object_inherited_type(mem_ctx, level, in);
618 : }
619 :
620 0 : static PyObject *py_security_ace_object_inherited_type_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
621 : {
622 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
623 0 : PyObject *mem_ctx_obj = NULL;
624 0 : TALLOC_CTX *mem_ctx = NULL;
625 0 : int level = 0;
626 0 : PyObject *in = NULL;
627 0 : union security_ace_object_inherited_type *out = NULL;
628 :
629 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
630 : discard_const_p(char *, kwnames),
631 : &mem_ctx_obj,
632 : &level,
633 : &in)) {
634 0 : return NULL;
635 : }
636 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
637 0 : if (mem_ctx == NULL) {
638 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
639 0 : return NULL;
640 : }
641 :
642 0 : out = py_export_security_ace_object_inherited_type(mem_ctx, level, in);
643 0 : if (out == NULL) {
644 0 : return NULL;
645 : }
646 :
647 0 : return pytalloc_GenericObject_reference(out);
648 : }
649 :
650 : static PyMethodDef py_security_ace_object_inherited_type_methods[] = {
651 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_inherited_type_import),
652 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
653 : "T.__import__(mem_ctx, level, in) => ret." },
654 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_inherited_type_export),
655 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
656 : "T.__export__(mem_ctx, level, in) => ret." },
657 : { NULL, NULL, 0, NULL }
658 : };
659 :
660 0 : static PyObject *py_security_ace_object_inherited_type_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
661 : {
662 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
663 0 : return NULL;
664 : }
665 :
666 :
667 : static PyTypeObject security_ace_object_inherited_type_Type = {
668 : PyVarObject_HEAD_INIT(NULL, 0)
669 : .tp_name = "security.ace_object_inherited_type",
670 : .tp_getset = NULL,
671 : .tp_methods = py_security_ace_object_inherited_type_methods,
672 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
673 : .tp_new = py_security_ace_object_inherited_type_new,
674 : };
675 :
676 :
677 122321 : static PyObject *py_security_ace_object_get_flags(PyObject *obj, void *closure)
678 : {
679 122321 : struct security_ace_object *object = pytalloc_get_ptr(obj);
680 13149 : PyObject *py_flags;
681 122321 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
682 122321 : return py_flags;
683 : }
684 :
685 4 : static int py_security_ace_object_set_flags(PyObject *py_obj, PyObject *value, void *closure)
686 : {
687 4 : struct security_ace_object *object = pytalloc_get_ptr(py_obj);
688 4 : if (value == NULL) {
689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
690 0 : return -1;
691 : }
692 : {
693 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
694 4 : if (PyLong_Check(value)) {
695 0 : unsigned long long test_var;
696 4 : test_var = PyLong_AsUnsignedLongLong(value);
697 4 : if (PyErr_Occurred() != NULL) {
698 0 : return -1;
699 : }
700 4 : if (test_var > uint_max) {
701 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
702 : PyLong_Type.tp_name, uint_max, test_var);
703 0 : return -1;
704 : }
705 4 : object->flags = test_var;
706 : } else {
707 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
708 : PyLong_Type.tp_name);
709 0 : return -1;
710 : }
711 : }
712 4 : return 0;
713 : }
714 :
715 0 : static PyObject *py_security_ace_object_get_type(PyObject *obj, void *closure)
716 : {
717 0 : struct security_ace_object *object = pytalloc_get_ptr(obj);
718 0 : PyObject *py_type;
719 0 : py_type = pyrpc_import_union(&security_ace_object_type_Type, pytalloc_get_mem_ctx(obj), object->flags & SEC_ACE_OBJECT_TYPE_PRESENT, &object->type, "union security_ace_object_type");
720 0 : if (py_type == NULL) {
721 0 : return NULL;
722 : }
723 0 : return py_type;
724 : }
725 :
726 4 : static int py_security_ace_object_set_type(PyObject *py_obj, PyObject *value, void *closure)
727 : {
728 4 : struct security_ace_object *object = pytalloc_get_ptr(py_obj);
729 4 : if (value == NULL) {
730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
731 0 : return -1;
732 : }
733 : {
734 0 : union security_ace_object_type *type_switch_0;
735 4 : type_switch_0 = (union security_ace_object_type *)pyrpc_export_union(&security_ace_object_type_Type, pytalloc_get_mem_ctx(py_obj), object->flags & SEC_ACE_OBJECT_TYPE_PRESENT, value, "union security_ace_object_type");
736 4 : if (type_switch_0 == NULL) {
737 0 : return -1;
738 : }
739 4 : object->type = *type_switch_0;
740 : }
741 4 : return 0;
742 : }
743 :
744 28794 : static PyObject *py_security_ace_object_get_inherited_type(PyObject *obj, void *closure)
745 : {
746 28794 : struct security_ace_object *object = pytalloc_get_ptr(obj);
747 3647 : PyObject *py_inherited_type;
748 28794 : py_inherited_type = pyrpc_import_union(&security_ace_object_inherited_type_Type, pytalloc_get_mem_ctx(obj), object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, &object->inherited_type, "union security_ace_object_inherited_type");
749 28794 : if (py_inherited_type == NULL) {
750 0 : return NULL;
751 : }
752 25147 : return py_inherited_type;
753 : }
754 :
755 0 : static int py_security_ace_object_set_inherited_type(PyObject *py_obj, PyObject *value, void *closure)
756 : {
757 0 : struct security_ace_object *object = pytalloc_get_ptr(py_obj);
758 0 : if (value == NULL) {
759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->inherited_type");
760 0 : return -1;
761 : }
762 : {
763 0 : union security_ace_object_inherited_type *inherited_type_switch_0;
764 0 : inherited_type_switch_0 = (union security_ace_object_inherited_type *)pyrpc_export_union(&security_ace_object_inherited_type_Type, pytalloc_get_mem_ctx(py_obj), object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, value, "union security_ace_object_inherited_type");
765 0 : if (inherited_type_switch_0 == NULL) {
766 0 : return -1;
767 : }
768 0 : object->inherited_type = *inherited_type_switch_0;
769 : }
770 0 : return 0;
771 : }
772 :
773 : static PyGetSetDef py_security_ace_object_getsetters[] = {
774 : {
775 : .name = discard_const_p(char, "flags"),
776 : .get = py_security_ace_object_get_flags,
777 : .set = py_security_ace_object_set_flags,
778 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_flags")
779 : },
780 : {
781 : .name = discard_const_p(char, "type"),
782 : .get = py_security_ace_object_get_type,
783 : .set = py_security_ace_object_set_type,
784 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_type")
785 : },
786 : {
787 : .name = discard_const_p(char, "inherited_type"),
788 : .get = py_security_ace_object_get_inherited_type,
789 : .set = py_security_ace_object_set_inherited_type,
790 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_inherited_type")
791 : },
792 : { .name = NULL }
793 : };
794 :
795 0 : static PyObject *py_security_ace_object_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
796 : {
797 0 : return pytalloc_new(struct security_ace_object, type);
798 : }
799 :
800 :
801 : static PyTypeObject security_ace_object_Type = {
802 : PyVarObject_HEAD_INIT(NULL, 0)
803 : .tp_name = "security.ace_object",
804 : .tp_getset = py_security_ace_object_getsetters,
805 : .tp_methods = NULL,
806 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
807 : .tp_new = py_security_ace_object_new,
808 : };
809 :
810 0 : static PyObject *py_import_claim_values(TALLOC_CTX *mem_ctx, int level, union claim_values *in)
811 : {
812 0 : PyObject *ret;
813 :
814 0 : switch (level) {
815 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64:
816 0 : if (in->int_value == NULL) {
817 0 : ret = Py_None;
818 0 : Py_INCREF(ret);
819 : } else {
820 0 : ret = PyLong_FromLongLong(*in->int_value);
821 : }
822 0 : return ret;
823 :
824 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64:
825 0 : if (in->uint_value == NULL) {
826 0 : ret = Py_None;
827 0 : Py_INCREF(ret);
828 : } else {
829 0 : ret = PyLong_FromUnsignedLongLong(*in->uint_value);
830 : }
831 0 : return ret;
832 :
833 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING:
834 0 : if (in->string_value == NULL) {
835 0 : ret = Py_None;
836 0 : Py_INCREF(ret);
837 : } else {
838 0 : ret = PyString_FromStringOrNULL(in->string_value);
839 : }
840 0 : return ret;
841 :
842 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_SID:
843 0 : if (in->sid_value == NULL) {
844 0 : ret = Py_None;
845 0 : Py_INCREF(ret);
846 : } else {
847 0 : ret = PyBytes_FromStringAndSize((char *)(*in->sid_value).data, (*in->sid_value).length);
848 : }
849 0 : return ret;
850 :
851 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING:
852 0 : if (in->octet_value == NULL) {
853 0 : ret = Py_None;
854 0 : Py_INCREF(ret);
855 : } else {
856 0 : ret = PyBytes_FromStringAndSize((char *)(*in->octet_value).data, (*in->octet_value).length);
857 : }
858 0 : return ret;
859 :
860 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN:
861 0 : if (in->uint_value == NULL) {
862 0 : ret = Py_None;
863 0 : Py_INCREF(ret);
864 : } else {
865 0 : ret = PyLong_FromUnsignedLongLong(*in->uint_value);
866 : }
867 0 : return ret;
868 :
869 : }
870 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
871 0 : return NULL;
872 : }
873 :
874 4538 : static union claim_values *py_export_claim_values(TALLOC_CTX *mem_ctx, int level, PyObject *in)
875 : {
876 4538 : union claim_values *ret = talloc_zero(mem_ctx, union claim_values);
877 4538 : switch (level) {
878 2 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64:
879 2 : if (in == NULL) {
880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->int_value");
881 0 : talloc_free(ret); return NULL;
882 : }
883 2 : if (in == Py_None) {
884 0 : ret->int_value = NULL;
885 : } else {
886 2 : ret->int_value = talloc_ptrtype(mem_ctx, ret->int_value);
887 2 : if (ret->int_value == NULL) {
888 0 : PyErr_NoMemory();
889 0 : talloc_free(ret); return NULL;
890 : }
891 : {
892 2 : const long long int_max = ndr_sizeof2intmax(sizeof(*ret->int_value));
893 2 : const long long int_min = -int_max - 1;
894 2 : if (PyLong_Check(in)) {
895 2 : long long test_var;
896 2 : test_var = PyLong_AsLongLong(in);
897 2 : if (PyErr_Occurred() != NULL) {
898 0 : talloc_free(ret); return NULL;
899 : }
900 2 : if (test_var < int_min || test_var > int_max) {
901 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
902 : PyLong_Type.tp_name, int_min, int_max, test_var);
903 0 : talloc_free(ret); return NULL;
904 : }
905 2 : *ret->int_value = test_var;
906 : } else {
907 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
908 : PyLong_Type.tp_name);
909 0 : talloc_free(ret); return NULL;
910 : }
911 : }
912 : }
913 0 : break;
914 :
915 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64:
916 0 : if (in == NULL) {
917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->uint_value");
918 0 : talloc_free(ret); return NULL;
919 : }
920 0 : if (in == Py_None) {
921 0 : ret->uint_value = NULL;
922 : } else {
923 0 : ret->uint_value = talloc_ptrtype(mem_ctx, ret->uint_value);
924 0 : if (ret->uint_value == NULL) {
925 0 : PyErr_NoMemory();
926 0 : talloc_free(ret); return NULL;
927 : }
928 : {
929 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*ret->uint_value));
930 0 : if (PyLong_Check(in)) {
931 0 : unsigned long long test_var;
932 0 : test_var = PyLong_AsUnsignedLongLong(in);
933 0 : if (PyErr_Occurred() != NULL) {
934 0 : talloc_free(ret); return NULL;
935 : }
936 0 : if (test_var > uint_max) {
937 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
938 : PyLong_Type.tp_name, uint_max, test_var);
939 0 : talloc_free(ret); return NULL;
940 : }
941 0 : *ret->uint_value = test_var;
942 : } else {
943 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
944 : PyLong_Type.tp_name);
945 0 : talloc_free(ret); return NULL;
946 : }
947 : }
948 : }
949 0 : break;
950 :
951 4536 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING:
952 4536 : if (in == NULL) {
953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->string_value");
954 0 : talloc_free(ret); return NULL;
955 : }
956 4536 : if (in == Py_None) {
957 0 : ret->string_value = NULL;
958 : } else {
959 4536 : ret->string_value = NULL;
960 : {
961 4536 : const char *test_str;
962 4536 : const char *talloc_str;
963 4536 : PyObject *unicode = NULL;
964 4536 : if (PyUnicode_Check(in)) {
965 4536 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
966 4536 : if (unicode == NULL) {
967 0 : talloc_free(ret); return NULL;
968 : }
969 4536 : test_str = PyBytes_AS_STRING(unicode);
970 0 : } else if (PyBytes_Check(in)) {
971 0 : test_str = PyBytes_AS_STRING(in);
972 : } else {
973 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
974 0 : talloc_free(ret); return NULL;
975 : }
976 4536 : talloc_str = talloc_strdup(mem_ctx, test_str);
977 4536 : if (unicode != NULL) {
978 4536 : Py_DECREF(unicode);
979 : }
980 4536 : if (talloc_str == NULL) {
981 0 : PyErr_NoMemory();
982 0 : talloc_free(ret); return NULL;
983 : }
984 4536 : ret->string_value = talloc_str;
985 : }
986 : }
987 0 : break;
988 :
989 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_SID:
990 0 : if (in == NULL) {
991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->sid_value");
992 0 : talloc_free(ret); return NULL;
993 : }
994 0 : if (in == Py_None) {
995 0 : ret->sid_value = NULL;
996 : } else {
997 0 : ret->sid_value = talloc_ptrtype(mem_ctx, ret->sid_value);
998 0 : if (ret->sid_value == NULL) {
999 0 : PyErr_NoMemory();
1000 0 : talloc_free(ret); return NULL;
1001 : }
1002 0 : *ret->sid_value = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1003 : }
1004 0 : break;
1005 :
1006 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING:
1007 0 : if (in == NULL) {
1008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->octet_value");
1009 0 : talloc_free(ret); return NULL;
1010 : }
1011 0 : if (in == Py_None) {
1012 0 : ret->octet_value = NULL;
1013 : } else {
1014 0 : ret->octet_value = talloc_ptrtype(mem_ctx, ret->octet_value);
1015 0 : if (ret->octet_value == NULL) {
1016 0 : PyErr_NoMemory();
1017 0 : talloc_free(ret); return NULL;
1018 : }
1019 0 : *ret->octet_value = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1020 : }
1021 0 : break;
1022 :
1023 0 : case CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN:
1024 0 : if (in == NULL) {
1025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->uint_value");
1026 0 : talloc_free(ret); return NULL;
1027 : }
1028 0 : if (in == Py_None) {
1029 0 : ret->uint_value = NULL;
1030 : } else {
1031 0 : ret->uint_value = talloc_ptrtype(mem_ctx, ret->uint_value);
1032 0 : if (ret->uint_value == NULL) {
1033 0 : PyErr_NoMemory();
1034 0 : talloc_free(ret); return NULL;
1035 : }
1036 : {
1037 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*ret->uint_value));
1038 0 : if (PyLong_Check(in)) {
1039 0 : unsigned long long test_var;
1040 0 : test_var = PyLong_AsUnsignedLongLong(in);
1041 0 : if (PyErr_Occurred() != NULL) {
1042 0 : talloc_free(ret); return NULL;
1043 : }
1044 0 : if (test_var > uint_max) {
1045 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1046 : PyLong_Type.tp_name, uint_max, test_var);
1047 0 : talloc_free(ret); return NULL;
1048 : }
1049 0 : *ret->uint_value = test_var;
1050 : } else {
1051 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1052 : PyLong_Type.tp_name);
1053 0 : talloc_free(ret); return NULL;
1054 : }
1055 : }
1056 : }
1057 0 : break;
1058 :
1059 0 : default:
1060 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
1061 0 : talloc_free(ret);
1062 0 : ret = NULL;
1063 : }
1064 :
1065 0 : return ret;
1066 : }
1067 :
1068 0 : static PyObject *py_claim_values_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1069 : {
1070 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1071 0 : PyObject *mem_ctx_obj = NULL;
1072 0 : TALLOC_CTX *mem_ctx = NULL;
1073 0 : int level = 0;
1074 0 : PyObject *in_obj = NULL;
1075 0 : union claim_values *in = NULL;
1076 :
1077 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1078 : discard_const_p(char *, kwnames),
1079 : &mem_ctx_obj,
1080 : &level,
1081 : &in_obj)) {
1082 0 : return NULL;
1083 : }
1084 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1085 0 : if (mem_ctx == NULL) {
1086 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1087 0 : return NULL;
1088 : }
1089 0 : in = (union claim_values *)pytalloc_get_ptr(in_obj);
1090 0 : if (in == NULL) {
1091 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union claim_values!");
1092 0 : return NULL;
1093 : }
1094 :
1095 0 : return py_import_claim_values(mem_ctx, level, in);
1096 : }
1097 :
1098 4538 : static PyObject *py_claim_values_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1099 : {
1100 4538 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1101 4538 : PyObject *mem_ctx_obj = NULL;
1102 4538 : TALLOC_CTX *mem_ctx = NULL;
1103 4538 : int level = 0;
1104 4538 : PyObject *in = NULL;
1105 4538 : union claim_values *out = NULL;
1106 :
1107 4538 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1108 : discard_const_p(char *, kwnames),
1109 : &mem_ctx_obj,
1110 : &level,
1111 : &in)) {
1112 0 : return NULL;
1113 : }
1114 4538 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1115 4538 : if (mem_ctx == NULL) {
1116 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1117 0 : return NULL;
1118 : }
1119 :
1120 4538 : out = py_export_claim_values(mem_ctx, level, in);
1121 4538 : if (out == NULL) {
1122 0 : return NULL;
1123 : }
1124 :
1125 4538 : return pytalloc_GenericObject_reference(out);
1126 : }
1127 :
1128 : static PyMethodDef py_claim_values_methods[] = {
1129 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_claim_values_import),
1130 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1131 : "T.__import__(mem_ctx, level, in) => ret." },
1132 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_claim_values_export),
1133 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1134 : "T.__export__(mem_ctx, level, in) => ret." },
1135 : { NULL, NULL, 0, NULL }
1136 : };
1137 :
1138 0 : static PyObject *py_claim_values_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1139 : {
1140 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1141 0 : return NULL;
1142 : }
1143 :
1144 :
1145 : static PyTypeObject claim_values_Type = {
1146 : PyVarObject_HEAD_INIT(NULL, 0)
1147 : .tp_name = "security.claim_values",
1148 : .tp_getset = NULL,
1149 : .tp_methods = py_claim_values_methods,
1150 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1151 : .tp_new = py_claim_values_new,
1152 : };
1153 :
1154 :
1155 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_name(PyObject *obj, void *closure)
1156 : {
1157 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(obj);
1158 0 : PyObject *py_name;
1159 0 : if (object->name == NULL) {
1160 0 : Py_RETURN_NONE;
1161 : }
1162 0 : if (object->name == NULL) {
1163 0 : py_name = Py_None;
1164 0 : Py_INCREF(py_name);
1165 : } else {
1166 0 : py_name = PyString_FromStringOrNULL(object->name);
1167 : }
1168 0 : return py_name;
1169 : }
1170 :
1171 132 : static int py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_name(PyObject *py_obj, PyObject *value, void *closure)
1172 : {
1173 132 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1174 132 : if (value == NULL) {
1175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
1176 0 : return -1;
1177 : }
1178 132 : if (value == Py_None) {
1179 0 : object->name = NULL;
1180 : } else {
1181 132 : object->name = NULL;
1182 : {
1183 132 : const char *test_str;
1184 132 : const char *talloc_str;
1185 132 : PyObject *unicode = NULL;
1186 132 : if (PyUnicode_Check(value)) {
1187 132 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1188 132 : if (unicode == NULL) {
1189 0 : return -1;
1190 : }
1191 132 : test_str = PyBytes_AS_STRING(unicode);
1192 0 : } else if (PyBytes_Check(value)) {
1193 0 : test_str = PyBytes_AS_STRING(value);
1194 : } else {
1195 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1196 0 : return -1;
1197 : }
1198 132 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1199 132 : if (unicode != NULL) {
1200 132 : Py_DECREF(unicode);
1201 : }
1202 132 : if (talloc_str == NULL) {
1203 0 : PyErr_NoMemory();
1204 0 : return -1;
1205 : }
1206 132 : object->name = talloc_str;
1207 : }
1208 : }
1209 0 : return 0;
1210 : }
1211 :
1212 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_value_type(PyObject *obj, void *closure)
1213 : {
1214 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(obj);
1215 0 : PyObject *py_value_type;
1216 0 : py_value_type = PyLong_FromLong((uint16_t)(object->value_type));
1217 0 : return py_value_type;
1218 : }
1219 :
1220 71 : static int py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_value_type(PyObject *py_obj, PyObject *value, void *closure)
1221 : {
1222 71 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1223 71 : if (value == NULL) {
1224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->value_type");
1225 0 : return -1;
1226 : }
1227 : {
1228 71 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->value_type));
1229 71 : if (PyLong_Check(value)) {
1230 71 : unsigned long long test_var;
1231 71 : test_var = PyLong_AsUnsignedLongLong(value);
1232 71 : if (PyErr_Occurred() != NULL) {
1233 0 : return -1;
1234 : }
1235 71 : if (test_var > uint_max) {
1236 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1237 : PyLong_Type.tp_name, uint_max, test_var);
1238 0 : return -1;
1239 : }
1240 71 : object->value_type = test_var;
1241 : } else {
1242 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1243 : PyLong_Type.tp_name);
1244 0 : return -1;
1245 : }
1246 : }
1247 71 : return 0;
1248 : }
1249 :
1250 8 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_flags(PyObject *obj, void *closure)
1251 : {
1252 8 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(obj);
1253 8 : PyObject *py_flags;
1254 8 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
1255 8 : return py_flags;
1256 : }
1257 :
1258 8 : static int py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_flags(PyObject *py_obj, PyObject *value, void *closure)
1259 : {
1260 8 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1261 8 : if (value == NULL) {
1262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
1263 0 : return -1;
1264 : }
1265 : {
1266 8 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
1267 8 : if (PyLong_Check(value)) {
1268 8 : unsigned long long test_var;
1269 8 : test_var = PyLong_AsUnsignedLongLong(value);
1270 8 : if (PyErr_Occurred() != NULL) {
1271 0 : return -1;
1272 : }
1273 8 : if (test_var > uint_max) {
1274 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1275 : PyLong_Type.tp_name, uint_max, test_var);
1276 0 : return -1;
1277 : }
1278 8 : object->flags = test_var;
1279 : } else {
1280 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1281 : PyLong_Type.tp_name);
1282 0 : return -1;
1283 : }
1284 : }
1285 8 : return 0;
1286 : }
1287 :
1288 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_value_count(PyObject *obj, void *closure)
1289 : {
1290 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(obj);
1291 0 : PyObject *py_value_count;
1292 0 : py_value_count = PyLong_FromUnsignedLongLong((uint32_t)(object->value_count));
1293 0 : return py_value_count;
1294 : }
1295 :
1296 71 : static int py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_value_count(PyObject *py_obj, PyObject *value, void *closure)
1297 : {
1298 71 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1299 71 : if (value == NULL) {
1300 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->value_count");
1301 0 : return -1;
1302 : }
1303 : {
1304 71 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->value_count));
1305 71 : if (PyLong_Check(value)) {
1306 71 : unsigned long long test_var;
1307 71 : test_var = PyLong_AsUnsignedLongLong(value);
1308 71 : if (PyErr_Occurred() != NULL) {
1309 0 : return -1;
1310 : }
1311 71 : if (test_var > uint_max) {
1312 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1313 : PyLong_Type.tp_name, uint_max, test_var);
1314 0 : return -1;
1315 : }
1316 71 : object->value_count = test_var;
1317 : } else {
1318 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1319 : PyLong_Type.tp_name);
1320 0 : return -1;
1321 : }
1322 : }
1323 71 : return 0;
1324 : }
1325 :
1326 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_values(PyObject *obj, void *closure)
1327 : {
1328 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(obj);
1329 0 : PyObject *py_values;
1330 0 : py_values = PyList_New(object->value_count);
1331 0 : if (py_values == NULL) {
1332 0 : return NULL;
1333 : }
1334 : {
1335 : int values_cntr_0;
1336 0 : for (values_cntr_0 = 0; values_cntr_0 < (object->value_count); values_cntr_0++) {
1337 0 : PyObject *py_values_0;
1338 0 : py_values_0 = pyrpc_import_union(&claim_values_Type, object->values, object->value_type, &(object->values)[values_cntr_0], "union claim_values");
1339 0 : if (py_values_0 == NULL) {
1340 0 : return NULL;
1341 : }
1342 0 : PyList_SetItem(py_values, values_cntr_0, py_values_0);
1343 : }
1344 : }
1345 0 : return py_values;
1346 : }
1347 :
1348 71 : static int py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_values(PyObject *py_obj, PyObject *value, void *closure)
1349 : {
1350 71 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1351 71 : if (value == NULL) {
1352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->values");
1353 0 : return -1;
1354 : }
1355 71 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1356 : {
1357 71 : int values_cntr_0;
1358 71 : object->values = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->values, PyList_GET_SIZE(value));
1359 71 : if (!object->values) { return -1; }
1360 71 : talloc_set_name_const(object->values, "ARRAY: object->values");
1361 4680 : for (values_cntr_0 = 0; values_cntr_0 < PyList_GET_SIZE(value); values_cntr_0++) {
1362 4538 : if (PyList_GET_ITEM(value, values_cntr_0) == NULL) {
1363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->values)[values_cntr_0]");
1364 0 : return -1;
1365 : }
1366 : {
1367 4538 : union claim_values *values_switch_1;
1368 4538 : values_switch_1 = (union claim_values *)pyrpc_export_union(&claim_values_Type, object->values, object->value_type, PyList_GET_ITEM(value, values_cntr_0), "union claim_values");
1369 4538 : if (values_switch_1 == NULL) {
1370 0 : return -1;
1371 : }
1372 4538 : (object->values)[values_cntr_0] = *values_switch_1;
1373 : }
1374 : }
1375 : }
1376 0 : return 0;
1377 : }
1378 :
1379 : static PyGetSetDef py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_getsetters[] = {
1380 : {
1381 : .name = discard_const_p(char, "name"),
1382 : .get = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_name,
1383 : .set = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_name,
1384 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1385 : },
1386 : {
1387 : .name = discard_const_p(char, "value_type"),
1388 : .get = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_value_type,
1389 : .set = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_value_type,
1390 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1391 : },
1392 : {
1393 : .name = discard_const_p(char, "flags"),
1394 : .get = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_flags,
1395 : .set = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_flags,
1396 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1397 : },
1398 : {
1399 : .name = discard_const_p(char, "value_count"),
1400 : .get = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_value_count,
1401 : .set = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_value_count,
1402 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1403 : },
1404 : {
1405 : .name = discard_const_p(char, "values"),
1406 : .get = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_get_values,
1407 : .set = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_set_values,
1408 : .doc = discard_const_p(char, "PIDL-generated element of base type claim_values")
1409 : },
1410 : { .name = NULL }
1411 : };
1412 :
1413 71 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1414 : {
1415 71 : return pytalloc_new(struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1, type);
1416 : }
1417 :
1418 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1419 : {
1420 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1421 0 : PyObject *ret = NULL;
1422 0 : DATA_BLOB blob;
1423 0 : enum ndr_err_code err;
1424 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1425 0 : if (tmp_ctx == NULL) {
1426 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1427 0 : return NULL;
1428 : }
1429 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1);
1430 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1431 0 : TALLOC_FREE(tmp_ctx);
1432 0 : PyErr_SetNdrError(err);
1433 0 : return NULL;
1434 : }
1435 :
1436 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1437 0 : TALLOC_FREE(tmp_ctx);
1438 0 : return ret;
1439 : }
1440 :
1441 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1442 : {
1443 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1444 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1445 0 : Py_ssize_t blob_length = 0;
1446 0 : enum ndr_err_code err;
1447 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1448 0 : PyObject *allow_remaining_obj = NULL;
1449 0 : bool allow_remaining = false;
1450 :
1451 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1452 : discard_const_p(char *, kwnames),
1453 : &blob.data, &blob_length,
1454 : &allow_remaining_obj)) {
1455 0 : return NULL;
1456 : }
1457 0 : blob.length = blob_length;
1458 :
1459 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1460 0 : allow_remaining = true;
1461 : }
1462 :
1463 0 : if (allow_remaining) {
1464 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1);
1465 : } else {
1466 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1);
1467 : }
1468 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1469 0 : PyErr_SetNdrError(err);
1470 0 : return NULL;
1471 : }
1472 :
1473 0 : Py_RETURN_NONE;
1474 : }
1475 :
1476 0 : static PyObject *py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1477 : {
1478 0 : struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *object = pytalloc_get_ptr(py_obj);
1479 0 : PyObject *ret;
1480 0 : char *retstr;
1481 :
1482 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1, "CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1", object);
1483 0 : ret = PyUnicode_FromString(retstr);
1484 0 : talloc_free(retstr);
1485 :
1486 0 : return ret;
1487 : }
1488 :
1489 : static PyMethodDef py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_methods[] = {
1490 : { "__ndr_pack__", (PyCFunction)py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1491 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1492 : { "__ndr_print__", (PyCFunction)py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1493 : { NULL, NULL, 0, NULL }
1494 : };
1495 :
1496 :
1497 : static PyTypeObject CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type = {
1498 : PyVarObject_HEAD_INIT(NULL, 0)
1499 : .tp_name = "security.CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1",
1500 : .tp_getset = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_getsetters,
1501 : .tp_methods = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_methods,
1502 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1503 : .tp_new = py_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_new,
1504 : };
1505 :
1506 151119 : static PyObject *py_import_security_ace_object_ctr(TALLOC_CTX *mem_ctx, int level, union security_ace_object_ctr *in)
1507 : {
1508 16796 : PyObject *ret;
1509 :
1510 151119 : switch (level) {
1511 151119 : default:
1512 151119 : ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
1513 151119 : return ret;
1514 :
1515 0 : case false:
1516 0 : ret = Py_None;
1517 0 : Py_INCREF(ret);
1518 0 : return ret;
1519 :
1520 : }
1521 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1522 : return NULL;
1523 : }
1524 :
1525 0 : static union security_ace_object_ctr *py_export_security_ace_object_ctr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1526 : {
1527 0 : union security_ace_object_ctr *ret = talloc_zero(mem_ctx, union security_ace_object_ctr);
1528 0 : switch (level) {
1529 0 : default:
1530 0 : if (in == NULL) {
1531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->object");
1532 0 : talloc_free(ret); return NULL;
1533 : }
1534 0 : PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
1535 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1536 0 : PyErr_NoMemory();
1537 0 : talloc_free(ret); return NULL;
1538 : }
1539 0 : ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
1540 0 : break;
1541 :
1542 0 : case false:
1543 0 : break;
1544 :
1545 : }
1546 :
1547 0 : return ret;
1548 : }
1549 :
1550 151119 : static PyObject *py_security_ace_object_ctr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1551 : {
1552 151119 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1553 151119 : PyObject *mem_ctx_obj = NULL;
1554 151119 : TALLOC_CTX *mem_ctx = NULL;
1555 151119 : int level = 0;
1556 151119 : PyObject *in_obj = NULL;
1557 151119 : union security_ace_object_ctr *in = NULL;
1558 :
1559 151119 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1560 : discard_const_p(char *, kwnames),
1561 : &mem_ctx_obj,
1562 : &level,
1563 : &in_obj)) {
1564 0 : return NULL;
1565 : }
1566 151119 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1567 151119 : if (mem_ctx == NULL) {
1568 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1569 0 : return NULL;
1570 : }
1571 151119 : in = (union security_ace_object_ctr *)pytalloc_get_ptr(in_obj);
1572 151119 : if (in == NULL) {
1573 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_ctr!");
1574 0 : return NULL;
1575 : }
1576 :
1577 151119 : return py_import_security_ace_object_ctr(mem_ctx, level, in);
1578 : }
1579 :
1580 0 : static PyObject *py_security_ace_object_ctr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1581 : {
1582 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1583 0 : PyObject *mem_ctx_obj = NULL;
1584 0 : TALLOC_CTX *mem_ctx = NULL;
1585 0 : int level = 0;
1586 0 : PyObject *in = NULL;
1587 0 : union security_ace_object_ctr *out = NULL;
1588 :
1589 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1590 : discard_const_p(char *, kwnames),
1591 : &mem_ctx_obj,
1592 : &level,
1593 : &in)) {
1594 0 : return NULL;
1595 : }
1596 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1597 0 : if (mem_ctx == NULL) {
1598 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1599 0 : return NULL;
1600 : }
1601 :
1602 0 : out = py_export_security_ace_object_ctr(mem_ctx, level, in);
1603 0 : if (out == NULL) {
1604 0 : return NULL;
1605 : }
1606 :
1607 0 : return pytalloc_GenericObject_reference(out);
1608 : }
1609 :
1610 : static PyMethodDef py_security_ace_object_ctr_methods[] = {
1611 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_ctr_import),
1612 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1613 : "T.__import__(mem_ctx, level, in) => ret." },
1614 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_ctr_export),
1615 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1616 : "T.__export__(mem_ctx, level, in) => ret." },
1617 : { NULL, NULL, 0, NULL }
1618 : };
1619 :
1620 0 : static PyObject *py_security_ace_object_ctr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1621 : {
1622 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1623 0 : return NULL;
1624 : }
1625 :
1626 :
1627 : static PyTypeObject security_ace_object_ctr_Type = {
1628 : PyVarObject_HEAD_INIT(NULL, 0)
1629 : .tp_name = "security.ace_object_ctr",
1630 : .tp_getset = NULL,
1631 : .tp_methods = py_security_ace_object_ctr_methods,
1632 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1633 : .tp_new = py_security_ace_object_ctr_new,
1634 : };
1635 :
1636 0 : static PyObject *py_import_security_ace_coda(TALLOC_CTX *mem_ctx, int level, union security_ace_coda *in)
1637 : {
1638 0 : PyObject *ret;
1639 :
1640 0 : switch (level) {
1641 0 : case SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK:
1642 0 : ret = PyBytes_FromStringAndSize((char *)(in->conditions).data, (in->conditions).length);
1643 0 : return ret;
1644 :
1645 0 : case SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK:
1646 0 : ret = PyBytes_FromStringAndSize((char *)(in->conditions).data, (in->conditions).length);
1647 0 : return ret;
1648 :
1649 0 : case SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT:
1650 0 : ret = PyBytes_FromStringAndSize((char *)(in->conditions).data, (in->conditions).length);
1651 0 : return ret;
1652 :
1653 0 : case SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT:
1654 0 : ret = PyBytes_FromStringAndSize((char *)(in->conditions).data, (in->conditions).length);
1655 0 : return ret;
1656 :
1657 0 : case SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK:
1658 0 : ret = PyBytes_FromStringAndSize((char *)(in->conditions).data, (in->conditions).length);
1659 0 : return ret;
1660 :
1661 0 : case SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT:
1662 0 : ret = PyBytes_FromStringAndSize((char *)(in->conditions).data, (in->conditions).length);
1663 0 : return ret;
1664 :
1665 0 : case SEC_ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE:
1666 0 : ret = pytalloc_reference_ex(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, mem_ctx, &in->claim);
1667 0 : return ret;
1668 :
1669 0 : default:
1670 0 : ret = PyBytes_FromStringAndSize((char *)(in->ignored).data, (in->ignored).length);
1671 0 : return ret;
1672 :
1673 : }
1674 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1675 : return NULL;
1676 : }
1677 :
1678 0 : static union security_ace_coda *py_export_security_ace_coda(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1679 : {
1680 0 : union security_ace_coda *ret = talloc_zero(mem_ctx, union security_ace_coda);
1681 0 : switch (level) {
1682 0 : case SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK:
1683 0 : if (in == NULL) {
1684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->conditions");
1685 0 : talloc_free(ret); return NULL;
1686 : }
1687 0 : ret->conditions = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1688 0 : break;
1689 :
1690 0 : case SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK:
1691 0 : if (in == NULL) {
1692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->conditions");
1693 0 : talloc_free(ret); return NULL;
1694 : }
1695 0 : ret->conditions = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1696 0 : break;
1697 :
1698 0 : case SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT:
1699 0 : if (in == NULL) {
1700 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->conditions");
1701 0 : talloc_free(ret); return NULL;
1702 : }
1703 0 : ret->conditions = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1704 0 : break;
1705 :
1706 0 : case SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT:
1707 0 : if (in == NULL) {
1708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->conditions");
1709 0 : talloc_free(ret); return NULL;
1710 : }
1711 0 : ret->conditions = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1712 0 : break;
1713 :
1714 0 : case SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK:
1715 0 : if (in == NULL) {
1716 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->conditions");
1717 0 : talloc_free(ret); return NULL;
1718 : }
1719 0 : ret->conditions = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1720 0 : break;
1721 :
1722 0 : case SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT:
1723 0 : if (in == NULL) {
1724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->conditions");
1725 0 : talloc_free(ret); return NULL;
1726 : }
1727 0 : ret->conditions = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1728 0 : break;
1729 :
1730 0 : case SEC_ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE:
1731 0 : if (in == NULL) {
1732 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->claim");
1733 0 : talloc_free(ret); return NULL;
1734 : }
1735 0 : PY_CHECK_TYPE(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, in, talloc_free(ret); return NULL;);
1736 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1737 0 : PyErr_NoMemory();
1738 0 : talloc_free(ret); return NULL;
1739 : }
1740 0 : ret->claim = *(struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *)pytalloc_get_ptr(in);
1741 0 : break;
1742 :
1743 0 : default:
1744 0 : if (in == NULL) {
1745 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ignored");
1746 0 : talloc_free(ret); return NULL;
1747 : }
1748 0 : ret->ignored = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1749 0 : break;
1750 :
1751 : }
1752 :
1753 0 : return ret;
1754 : }
1755 :
1756 0 : static PyObject *py_security_ace_coda_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1757 : {
1758 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1759 0 : PyObject *mem_ctx_obj = NULL;
1760 0 : TALLOC_CTX *mem_ctx = NULL;
1761 0 : int level = 0;
1762 0 : PyObject *in_obj = NULL;
1763 0 : union security_ace_coda *in = NULL;
1764 :
1765 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1766 : discard_const_p(char *, kwnames),
1767 : &mem_ctx_obj,
1768 : &level,
1769 : &in_obj)) {
1770 0 : return NULL;
1771 : }
1772 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1773 0 : if (mem_ctx == NULL) {
1774 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1775 0 : return NULL;
1776 : }
1777 0 : in = (union security_ace_coda *)pytalloc_get_ptr(in_obj);
1778 0 : if (in == NULL) {
1779 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_coda!");
1780 0 : return NULL;
1781 : }
1782 :
1783 0 : return py_import_security_ace_coda(mem_ctx, level, in);
1784 : }
1785 :
1786 0 : static PyObject *py_security_ace_coda_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1787 : {
1788 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1789 0 : PyObject *mem_ctx_obj = NULL;
1790 0 : TALLOC_CTX *mem_ctx = NULL;
1791 0 : int level = 0;
1792 0 : PyObject *in = NULL;
1793 0 : union security_ace_coda *out = NULL;
1794 :
1795 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1796 : discard_const_p(char *, kwnames),
1797 : &mem_ctx_obj,
1798 : &level,
1799 : &in)) {
1800 0 : return NULL;
1801 : }
1802 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1803 0 : if (mem_ctx == NULL) {
1804 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1805 0 : return NULL;
1806 : }
1807 :
1808 0 : out = py_export_security_ace_coda(mem_ctx, level, in);
1809 0 : if (out == NULL) {
1810 0 : return NULL;
1811 : }
1812 :
1813 0 : return pytalloc_GenericObject_reference(out);
1814 : }
1815 :
1816 : static PyMethodDef py_security_ace_coda_methods[] = {
1817 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_coda_import),
1818 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1819 : "T.__import__(mem_ctx, level, in) => ret." },
1820 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_coda_export),
1821 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1822 : "T.__export__(mem_ctx, level, in) => ret." },
1823 : { NULL, NULL, 0, NULL }
1824 : };
1825 :
1826 0 : static PyObject *py_security_ace_coda_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1827 : {
1828 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1829 0 : return NULL;
1830 : }
1831 :
1832 :
1833 : static PyTypeObject security_ace_coda_Type = {
1834 : PyVarObject_HEAD_INIT(NULL, 0)
1835 : .tp_name = "security.ace_coda",
1836 : .tp_getset = NULL,
1837 : .tp_methods = py_security_ace_coda_methods,
1838 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1839 : .tp_new = py_security_ace_coda_new,
1840 : };
1841 :
1842 :
1843 5083985 : static PyObject *py_security_ace_get_type(PyObject *obj, void *closure)
1844 : {
1845 5083985 : struct security_ace *object = pytalloc_get_ptr(obj);
1846 869289 : PyObject *py_type;
1847 5083985 : py_type = PyLong_FromLong((uint16_t)(object->type));
1848 5083985 : return py_type;
1849 : }
1850 :
1851 10 : static int py_security_ace_set_type(PyObject *py_obj, PyObject *value, void *closure)
1852 : {
1853 10 : struct security_ace *object = pytalloc_get_ptr(py_obj);
1854 10 : if (value == NULL) {
1855 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
1856 0 : return -1;
1857 : }
1858 : {
1859 10 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1860 10 : if (PyLong_Check(value)) {
1861 0 : unsigned long long test_var;
1862 10 : test_var = PyLong_AsUnsignedLongLong(value);
1863 10 : if (PyErr_Occurred() != NULL) {
1864 0 : return -1;
1865 : }
1866 10 : if (test_var > uint_max) {
1867 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1868 : PyLong_Type.tp_name, uint_max, test_var);
1869 0 : return -1;
1870 : }
1871 10 : object->type = test_var;
1872 : } else {
1873 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1874 : PyLong_Type.tp_name);
1875 0 : return -1;
1876 : }
1877 : }
1878 10 : return 0;
1879 : }
1880 :
1881 5341272 : static PyObject *py_security_ace_get_flags(PyObject *obj, void *closure)
1882 : {
1883 5341272 : struct security_ace *object = pytalloc_get_ptr(obj);
1884 826812 : PyObject *py_flags;
1885 5341272 : py_flags = PyLong_FromLong((uint16_t)(object->flags));
1886 5341272 : return py_flags;
1887 : }
1888 :
1889 6210 : static int py_security_ace_set_flags(PyObject *py_obj, PyObject *value, void *closure)
1890 : {
1891 6210 : struct security_ace *object = pytalloc_get_ptr(py_obj);
1892 6210 : if (value == NULL) {
1893 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
1894 0 : return -1;
1895 : }
1896 : {
1897 6210 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
1898 6210 : if (PyLong_Check(value)) {
1899 360 : unsigned long long test_var;
1900 6210 : test_var = PyLong_AsUnsignedLongLong(value);
1901 6210 : if (PyErr_Occurred() != NULL) {
1902 0 : return -1;
1903 : }
1904 6210 : if (test_var > uint_max) {
1905 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1906 : PyLong_Type.tp_name, uint_max, test_var);
1907 0 : return -1;
1908 : }
1909 6210 : object->flags = test_var;
1910 : } else {
1911 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1912 : PyLong_Type.tp_name);
1913 0 : return -1;
1914 : }
1915 : }
1916 6210 : return 0;
1917 : }
1918 :
1919 0 : static PyObject *py_security_ace_get_size(PyObject *obj, void *closure)
1920 : {
1921 0 : struct security_ace *object = pytalloc_get_ptr(obj);
1922 0 : PyObject *py_size;
1923 0 : py_size = PyLong_FromLong((uint16_t)(object->size));
1924 0 : return py_size;
1925 : }
1926 :
1927 0 : static int py_security_ace_set_size(PyObject *py_obj, PyObject *value, void *closure)
1928 : {
1929 0 : struct security_ace *object = pytalloc_get_ptr(py_obj);
1930 0 : if (value == NULL) {
1931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
1932 0 : return -1;
1933 : }
1934 : {
1935 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1936 0 : if (PyLong_Check(value)) {
1937 0 : unsigned long long test_var;
1938 0 : test_var = PyLong_AsUnsignedLongLong(value);
1939 0 : if (PyErr_Occurred() != NULL) {
1940 0 : return -1;
1941 : }
1942 0 : if (test_var > uint_max) {
1943 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1944 : PyLong_Type.tp_name, uint_max, test_var);
1945 0 : return -1;
1946 : }
1947 0 : object->size = test_var;
1948 : } else {
1949 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1950 : PyLong_Type.tp_name);
1951 0 : return -1;
1952 : }
1953 : }
1954 0 : return 0;
1955 : }
1956 :
1957 5896 : static PyObject *py_security_ace_get_access_mask(PyObject *obj, void *closure)
1958 : {
1959 5896 : struct security_ace *object = pytalloc_get_ptr(obj);
1960 320 : PyObject *py_access_mask;
1961 5896 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->access_mask));
1962 5896 : return py_access_mask;
1963 : }
1964 :
1965 5880 : static int py_security_ace_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
1966 : {
1967 5880 : struct security_ace *object = pytalloc_get_ptr(py_obj);
1968 5880 : if (value == NULL) {
1969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->access_mask");
1970 0 : return -1;
1971 : }
1972 : {
1973 5880 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->access_mask));
1974 5880 : if (PyLong_Check(value)) {
1975 320 : unsigned long long test_var;
1976 5880 : test_var = PyLong_AsUnsignedLongLong(value);
1977 5880 : if (PyErr_Occurred() != NULL) {
1978 0 : return -1;
1979 : }
1980 5880 : if (test_var > uint_max) {
1981 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1982 : PyLong_Type.tp_name, uint_max, test_var);
1983 0 : return -1;
1984 : }
1985 5880 : object->access_mask = test_var;
1986 : } else {
1987 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1988 : PyLong_Type.tp_name);
1989 0 : return -1;
1990 : }
1991 : }
1992 5880 : return 0;
1993 : }
1994 :
1995 151119 : static PyObject *py_security_ace_get_object(PyObject *obj, void *closure)
1996 : {
1997 151119 : struct security_ace *object = pytalloc_get_ptr(obj);
1998 16796 : PyObject *py_object;
1999 151119 : py_object = pyrpc_import_union(&security_ace_object_ctr_Type, pytalloc_get_mem_ctx(obj), sec_ace_object(object->type), &object->object, "union security_ace_object_ctr");
2000 151119 : if (py_object == NULL) {
2001 0 : return NULL;
2002 : }
2003 134323 : return py_object;
2004 : }
2005 :
2006 0 : static int py_security_ace_set_object(PyObject *py_obj, PyObject *value, void *closure)
2007 : {
2008 0 : struct security_ace *object = pytalloc_get_ptr(py_obj);
2009 0 : if (value == NULL) {
2010 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->object");
2011 0 : return -1;
2012 : }
2013 : {
2014 0 : union security_ace_object_ctr *object_switch_0;
2015 0 : object_switch_0 = (union security_ace_object_ctr *)pyrpc_export_union(&security_ace_object_ctr_Type, pytalloc_get_mem_ctx(py_obj), sec_ace_object(object->type), value, "union security_ace_object_ctr");
2016 0 : if (object_switch_0 == NULL) {
2017 0 : return -1;
2018 : }
2019 0 : object->object = *object_switch_0;
2020 : }
2021 0 : return 0;
2022 : }
2023 :
2024 14313 : static PyObject *py_security_ace_get_trustee(PyObject *obj, void *closure)
2025 : {
2026 14313 : struct security_ace *object = pytalloc_get_ptr(obj);
2027 640 : PyObject *py_trustee;
2028 14313 : py_trustee = pytalloc_reference_ex(&dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->trustee);
2029 14313 : return py_trustee;
2030 : }
2031 :
2032 201 : static int py_security_ace_set_trustee(PyObject *py_obj, PyObject *value, void *closure)
2033 : {
2034 201 : struct security_ace *object = pytalloc_get_ptr(py_obj);
2035 201 : if (value == NULL) {
2036 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->trustee");
2037 0 : return -1;
2038 : }
2039 201 : PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
2040 201 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2041 0 : PyErr_NoMemory();
2042 0 : return -1;
2043 : }
2044 201 : object->trustee = *(struct dom_sid *)pytalloc_get_ptr(value);
2045 201 : return 0;
2046 : }
2047 :
2048 0 : static PyObject *py_security_ace_get_coda(PyObject *obj, void *closure)
2049 : {
2050 0 : struct security_ace *object = pytalloc_get_ptr(obj);
2051 0 : PyObject *py_coda;
2052 0 : py_coda = pyrpc_import_union(&security_ace_coda_Type, pytalloc_get_mem_ctx(obj), object->type, &object->coda, "union security_ace_coda");
2053 0 : if (py_coda == NULL) {
2054 0 : return NULL;
2055 : }
2056 0 : return py_coda;
2057 : }
2058 :
2059 0 : static int py_security_ace_set_coda(PyObject *py_obj, PyObject *value, void *closure)
2060 : {
2061 0 : struct security_ace *object = pytalloc_get_ptr(py_obj);
2062 0 : if (value == NULL) {
2063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->coda");
2064 0 : return -1;
2065 : }
2066 : {
2067 0 : union security_ace_coda *coda_switch_1;
2068 0 : coda_switch_1 = (union security_ace_coda *)pyrpc_export_union(&security_ace_coda_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union security_ace_coda");
2069 0 : if (coda_switch_1 == NULL) {
2070 0 : return -1;
2071 : }
2072 0 : object->coda = *coda_switch_1;
2073 : }
2074 0 : return 0;
2075 : }
2076 :
2077 : static PyGetSetDef py_security_ace_getsetters[] = {
2078 : {
2079 : .name = discard_const_p(char, "type"),
2080 : .get = py_security_ace_get_type,
2081 : .set = py_security_ace_set_type,
2082 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_type")
2083 : },
2084 : {
2085 : .name = discard_const_p(char, "flags"),
2086 : .get = py_security_ace_get_flags,
2087 : .set = py_security_ace_set_flags,
2088 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_flags")
2089 : },
2090 : {
2091 : .name = discard_const_p(char, "size"),
2092 : .get = py_security_ace_get_size,
2093 : .set = py_security_ace_set_size,
2094 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2095 : },
2096 : {
2097 : .name = discard_const_p(char, "access_mask"),
2098 : .get = py_security_ace_get_access_mask,
2099 : .set = py_security_ace_set_access_mask,
2100 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2101 : },
2102 : {
2103 : .name = discard_const_p(char, "object"),
2104 : .get = py_security_ace_get_object,
2105 : .set = py_security_ace_set_object,
2106 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_ctr")
2107 : },
2108 : {
2109 : .name = discard_const_p(char, "trustee"),
2110 : .get = py_security_ace_get_trustee,
2111 : .set = py_security_ace_set_trustee,
2112 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
2113 : },
2114 : {
2115 : .name = discard_const_p(char, "coda"),
2116 : .get = py_security_ace_get_coda,
2117 : .set = py_security_ace_set_coda,
2118 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_coda")
2119 : },
2120 : { .name = NULL }
2121 : };
2122 :
2123 21 : static PyObject *py_security_ace_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2124 : {
2125 21 : return pytalloc_new(struct security_ace, type);
2126 : }
2127 :
2128 0 : static PyObject *py_security_ace_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2129 : {
2130 0 : struct security_ace *object = pytalloc_get_ptr(py_obj);
2131 0 : PyObject *ret = NULL;
2132 0 : DATA_BLOB blob;
2133 0 : enum ndr_err_code err;
2134 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2135 0 : if (tmp_ctx == NULL) {
2136 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2137 0 : return NULL;
2138 : }
2139 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_ace);
2140 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2141 0 : TALLOC_FREE(tmp_ctx);
2142 0 : PyErr_SetNdrError(err);
2143 0 : return NULL;
2144 : }
2145 :
2146 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2147 0 : TALLOC_FREE(tmp_ctx);
2148 0 : return ret;
2149 : }
2150 :
2151 0 : static PyObject *py_security_ace_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2152 : {
2153 0 : struct security_ace *object = pytalloc_get_ptr(py_obj);
2154 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2155 0 : Py_ssize_t blob_length = 0;
2156 0 : enum ndr_err_code err;
2157 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2158 0 : PyObject *allow_remaining_obj = NULL;
2159 0 : bool allow_remaining = false;
2160 :
2161 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2162 : discard_const_p(char *, kwnames),
2163 : &blob.data, &blob_length,
2164 : &allow_remaining_obj)) {
2165 0 : return NULL;
2166 : }
2167 0 : blob.length = blob_length;
2168 :
2169 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2170 0 : allow_remaining = true;
2171 : }
2172 :
2173 0 : if (allow_remaining) {
2174 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
2175 : } else {
2176 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
2177 : }
2178 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2179 0 : PyErr_SetNdrError(err);
2180 0 : return NULL;
2181 : }
2182 :
2183 0 : Py_RETURN_NONE;
2184 : }
2185 :
2186 0 : static PyObject *py_security_ace_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2187 : {
2188 0 : struct security_ace *object = pytalloc_get_ptr(py_obj);
2189 0 : PyObject *ret;
2190 0 : char *retstr;
2191 :
2192 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_ace, "security_ace", object);
2193 0 : ret = PyUnicode_FromString(retstr);
2194 0 : talloc_free(retstr);
2195 :
2196 0 : return ret;
2197 : }
2198 :
2199 : static PyMethodDef py_security_ace_methods[] = {
2200 : { "__ndr_pack__", (PyCFunction)py_security_ace_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2201 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2202 : { "__ndr_print__", (PyCFunction)py_security_ace_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2203 : { NULL, NULL, 0, NULL }
2204 : };
2205 :
2206 :
2207 : static PyTypeObject security_ace_Type = {
2208 : PyVarObject_HEAD_INIT(NULL, 0)
2209 : .tp_name = "security.ace",
2210 : .tp_getset = py_security_ace_getsetters,
2211 : .tp_methods = py_security_ace_methods,
2212 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2213 : .tp_new = py_security_ace_new,
2214 : };
2215 :
2216 :
2217 0 : static PyObject *py_security_acl_get_revision(PyObject *obj, void *closure)
2218 : {
2219 0 : struct security_acl *object = pytalloc_get_ptr(obj);
2220 0 : PyObject *py_revision;
2221 0 : py_revision = PyLong_FromLong((uint16_t)(object->revision));
2222 0 : return py_revision;
2223 : }
2224 :
2225 11487 : static int py_security_acl_set_revision(PyObject *py_obj, PyObject *value, void *closure)
2226 : {
2227 11487 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2228 11487 : if (value == NULL) {
2229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->revision");
2230 0 : return -1;
2231 : }
2232 : {
2233 11487 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
2234 11487 : if (PyLong_Check(value)) {
2235 11476 : unsigned long long test_var;
2236 11487 : test_var = PyLong_AsUnsignedLongLong(value);
2237 11487 : if (PyErr_Occurred() != NULL) {
2238 0 : return -1;
2239 : }
2240 11487 : if (test_var > uint_max) {
2241 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2242 : PyLong_Type.tp_name, uint_max, test_var);
2243 0 : return -1;
2244 : }
2245 11487 : object->revision = test_var;
2246 : } else {
2247 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2248 : PyLong_Type.tp_name);
2249 0 : return -1;
2250 : }
2251 : }
2252 11487 : return 0;
2253 : }
2254 :
2255 0 : static PyObject *py_security_acl_get_size(PyObject *obj, void *closure)
2256 : {
2257 0 : struct security_acl *object = pytalloc_get_ptr(obj);
2258 0 : PyObject *py_size;
2259 0 : py_size = PyLong_FromLong((uint16_t)(object->size));
2260 0 : return py_size;
2261 : }
2262 :
2263 0 : static int py_security_acl_set_size(PyObject *py_obj, PyObject *value, void *closure)
2264 : {
2265 0 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2266 0 : if (value == NULL) {
2267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
2268 0 : return -1;
2269 : }
2270 : {
2271 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
2272 0 : if (PyLong_Check(value)) {
2273 0 : unsigned long long test_var;
2274 0 : test_var = PyLong_AsUnsignedLongLong(value);
2275 0 : if (PyErr_Occurred() != NULL) {
2276 0 : return -1;
2277 : }
2278 0 : if (test_var > uint_max) {
2279 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2280 : PyLong_Type.tp_name, uint_max, test_var);
2281 0 : return -1;
2282 : }
2283 0 : object->size = test_var;
2284 : } else {
2285 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2286 : PyLong_Type.tp_name);
2287 0 : return -1;
2288 : }
2289 : }
2290 0 : return 0;
2291 : }
2292 :
2293 0 : static PyObject *py_security_acl_get_num_aces(PyObject *obj, void *closure)
2294 : {
2295 0 : struct security_acl *object = pytalloc_get_ptr(obj);
2296 0 : PyObject *py_num_aces;
2297 0 : py_num_aces = PyLong_FromUnsignedLongLong((uint32_t)(object->num_aces));
2298 0 : return py_num_aces;
2299 : }
2300 :
2301 17 : static int py_security_acl_set_num_aces(PyObject *py_obj, PyObject *value, void *closure)
2302 : {
2303 17 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2304 17 : if (value == NULL) {
2305 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_aces");
2306 0 : return -1;
2307 : }
2308 : {
2309 17 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_aces));
2310 17 : if (PyLong_Check(value)) {
2311 0 : unsigned long long test_var;
2312 17 : test_var = PyLong_AsUnsignedLongLong(value);
2313 17 : if (PyErr_Occurred() != NULL) {
2314 0 : return -1;
2315 : }
2316 17 : if (test_var > uint_max) {
2317 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2318 : PyLong_Type.tp_name, uint_max, test_var);
2319 0 : return -1;
2320 : }
2321 17 : object->num_aces = test_var;
2322 : } else {
2323 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2324 : PyLong_Type.tp_name);
2325 0 : return -1;
2326 : }
2327 : }
2328 17 : return 0;
2329 : }
2330 :
2331 681088 : static PyObject *py_security_acl_get_aces(PyObject *obj, void *closure)
2332 : {
2333 681088 : struct security_acl *object = pytalloc_get_ptr(obj);
2334 112974 : PyObject *py_aces;
2335 681088 : py_aces = PyList_New(object->num_aces);
2336 681088 : if (py_aces == NULL) {
2337 0 : return NULL;
2338 : }
2339 : {
2340 : int aces_cntr_0;
2341 4139196 : for (aces_cntr_0 = 0; aces_cntr_0 < (object->num_aces); aces_cntr_0++) {
2342 510519 : PyObject *py_aces_0;
2343 3458108 : py_aces_0 = pytalloc_reference_ex(&security_ace_Type, object->aces, &(object->aces)[aces_cntr_0]);
2344 3458108 : PyList_SetItem(py_aces, aces_cntr_0, py_aces_0);
2345 : }
2346 : }
2347 568114 : return py_aces;
2348 : }
2349 :
2350 17 : static int py_security_acl_set_aces(PyObject *py_obj, PyObject *value, void *closure)
2351 : {
2352 17 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2353 17 : if (value == NULL) {
2354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aces");
2355 0 : return -1;
2356 : }
2357 17 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2358 : {
2359 0 : int aces_cntr_0;
2360 17 : object->aces = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->aces, PyList_GET_SIZE(value));
2361 17 : if (!object->aces) { return -1; }
2362 17 : talloc_set_name_const(object->aces, "ARRAY: object->aces");
2363 41 : for (aces_cntr_0 = 0; aces_cntr_0 < PyList_GET_SIZE(value); aces_cntr_0++) {
2364 24 : if (PyList_GET_ITEM(value, aces_cntr_0) == NULL) {
2365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aces)[aces_cntr_0]");
2366 0 : return -1;
2367 : }
2368 24 : PY_CHECK_TYPE(&security_ace_Type, PyList_GET_ITEM(value, aces_cntr_0), return -1;);
2369 24 : if (talloc_reference(object->aces, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, aces_cntr_0))) == NULL) {
2370 0 : PyErr_NoMemory();
2371 0 : return -1;
2372 : }
2373 24 : (object->aces)[aces_cntr_0] = *(struct security_ace *)pytalloc_get_ptr(PyList_GET_ITEM(value, aces_cntr_0));
2374 : }
2375 : }
2376 17 : return 0;
2377 : }
2378 :
2379 : static PyGetSetDef py_security_acl_getsetters[] = {
2380 : {
2381 : .name = discard_const_p(char, "revision"),
2382 : .get = py_security_acl_get_revision,
2383 : .set = py_security_acl_set_revision,
2384 : .doc = discard_const_p(char, "PIDL-generated element of base type security_acl_revision")
2385 : },
2386 : {
2387 : .name = discard_const_p(char, "size"),
2388 : .get = py_security_acl_get_size,
2389 : .set = py_security_acl_set_size,
2390 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2391 : },
2392 : {
2393 : .name = discard_const_p(char, "num_aces"),
2394 : .get = py_security_acl_get_num_aces,
2395 : .set = py_security_acl_set_num_aces,
2396 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2397 : },
2398 : {
2399 : .name = discard_const_p(char, "aces"),
2400 : .get = py_security_acl_get_aces,
2401 : .set = py_security_acl_set_aces,
2402 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace")
2403 : },
2404 : { .name = NULL }
2405 : };
2406 :
2407 6209 : static PyObject *py_security_acl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2408 : {
2409 6209 : return pytalloc_new(struct security_acl, type);
2410 : }
2411 :
2412 6198 : static PyObject *py_security_acl_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2413 : {
2414 6198 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2415 6198 : PyObject *ret = NULL;
2416 176 : DATA_BLOB blob;
2417 176 : enum ndr_err_code err;
2418 6198 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2419 6198 : if (tmp_ctx == NULL) {
2420 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2421 0 : return NULL;
2422 : }
2423 6198 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_acl);
2424 6198 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2425 0 : TALLOC_FREE(tmp_ctx);
2426 0 : PyErr_SetNdrError(err);
2427 0 : return NULL;
2428 : }
2429 :
2430 6198 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2431 6198 : TALLOC_FREE(tmp_ctx);
2432 6198 : return ret;
2433 : }
2434 :
2435 6198 : static PyObject *py_security_acl_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2436 : {
2437 6198 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2438 6198 : DATA_BLOB blob = {.data = NULL, .length = 0};
2439 6198 : Py_ssize_t blob_length = 0;
2440 176 : enum ndr_err_code err;
2441 6198 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2442 6198 : PyObject *allow_remaining_obj = NULL;
2443 6198 : bool allow_remaining = false;
2444 :
2445 6198 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2446 : discard_const_p(char *, kwnames),
2447 : &blob.data, &blob_length,
2448 : &allow_remaining_obj)) {
2449 0 : return NULL;
2450 : }
2451 6198 : blob.length = blob_length;
2452 :
2453 6198 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2454 0 : allow_remaining = true;
2455 : }
2456 :
2457 6022 : if (allow_remaining) {
2458 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_acl);
2459 : } else {
2460 6198 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_acl);
2461 : }
2462 6198 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2463 0 : PyErr_SetNdrError(err);
2464 0 : return NULL;
2465 : }
2466 :
2467 6198 : Py_RETURN_NONE;
2468 : }
2469 :
2470 0 : static PyObject *py_security_acl_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2471 : {
2472 0 : struct security_acl *object = pytalloc_get_ptr(py_obj);
2473 0 : PyObject *ret;
2474 0 : char *retstr;
2475 :
2476 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_acl, "security_acl", object);
2477 0 : ret = PyUnicode_FromString(retstr);
2478 0 : talloc_free(retstr);
2479 :
2480 0 : return ret;
2481 : }
2482 :
2483 : static PyMethodDef py_security_acl_methods[] = {
2484 : { "__ndr_pack__", (PyCFunction)py_security_acl_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2485 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_acl_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2486 : { "__ndr_print__", (PyCFunction)py_security_acl_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2487 : { NULL, NULL, 0, NULL }
2488 : };
2489 :
2490 :
2491 : static PyTypeObject security_acl_Type = {
2492 : PyVarObject_HEAD_INIT(NULL, 0)
2493 : .tp_name = "security.acl",
2494 : .tp_getset = py_security_acl_getsetters,
2495 : .tp_methods = py_security_acl_methods,
2496 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2497 : .tp_new = py_security_acl_new,
2498 : };
2499 :
2500 :
2501 426173 : static PyObject *py_security_descriptor_get_revision(PyObject *obj, void *closure)
2502 : {
2503 426173 : struct security_descriptor *object = pytalloc_get_ptr(obj);
2504 72833 : PyObject *py_revision;
2505 426173 : py_revision = PyLong_FromLong((uint16_t)(object->revision));
2506 426173 : return py_revision;
2507 : }
2508 :
2509 426172 : static int py_security_descriptor_set_revision(PyObject *py_obj, PyObject *value, void *closure)
2510 : {
2511 426172 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2512 426172 : if (value == NULL) {
2513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->revision");
2514 0 : return -1;
2515 : }
2516 : {
2517 426172 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
2518 426172 : if (PyLong_Check(value)) {
2519 72832 : unsigned long long test_var;
2520 426172 : test_var = PyLong_AsUnsignedLongLong(value);
2521 426172 : if (PyErr_Occurred() != NULL) {
2522 0 : return -1;
2523 : }
2524 426172 : if (test_var > uint_max) {
2525 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2526 : PyLong_Type.tp_name, uint_max, test_var);
2527 0 : return -1;
2528 : }
2529 426172 : object->revision = test_var;
2530 : } else {
2531 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2532 : PyLong_Type.tp_name);
2533 0 : return -1;
2534 : }
2535 : }
2536 426172 : return 0;
2537 : }
2538 :
2539 432709 : static PyObject *py_security_descriptor_get_type(PyObject *obj, void *closure)
2540 : {
2541 432709 : struct security_descriptor *object = pytalloc_get_ptr(obj);
2542 73013 : PyObject *py_type;
2543 432709 : py_type = PyLong_FromLong((uint16_t)(object->type));
2544 432709 : return py_type;
2545 : }
2546 :
2547 426191 : static int py_security_descriptor_set_type(PyObject *py_obj, PyObject *value, void *closure)
2548 : {
2549 426191 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2550 426191 : if (value == NULL) {
2551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
2552 0 : return -1;
2553 : }
2554 : {
2555 426191 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
2556 426191 : if (PyLong_Check(value)) {
2557 72832 : unsigned long long test_var;
2558 426191 : test_var = PyLong_AsUnsignedLongLong(value);
2559 426191 : if (PyErr_Occurred() != NULL) {
2560 0 : return -1;
2561 : }
2562 426191 : if (test_var > uint_max) {
2563 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2564 : PyLong_Type.tp_name, uint_max, test_var);
2565 0 : return -1;
2566 : }
2567 426191 : object->type = test_var;
2568 : } else {
2569 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2570 : PyLong_Type.tp_name);
2571 0 : return -1;
2572 : }
2573 : }
2574 426191 : return 0;
2575 : }
2576 :
2577 935084 : static PyObject *py_security_descriptor_get_owner_sid(PyObject *obj, void *closure)
2578 : {
2579 935084 : struct security_descriptor *object = pytalloc_get_ptr(obj);
2580 144963 : PyObject *py_owner_sid;
2581 935084 : if (object->owner_sid == NULL) {
2582 798 : Py_RETURN_NONE;
2583 : }
2584 934286 : if (object->owner_sid == NULL) {
2585 0 : py_owner_sid = Py_None;
2586 0 : Py_INCREF(py_owner_sid);
2587 : } else {
2588 934286 : py_owner_sid = pytalloc_reference_ex(&dom_sid_Type, object->owner_sid, object->owner_sid);
2589 : }
2590 934286 : return py_owner_sid;
2591 : }
2592 :
2593 426256 : static int py_security_descriptor_set_owner_sid(PyObject *py_obj, PyObject *value, void *closure)
2594 : {
2595 426256 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2596 426256 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->owner_sid));
2597 426256 : if (value == NULL) {
2598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->owner_sid");
2599 0 : return -1;
2600 : }
2601 426256 : if (value == Py_None) {
2602 728 : object->owner_sid = NULL;
2603 : } else {
2604 425528 : object->owner_sid = NULL;
2605 425528 : PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
2606 425528 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2607 0 : PyErr_NoMemory();
2608 0 : return -1;
2609 : }
2610 425528 : object->owner_sid = (struct dom_sid *)pytalloc_get_ptr(value);
2611 : }
2612 353424 : return 0;
2613 : }
2614 :
2615 933276 : static PyObject *py_security_descriptor_get_group_sid(PyObject *obj, void *closure)
2616 : {
2617 933276 : struct security_descriptor *object = pytalloc_get_ptr(obj);
2618 144858 : PyObject *py_group_sid;
2619 933276 : if (object->group_sid == NULL) {
2620 798 : Py_RETURN_NONE;
2621 : }
2622 932478 : if (object->group_sid == NULL) {
2623 0 : py_group_sid = Py_None;
2624 0 : Py_INCREF(py_group_sid);
2625 : } else {
2626 932478 : py_group_sid = pytalloc_reference_ex(&dom_sid_Type, object->group_sid, object->group_sid);
2627 : }
2628 932478 : return py_group_sid;
2629 : }
2630 :
2631 426245 : static int py_security_descriptor_set_group_sid(PyObject *py_obj, PyObject *value, void *closure)
2632 : {
2633 426245 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2634 426245 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->group_sid));
2635 426245 : if (value == NULL) {
2636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->group_sid");
2637 0 : return -1;
2638 : }
2639 426245 : if (value == Py_None) {
2640 728 : object->group_sid = NULL;
2641 : } else {
2642 425517 : object->group_sid = NULL;
2643 425517 : PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
2644 425517 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2645 0 : PyErr_NoMemory();
2646 0 : return -1;
2647 : }
2648 425517 : object->group_sid = (struct dom_sid *)pytalloc_get_ptr(value);
2649 : }
2650 353413 : return 0;
2651 : }
2652 :
2653 668321 : static PyObject *py_security_descriptor_get_sacl(PyObject *obj, void *closure)
2654 : {
2655 668321 : struct security_descriptor *object = pytalloc_get_ptr(obj);
2656 123263 : PyObject *py_sacl;
2657 668321 : if (object->sacl == NULL) {
2658 197843 : Py_RETURN_NONE;
2659 : }
2660 470478 : if (object->sacl == NULL) {
2661 0 : py_sacl = Py_None;
2662 0 : Py_INCREF(py_sacl);
2663 : } else {
2664 470478 : py_sacl = pytalloc_reference_ex(&security_acl_Type, object->sacl, object->sacl);
2665 : }
2666 470478 : return py_sacl;
2667 : }
2668 :
2669 0 : static int py_security_descriptor_set_sacl(PyObject *py_obj, PyObject *value, void *closure)
2670 : {
2671 0 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2672 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sacl));
2673 0 : if (value == NULL) {
2674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sacl");
2675 0 : return -1;
2676 : }
2677 0 : if (value == Py_None) {
2678 0 : object->sacl = NULL;
2679 : } else {
2680 0 : object->sacl = NULL;
2681 0 : PY_CHECK_TYPE(&security_acl_Type, value, return -1;);
2682 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2683 0 : PyErr_NoMemory();
2684 0 : return -1;
2685 : }
2686 0 : object->sacl = (struct security_acl *)pytalloc_get_ptr(value);
2687 : }
2688 0 : return 0;
2689 : }
2690 :
2691 890414 : static PyObject *py_security_descriptor_get_dacl(PyObject *obj, void *closure)
2692 : {
2693 890414 : struct security_descriptor *object = pytalloc_get_ptr(obj);
2694 161934 : PyObject *py_dacl;
2695 890414 : if (object->dacl == NULL) {
2696 154 : Py_RETURN_NONE;
2697 : }
2698 890260 : if (object->dacl == NULL) {
2699 0 : py_dacl = Py_None;
2700 0 : Py_INCREF(py_dacl);
2701 : } else {
2702 890260 : py_dacl = pytalloc_reference_ex(&security_acl_Type, object->dacl, object->dacl);
2703 : }
2704 890260 : return py_dacl;
2705 : }
2706 :
2707 11 : static int py_security_descriptor_set_dacl(PyObject *py_obj, PyObject *value, void *closure)
2708 : {
2709 11 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2710 11 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dacl));
2711 11 : if (value == NULL) {
2712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dacl");
2713 0 : return -1;
2714 : }
2715 11 : if (value == Py_None) {
2716 0 : object->dacl = NULL;
2717 : } else {
2718 11 : object->dacl = NULL;
2719 11 : PY_CHECK_TYPE(&security_acl_Type, value, return -1;);
2720 11 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2721 0 : PyErr_NoMemory();
2722 0 : return -1;
2723 : }
2724 11 : object->dacl = (struct security_acl *)pytalloc_get_ptr(value);
2725 : }
2726 11 : return 0;
2727 : }
2728 :
2729 : static PyGetSetDef py_security_descriptor_getsetters[] = {
2730 : {
2731 : .name = discard_const_p(char, "revision"),
2732 : .get = py_security_descriptor_get_revision,
2733 : .set = py_security_descriptor_set_revision,
2734 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor_revision")
2735 : },
2736 : {
2737 : .name = discard_const_p(char, "type"),
2738 : .get = py_security_descriptor_get_type,
2739 : .set = py_security_descriptor_set_type,
2740 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor_type")
2741 : },
2742 : {
2743 : .name = discard_const_p(char, "owner_sid"),
2744 : .get = py_security_descriptor_get_owner_sid,
2745 : .set = py_security_descriptor_set_owner_sid,
2746 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
2747 : },
2748 : {
2749 : .name = discard_const_p(char, "group_sid"),
2750 : .get = py_security_descriptor_get_group_sid,
2751 : .set = py_security_descriptor_set_group_sid,
2752 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
2753 : },
2754 : {
2755 : .name = discard_const_p(char, "sacl"),
2756 : .get = py_security_descriptor_get_sacl,
2757 : .set = py_security_descriptor_set_sacl,
2758 : .doc = discard_const_p(char, "PIDL-generated element of base type security_acl")
2759 : },
2760 : {
2761 : .name = discard_const_p(char, "dacl"),
2762 : .get = py_security_descriptor_get_dacl,
2763 : .set = py_security_descriptor_set_dacl,
2764 : .doc = discard_const_p(char, "PIDL-generated element of base type security_acl")
2765 : },
2766 : { .name = NULL }
2767 : };
2768 :
2769 0 : static PyObject *py_security_descriptor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2770 : {
2771 0 : return pytalloc_new(struct security_descriptor, type);
2772 : }
2773 :
2774 44154 : static PyObject *py_security_descriptor_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2775 : {
2776 44154 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2777 44154 : PyObject *ret = NULL;
2778 8971 : DATA_BLOB blob;
2779 8971 : enum ndr_err_code err;
2780 44154 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2781 44154 : if (tmp_ctx == NULL) {
2782 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2783 0 : return NULL;
2784 : }
2785 44154 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_descriptor);
2786 44154 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2787 0 : TALLOC_FREE(tmp_ctx);
2788 0 : PyErr_SetNdrError(err);
2789 0 : return NULL;
2790 : }
2791 :
2792 44154 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2793 44154 : TALLOC_FREE(tmp_ctx);
2794 44154 : return ret;
2795 : }
2796 :
2797 599798 : static PyObject *py_security_descriptor_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2798 : {
2799 599798 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2800 599798 : DATA_BLOB blob = {.data = NULL, .length = 0};
2801 599798 : Py_ssize_t blob_length = 0;
2802 80805 : enum ndr_err_code err;
2803 599798 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2804 599798 : PyObject *allow_remaining_obj = NULL;
2805 599798 : bool allow_remaining = false;
2806 :
2807 599798 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2808 : discard_const_p(char *, kwnames),
2809 : &blob.data, &blob_length,
2810 : &allow_remaining_obj)) {
2811 0 : return NULL;
2812 : }
2813 599798 : blob.length = blob_length;
2814 :
2815 599798 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2816 2 : allow_remaining = true;
2817 : }
2818 :
2819 518993 : if (allow_remaining) {
2820 2 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
2821 : } else {
2822 599796 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
2823 : }
2824 599798 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2825 9 : PyErr_SetNdrError(err);
2826 9 : return NULL;
2827 : }
2828 :
2829 599789 : Py_RETURN_NONE;
2830 : }
2831 :
2832 11 : static PyObject *py_security_descriptor_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2833 : {
2834 11 : struct security_descriptor *object = pytalloc_get_ptr(py_obj);
2835 11 : PyObject *ret;
2836 11 : char *retstr;
2837 :
2838 11 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_descriptor, "security_descriptor", object);
2839 11 : ret = PyUnicode_FromString(retstr);
2840 11 : talloc_free(retstr);
2841 :
2842 11 : return ret;
2843 : }
2844 :
2845 : static PyMethodDef py_security_descriptor_methods[] = {
2846 : { "__ndr_pack__", (PyCFunction)py_security_descriptor_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2847 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_descriptor_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2848 : { "__ndr_print__", (PyCFunction)py_security_descriptor_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2849 : { NULL, NULL, 0, NULL }
2850 : };
2851 :
2852 :
2853 : static PyTypeObject security_descriptor_Type = {
2854 : PyVarObject_HEAD_INIT(NULL, 0)
2855 : .tp_name = "security.descriptor",
2856 : .tp_getset = py_security_descriptor_getsetters,
2857 : .tp_methods = py_security_descriptor_methods,
2858 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2859 : .tp_new = py_security_descriptor_new,
2860 : };
2861 :
2862 :
2863 0 : static PyObject *py_sec_desc_buf_get_sd_size(PyObject *obj, void *closure)
2864 : {
2865 0 : struct sec_desc_buf *object = pytalloc_get_ptr(obj);
2866 0 : PyObject *py_sd_size;
2867 0 : py_sd_size = PyLong_FromUnsignedLongLong((uint32_t)(object->sd_size));
2868 0 : return py_sd_size;
2869 : }
2870 :
2871 0 : static int py_sec_desc_buf_set_sd_size(PyObject *py_obj, PyObject *value, void *closure)
2872 : {
2873 0 : struct sec_desc_buf *object = pytalloc_get_ptr(py_obj);
2874 0 : if (value == NULL) {
2875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sd_size");
2876 0 : return -1;
2877 : }
2878 : {
2879 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sd_size));
2880 0 : if (PyLong_Check(value)) {
2881 0 : unsigned long long test_var;
2882 0 : test_var = PyLong_AsUnsignedLongLong(value);
2883 0 : if (PyErr_Occurred() != NULL) {
2884 0 : return -1;
2885 : }
2886 0 : if (test_var > uint_max) {
2887 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2888 : PyLong_Type.tp_name, uint_max, test_var);
2889 0 : return -1;
2890 : }
2891 0 : object->sd_size = test_var;
2892 : } else {
2893 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2894 : PyLong_Type.tp_name);
2895 0 : return -1;
2896 : }
2897 : }
2898 0 : return 0;
2899 : }
2900 :
2901 0 : static PyObject *py_sec_desc_buf_get_sd(PyObject *obj, void *closure)
2902 : {
2903 0 : struct sec_desc_buf *object = pytalloc_get_ptr(obj);
2904 0 : PyObject *py_sd;
2905 0 : if (object->sd == NULL) {
2906 0 : Py_RETURN_NONE;
2907 : }
2908 0 : if (object->sd == NULL) {
2909 0 : py_sd = Py_None;
2910 0 : Py_INCREF(py_sd);
2911 : } else {
2912 0 : py_sd = pytalloc_reference_ex(&security_descriptor_Type, object->sd, object->sd);
2913 : }
2914 0 : return py_sd;
2915 : }
2916 :
2917 0 : static int py_sec_desc_buf_set_sd(PyObject *py_obj, PyObject *value, void *closure)
2918 : {
2919 0 : struct sec_desc_buf *object = pytalloc_get_ptr(py_obj);
2920 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sd));
2921 0 : if (value == NULL) {
2922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sd");
2923 0 : return -1;
2924 : }
2925 0 : if (value == Py_None) {
2926 0 : object->sd = NULL;
2927 : } else {
2928 0 : object->sd = NULL;
2929 0 : PY_CHECK_TYPE(&security_descriptor_Type, value, return -1;);
2930 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2931 0 : PyErr_NoMemory();
2932 0 : return -1;
2933 : }
2934 0 : object->sd = (struct security_descriptor *)pytalloc_get_ptr(value);
2935 : }
2936 0 : return 0;
2937 : }
2938 :
2939 : static PyGetSetDef py_sec_desc_buf_getsetters[] = {
2940 : {
2941 : .name = discard_const_p(char, "sd_size"),
2942 : .get = py_sec_desc_buf_get_sd_size,
2943 : .set = py_sec_desc_buf_set_sd_size,
2944 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2945 : },
2946 : {
2947 : .name = discard_const_p(char, "sd"),
2948 : .get = py_sec_desc_buf_get_sd,
2949 : .set = py_sec_desc_buf_set_sd,
2950 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
2951 : },
2952 : { .name = NULL }
2953 : };
2954 :
2955 0 : static PyObject *py_sec_desc_buf_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2956 : {
2957 0 : return pytalloc_new(struct sec_desc_buf, type);
2958 : }
2959 :
2960 0 : static PyObject *py_sec_desc_buf_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2961 : {
2962 0 : struct sec_desc_buf *object = pytalloc_get_ptr(py_obj);
2963 0 : PyObject *ret = NULL;
2964 0 : DATA_BLOB blob;
2965 0 : enum ndr_err_code err;
2966 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2967 0 : if (tmp_ctx == NULL) {
2968 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2969 0 : return NULL;
2970 : }
2971 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_sec_desc_buf);
2972 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2973 0 : TALLOC_FREE(tmp_ctx);
2974 0 : PyErr_SetNdrError(err);
2975 0 : return NULL;
2976 : }
2977 :
2978 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2979 0 : TALLOC_FREE(tmp_ctx);
2980 0 : return ret;
2981 : }
2982 :
2983 0 : static PyObject *py_sec_desc_buf_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2984 : {
2985 0 : struct sec_desc_buf *object = pytalloc_get_ptr(py_obj);
2986 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2987 0 : Py_ssize_t blob_length = 0;
2988 0 : enum ndr_err_code err;
2989 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2990 0 : PyObject *allow_remaining_obj = NULL;
2991 0 : bool allow_remaining = false;
2992 :
2993 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2994 : discard_const_p(char *, kwnames),
2995 : &blob.data, &blob_length,
2996 : &allow_remaining_obj)) {
2997 0 : return NULL;
2998 : }
2999 0 : blob.length = blob_length;
3000 :
3001 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3002 0 : allow_remaining = true;
3003 : }
3004 :
3005 0 : if (allow_remaining) {
3006 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_sec_desc_buf);
3007 : } else {
3008 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_sec_desc_buf);
3009 : }
3010 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3011 0 : PyErr_SetNdrError(err);
3012 0 : return NULL;
3013 : }
3014 :
3015 0 : Py_RETURN_NONE;
3016 : }
3017 :
3018 0 : static PyObject *py_sec_desc_buf_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3019 : {
3020 0 : struct sec_desc_buf *object = pytalloc_get_ptr(py_obj);
3021 0 : PyObject *ret;
3022 0 : char *retstr;
3023 :
3024 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_sec_desc_buf, "sec_desc_buf", object);
3025 0 : ret = PyUnicode_FromString(retstr);
3026 0 : talloc_free(retstr);
3027 :
3028 0 : return ret;
3029 : }
3030 :
3031 : static PyMethodDef py_sec_desc_buf_methods[] = {
3032 : { "__ndr_pack__", (PyCFunction)py_sec_desc_buf_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3033 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_sec_desc_buf_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3034 : { "__ndr_print__", (PyCFunction)py_sec_desc_buf_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3035 : { NULL, NULL, 0, NULL }
3036 : };
3037 :
3038 :
3039 : static PyTypeObject sec_desc_buf_Type = {
3040 : PyVarObject_HEAD_INIT(NULL, 0)
3041 : .tp_name = "security.sec_desc_buf",
3042 : .tp_getset = py_sec_desc_buf_getsetters,
3043 : .tp_methods = py_sec_desc_buf_methods,
3044 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3045 : .tp_new = py_sec_desc_buf_new,
3046 : };
3047 :
3048 :
3049 0 : static PyObject *py_security_token_get_num_sids(PyObject *obj, void *closure)
3050 : {
3051 0 : struct security_token *object = pytalloc_get_ptr(obj);
3052 0 : PyObject *py_num_sids;
3053 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)(object->num_sids));
3054 0 : return py_num_sids;
3055 : }
3056 :
3057 98 : static int py_security_token_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
3058 : {
3059 98 : struct security_token *object = pytalloc_get_ptr(py_obj);
3060 98 : if (value == NULL) {
3061 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_sids");
3062 0 : return -1;
3063 : }
3064 : {
3065 98 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
3066 98 : if (PyLong_Check(value)) {
3067 98 : unsigned long long test_var;
3068 98 : test_var = PyLong_AsUnsignedLongLong(value);
3069 98 : if (PyErr_Occurred() != NULL) {
3070 0 : return -1;
3071 : }
3072 98 : if (test_var > uint_max) {
3073 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3074 : PyLong_Type.tp_name, uint_max, test_var);
3075 0 : return -1;
3076 : }
3077 98 : object->num_sids = test_var;
3078 : } else {
3079 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3080 : PyLong_Type.tp_name);
3081 0 : return -1;
3082 : }
3083 : }
3084 98 : return 0;
3085 : }
3086 :
3087 326 : static PyObject *py_security_token_get_sids(PyObject *obj, void *closure)
3088 : {
3089 326 : struct security_token *object = pytalloc_get_ptr(obj);
3090 0 : PyObject *py_sids;
3091 326 : py_sids = PyList_New(object->num_sids);
3092 326 : if (py_sids == NULL) {
3093 0 : return NULL;
3094 : }
3095 : {
3096 : int sids_cntr_0;
3097 2325 : for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
3098 0 : PyObject *py_sids_0;
3099 1999 : py_sids_0 = pytalloc_reference_ex(&dom_sid_Type, object->sids, &(object->sids)[sids_cntr_0]);
3100 1999 : PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
3101 : }
3102 : }
3103 326 : return py_sids;
3104 : }
3105 :
3106 248 : static int py_security_token_set_sids(PyObject *py_obj, PyObject *value, void *closure)
3107 : {
3108 248 : struct security_token *object = pytalloc_get_ptr(py_obj);
3109 248 : if (value == NULL) {
3110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sids");
3111 0 : return -1;
3112 : }
3113 248 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3114 : {
3115 98 : int sids_cntr_0;
3116 248 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
3117 248 : if (!object->sids) { return -1; }
3118 248 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
3119 2187 : for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
3120 1841 : if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
3121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sids)[sids_cntr_0]");
3122 0 : return -1;
3123 : }
3124 1841 : PY_CHECK_TYPE(&dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
3125 1841 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
3126 0 : PyErr_NoMemory();
3127 0 : return -1;
3128 : }
3129 1841 : (object->sids)[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
3130 : }
3131 : }
3132 150 : return 0;
3133 : }
3134 :
3135 300 : static PyObject *py_security_token_get_privilege_mask(PyObject *obj, void *closure)
3136 : {
3137 300 : struct security_token *object = pytalloc_get_ptr(obj);
3138 0 : PyObject *py_privilege_mask;
3139 300 : py_privilege_mask = PyLong_FromUnsignedLongLong(object->privilege_mask);
3140 300 : return py_privilege_mask;
3141 : }
3142 :
3143 150 : static int py_security_token_set_privilege_mask(PyObject *py_obj, PyObject *value, void *closure)
3144 : {
3145 150 : struct security_token *object = pytalloc_get_ptr(py_obj);
3146 150 : if (value == NULL) {
3147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->privilege_mask");
3148 0 : return -1;
3149 : }
3150 : {
3151 150 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_mask));
3152 150 : if (PyLong_Check(value)) {
3153 0 : unsigned long long test_var;
3154 150 : test_var = PyLong_AsUnsignedLongLong(value);
3155 150 : if (PyErr_Occurred() != NULL) {
3156 0 : return -1;
3157 : }
3158 150 : if (test_var > uint_max) {
3159 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3160 : PyLong_Type.tp_name, uint_max, test_var);
3161 0 : return -1;
3162 : }
3163 150 : object->privilege_mask = test_var;
3164 : } else {
3165 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3166 : PyLong_Type.tp_name);
3167 0 : return -1;
3168 : }
3169 : }
3170 150 : return 0;
3171 : }
3172 :
3173 300 : static PyObject *py_security_token_get_rights_mask(PyObject *obj, void *closure)
3174 : {
3175 300 : struct security_token *object = pytalloc_get_ptr(obj);
3176 0 : PyObject *py_rights_mask;
3177 300 : py_rights_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->rights_mask));
3178 300 : return py_rights_mask;
3179 : }
3180 :
3181 150 : static int py_security_token_set_rights_mask(PyObject *py_obj, PyObject *value, void *closure)
3182 : {
3183 150 : struct security_token *object = pytalloc_get_ptr(py_obj);
3184 150 : if (value == NULL) {
3185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rights_mask");
3186 0 : return -1;
3187 : }
3188 : {
3189 150 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rights_mask));
3190 150 : if (PyLong_Check(value)) {
3191 0 : unsigned long long test_var;
3192 150 : test_var = PyLong_AsUnsignedLongLong(value);
3193 150 : if (PyErr_Occurred() != NULL) {
3194 0 : return -1;
3195 : }
3196 150 : if (test_var > uint_max) {
3197 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3198 : PyLong_Type.tp_name, uint_max, test_var);
3199 0 : return -1;
3200 : }
3201 150 : object->rights_mask = test_var;
3202 : } else {
3203 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3204 : PyLong_Type.tp_name);
3205 0 : return -1;
3206 : }
3207 : }
3208 150 : return 0;
3209 : }
3210 :
3211 0 : static PyObject *py_security_token_get_num_local_claims(PyObject *obj, void *closure)
3212 : {
3213 0 : struct security_token *object = pytalloc_get_ptr(obj);
3214 0 : PyObject *py_num_local_claims;
3215 0 : py_num_local_claims = PyLong_FromUnsignedLongLong((uint32_t)(object->num_local_claims));
3216 0 : return py_num_local_claims;
3217 : }
3218 :
3219 0 : static int py_security_token_set_num_local_claims(PyObject *py_obj, PyObject *value, void *closure)
3220 : {
3221 0 : struct security_token *object = pytalloc_get_ptr(py_obj);
3222 0 : if (value == NULL) {
3223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_local_claims");
3224 0 : return -1;
3225 : }
3226 : {
3227 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_local_claims));
3228 0 : if (PyLong_Check(value)) {
3229 0 : unsigned long long test_var;
3230 0 : test_var = PyLong_AsUnsignedLongLong(value);
3231 0 : if (PyErr_Occurred() != NULL) {
3232 0 : return -1;
3233 : }
3234 0 : if (test_var > uint_max) {
3235 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3236 : PyLong_Type.tp_name, uint_max, test_var);
3237 0 : return -1;
3238 : }
3239 0 : object->num_local_claims = test_var;
3240 : } else {
3241 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3242 : PyLong_Type.tp_name);
3243 0 : return -1;
3244 : }
3245 : }
3246 0 : return 0;
3247 : }
3248 :
3249 0 : static PyObject *py_security_token_get_num_user_claims(PyObject *obj, void *closure)
3250 : {
3251 0 : struct security_token *object = pytalloc_get_ptr(obj);
3252 0 : PyObject *py_num_user_claims;
3253 0 : py_num_user_claims = PyLong_FromUnsignedLongLong((uint32_t)(object->num_user_claims));
3254 0 : return py_num_user_claims;
3255 : }
3256 :
3257 52 : static int py_security_token_set_num_user_claims(PyObject *py_obj, PyObject *value, void *closure)
3258 : {
3259 52 : struct security_token *object = pytalloc_get_ptr(py_obj);
3260 52 : if (value == NULL) {
3261 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_user_claims");
3262 0 : return -1;
3263 : }
3264 : {
3265 52 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_user_claims));
3266 52 : if (PyLong_Check(value)) {
3267 52 : unsigned long long test_var;
3268 52 : test_var = PyLong_AsUnsignedLongLong(value);
3269 52 : if (PyErr_Occurred() != NULL) {
3270 0 : return -1;
3271 : }
3272 52 : if (test_var > uint_max) {
3273 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3274 : PyLong_Type.tp_name, uint_max, test_var);
3275 0 : return -1;
3276 : }
3277 52 : object->num_user_claims = test_var;
3278 : } else {
3279 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3280 : PyLong_Type.tp_name);
3281 0 : return -1;
3282 : }
3283 : }
3284 52 : return 0;
3285 : }
3286 :
3287 0 : static PyObject *py_security_token_get_num_device_claims(PyObject *obj, void *closure)
3288 : {
3289 0 : struct security_token *object = pytalloc_get_ptr(obj);
3290 0 : PyObject *py_num_device_claims;
3291 0 : py_num_device_claims = PyLong_FromUnsignedLongLong((uint32_t)(object->num_device_claims));
3292 0 : return py_num_device_claims;
3293 : }
3294 :
3295 9 : static int py_security_token_set_num_device_claims(PyObject *py_obj, PyObject *value, void *closure)
3296 : {
3297 9 : struct security_token *object = pytalloc_get_ptr(py_obj);
3298 9 : if (value == NULL) {
3299 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_device_claims");
3300 0 : return -1;
3301 : }
3302 : {
3303 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_device_claims));
3304 9 : if (PyLong_Check(value)) {
3305 9 : unsigned long long test_var;
3306 9 : test_var = PyLong_AsUnsignedLongLong(value);
3307 9 : if (PyErr_Occurred() != NULL) {
3308 0 : return -1;
3309 : }
3310 9 : if (test_var > uint_max) {
3311 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3312 : PyLong_Type.tp_name, uint_max, test_var);
3313 0 : return -1;
3314 : }
3315 9 : object->num_device_claims = test_var;
3316 : } else {
3317 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3318 : PyLong_Type.tp_name);
3319 0 : return -1;
3320 : }
3321 : }
3322 9 : return 0;
3323 : }
3324 :
3325 0 : static PyObject *py_security_token_get_num_device_sids(PyObject *obj, void *closure)
3326 : {
3327 0 : struct security_token *object = pytalloc_get_ptr(obj);
3328 0 : PyObject *py_num_device_sids;
3329 0 : py_num_device_sids = PyLong_FromUnsignedLongLong((uint32_t)(object->num_device_sids));
3330 0 : return py_num_device_sids;
3331 : }
3332 :
3333 20 : static int py_security_token_set_num_device_sids(PyObject *py_obj, PyObject *value, void *closure)
3334 : {
3335 20 : struct security_token *object = pytalloc_get_ptr(py_obj);
3336 20 : if (value == NULL) {
3337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_device_sids");
3338 0 : return -1;
3339 : }
3340 : {
3341 20 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_device_sids));
3342 20 : if (PyLong_Check(value)) {
3343 20 : unsigned long long test_var;
3344 20 : test_var = PyLong_AsUnsignedLongLong(value);
3345 20 : if (PyErr_Occurred() != NULL) {
3346 0 : return -1;
3347 : }
3348 20 : if (test_var > uint_max) {
3349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3350 : PyLong_Type.tp_name, uint_max, test_var);
3351 0 : return -1;
3352 : }
3353 20 : object->num_device_sids = test_var;
3354 : } else {
3355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3356 : PyLong_Type.tp_name);
3357 0 : return -1;
3358 : }
3359 : }
3360 20 : return 0;
3361 : }
3362 :
3363 0 : static PyObject *py_security_token_get_local_claims(PyObject *obj, void *closure)
3364 : {
3365 0 : struct security_token *object = pytalloc_get_ptr(obj);
3366 0 : PyObject *py_local_claims;
3367 0 : py_local_claims = PyList_New(object->num_local_claims);
3368 0 : if (py_local_claims == NULL) {
3369 0 : return NULL;
3370 : }
3371 : {
3372 : int local_claims_cntr_0;
3373 0 : for (local_claims_cntr_0 = 0; local_claims_cntr_0 < (object->num_local_claims); local_claims_cntr_0++) {
3374 0 : PyObject *py_local_claims_0;
3375 0 : py_local_claims_0 = pytalloc_reference_ex(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, object->local_claims, &(object->local_claims)[local_claims_cntr_0]);
3376 0 : PyList_SetItem(py_local_claims, local_claims_cntr_0, py_local_claims_0);
3377 : }
3378 : }
3379 0 : return py_local_claims;
3380 : }
3381 :
3382 0 : static int py_security_token_set_local_claims(PyObject *py_obj, PyObject *value, void *closure)
3383 : {
3384 0 : struct security_token *object = pytalloc_get_ptr(py_obj);
3385 0 : if (value == NULL) {
3386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->local_claims");
3387 0 : return -1;
3388 : }
3389 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3390 : {
3391 0 : int local_claims_cntr_0;
3392 0 : object->local_claims = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->local_claims, PyList_GET_SIZE(value));
3393 0 : if (!object->local_claims) { return -1; }
3394 0 : talloc_set_name_const(object->local_claims, "ARRAY: object->local_claims");
3395 0 : for (local_claims_cntr_0 = 0; local_claims_cntr_0 < PyList_GET_SIZE(value); local_claims_cntr_0++) {
3396 0 : if (PyList_GET_ITEM(value, local_claims_cntr_0) == NULL) {
3397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->local_claims)[local_claims_cntr_0]");
3398 0 : return -1;
3399 : }
3400 0 : PY_CHECK_TYPE(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, PyList_GET_ITEM(value, local_claims_cntr_0), return -1;);
3401 0 : if (talloc_reference(object->local_claims, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, local_claims_cntr_0))) == NULL) {
3402 0 : PyErr_NoMemory();
3403 0 : return -1;
3404 : }
3405 0 : (object->local_claims)[local_claims_cntr_0] = *(struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, local_claims_cntr_0));
3406 : }
3407 : }
3408 0 : return 0;
3409 : }
3410 :
3411 0 : static PyObject *py_security_token_get_user_claims(PyObject *obj, void *closure)
3412 : {
3413 0 : struct security_token *object = pytalloc_get_ptr(obj);
3414 0 : PyObject *py_user_claims;
3415 0 : py_user_claims = PyList_New(object->num_user_claims);
3416 0 : if (py_user_claims == NULL) {
3417 0 : return NULL;
3418 : }
3419 : {
3420 : int user_claims_cntr_0;
3421 0 : for (user_claims_cntr_0 = 0; user_claims_cntr_0 < (object->num_user_claims); user_claims_cntr_0++) {
3422 0 : PyObject *py_user_claims_0;
3423 0 : py_user_claims_0 = pytalloc_reference_ex(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, object->user_claims, &(object->user_claims)[user_claims_cntr_0]);
3424 0 : PyList_SetItem(py_user_claims, user_claims_cntr_0, py_user_claims_0);
3425 : }
3426 : }
3427 0 : return py_user_claims;
3428 : }
3429 :
3430 52 : static int py_security_token_set_user_claims(PyObject *py_obj, PyObject *value, void *closure)
3431 : {
3432 52 : struct security_token *object = pytalloc_get_ptr(py_obj);
3433 52 : if (value == NULL) {
3434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_claims");
3435 0 : return -1;
3436 : }
3437 52 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3438 : {
3439 52 : int user_claims_cntr_0;
3440 52 : object->user_claims = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->user_claims, PyList_GET_SIZE(value));
3441 52 : if (!object->user_claims) { return -1; }
3442 52 : talloc_set_name_const(object->user_claims, "ARRAY: object->user_claims");
3443 166 : for (user_claims_cntr_0 = 0; user_claims_cntr_0 < PyList_GET_SIZE(value); user_claims_cntr_0++) {
3444 62 : if (PyList_GET_ITEM(value, user_claims_cntr_0) == NULL) {
3445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->user_claims)[user_claims_cntr_0]");
3446 0 : return -1;
3447 : }
3448 62 : PY_CHECK_TYPE(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, PyList_GET_ITEM(value, user_claims_cntr_0), return -1;);
3449 62 : if (talloc_reference(object->user_claims, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, user_claims_cntr_0))) == NULL) {
3450 0 : PyErr_NoMemory();
3451 0 : return -1;
3452 : }
3453 62 : (object->user_claims)[user_claims_cntr_0] = *(struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, user_claims_cntr_0));
3454 : }
3455 : }
3456 0 : return 0;
3457 : }
3458 :
3459 0 : static PyObject *py_security_token_get_device_claims(PyObject *obj, void *closure)
3460 : {
3461 0 : struct security_token *object = pytalloc_get_ptr(obj);
3462 0 : PyObject *py_device_claims;
3463 0 : py_device_claims = PyList_New(object->num_device_claims);
3464 0 : if (py_device_claims == NULL) {
3465 0 : return NULL;
3466 : }
3467 : {
3468 : int device_claims_cntr_0;
3469 0 : for (device_claims_cntr_0 = 0; device_claims_cntr_0 < (object->num_device_claims); device_claims_cntr_0++) {
3470 0 : PyObject *py_device_claims_0;
3471 0 : py_device_claims_0 = pytalloc_reference_ex(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, object->device_claims, &(object->device_claims)[device_claims_cntr_0]);
3472 0 : PyList_SetItem(py_device_claims, device_claims_cntr_0, py_device_claims_0);
3473 : }
3474 : }
3475 0 : return py_device_claims;
3476 : }
3477 :
3478 9 : static int py_security_token_set_device_claims(PyObject *py_obj, PyObject *value, void *closure)
3479 : {
3480 9 : struct security_token *object = pytalloc_get_ptr(py_obj);
3481 9 : if (value == NULL) {
3482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->device_claims");
3483 0 : return -1;
3484 : }
3485 9 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3486 : {
3487 9 : int device_claims_cntr_0;
3488 9 : object->device_claims = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->device_claims, PyList_GET_SIZE(value));
3489 9 : if (!object->device_claims) { return -1; }
3490 9 : talloc_set_name_const(object->device_claims, "ARRAY: object->device_claims");
3491 27 : for (device_claims_cntr_0 = 0; device_claims_cntr_0 < PyList_GET_SIZE(value); device_claims_cntr_0++) {
3492 9 : if (PyList_GET_ITEM(value, device_claims_cntr_0) == NULL) {
3493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->device_claims)[device_claims_cntr_0]");
3494 0 : return -1;
3495 : }
3496 9 : PY_CHECK_TYPE(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type, PyList_GET_ITEM(value, device_claims_cntr_0), return -1;);
3497 9 : if (talloc_reference(object->device_claims, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, device_claims_cntr_0))) == NULL) {
3498 0 : PyErr_NoMemory();
3499 0 : return -1;
3500 : }
3501 9 : (object->device_claims)[device_claims_cntr_0] = *(struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, device_claims_cntr_0));
3502 : }
3503 : }
3504 0 : return 0;
3505 : }
3506 :
3507 0 : static PyObject *py_security_token_get_device_sids(PyObject *obj, void *closure)
3508 : {
3509 0 : struct security_token *object = pytalloc_get_ptr(obj);
3510 0 : PyObject *py_device_sids;
3511 0 : py_device_sids = PyList_New(object->num_device_sids);
3512 0 : if (py_device_sids == NULL) {
3513 0 : return NULL;
3514 : }
3515 : {
3516 : int device_sids_cntr_0;
3517 0 : for (device_sids_cntr_0 = 0; device_sids_cntr_0 < (object->num_device_sids); device_sids_cntr_0++) {
3518 0 : PyObject *py_device_sids_0;
3519 0 : py_device_sids_0 = pytalloc_reference_ex(&dom_sid_Type, object->device_sids, &(object->device_sids)[device_sids_cntr_0]);
3520 0 : PyList_SetItem(py_device_sids, device_sids_cntr_0, py_device_sids_0);
3521 : }
3522 : }
3523 0 : return py_device_sids;
3524 : }
3525 :
3526 20 : static int py_security_token_set_device_sids(PyObject *py_obj, PyObject *value, void *closure)
3527 : {
3528 20 : struct security_token *object = pytalloc_get_ptr(py_obj);
3529 20 : if (value == NULL) {
3530 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->device_sids");
3531 0 : return -1;
3532 : }
3533 20 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3534 : {
3535 20 : int device_sids_cntr_0;
3536 20 : object->device_sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->device_sids, PyList_GET_SIZE(value));
3537 20 : if (!object->device_sids) { return -1; }
3538 20 : talloc_set_name_const(object->device_sids, "ARRAY: object->device_sids");
3539 80 : for (device_sids_cntr_0 = 0; device_sids_cntr_0 < PyList_GET_SIZE(value); device_sids_cntr_0++) {
3540 40 : if (PyList_GET_ITEM(value, device_sids_cntr_0) == NULL) {
3541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->device_sids)[device_sids_cntr_0]");
3542 0 : return -1;
3543 : }
3544 40 : PY_CHECK_TYPE(&dom_sid_Type, PyList_GET_ITEM(value, device_sids_cntr_0), return -1;);
3545 40 : if (talloc_reference(object->device_sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, device_sids_cntr_0))) == NULL) {
3546 0 : PyErr_NoMemory();
3547 0 : return -1;
3548 : }
3549 40 : (object->device_sids)[device_sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, device_sids_cntr_0));
3550 : }
3551 : }
3552 0 : return 0;
3553 : }
3554 :
3555 0 : static PyObject *py_security_token_get_evaluate_claims(PyObject *obj, void *closure)
3556 : {
3557 0 : struct security_token *object = pytalloc_get_ptr(obj);
3558 0 : PyObject *py_evaluate_claims;
3559 0 : py_evaluate_claims = PyLong_FromLong((uint16_t)(object->evaluate_claims));
3560 0 : return py_evaluate_claims;
3561 : }
3562 :
3563 0 : static int py_security_token_set_evaluate_claims(PyObject *py_obj, PyObject *value, void *closure)
3564 : {
3565 0 : struct security_token *object = pytalloc_get_ptr(py_obj);
3566 0 : if (value == NULL) {
3567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->evaluate_claims");
3568 0 : return -1;
3569 : }
3570 : {
3571 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->evaluate_claims));
3572 0 : if (PyLong_Check(value)) {
3573 0 : unsigned long long test_var;
3574 0 : test_var = PyLong_AsUnsignedLongLong(value);
3575 0 : if (PyErr_Occurred() != NULL) {
3576 0 : return -1;
3577 : }
3578 0 : if (test_var > uint_max) {
3579 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3580 : PyLong_Type.tp_name, uint_max, test_var);
3581 0 : return -1;
3582 : }
3583 0 : object->evaluate_claims = test_var;
3584 : } else {
3585 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3586 : PyLong_Type.tp_name);
3587 0 : return -1;
3588 : }
3589 : }
3590 0 : return 0;
3591 : }
3592 :
3593 : static PyGetSetDef py_security_token_getsetters[] = {
3594 : {
3595 : .name = discard_const_p(char, "num_sids"),
3596 : .get = py_security_token_get_num_sids,
3597 : .set = py_security_token_set_num_sids,
3598 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3599 : },
3600 : {
3601 : .name = discard_const_p(char, "sids"),
3602 : .get = py_security_token_get_sids,
3603 : .set = py_security_token_set_sids,
3604 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
3605 : },
3606 : {
3607 : .name = discard_const_p(char, "privilege_mask"),
3608 : .get = py_security_token_get_privilege_mask,
3609 : .set = py_security_token_set_privilege_mask,
3610 : .doc = discard_const_p(char, "PIDL-generated element of base type se_privilege")
3611 : },
3612 : {
3613 : .name = discard_const_p(char, "rights_mask"),
3614 : .get = py_security_token_get_rights_mask,
3615 : .set = py_security_token_set_rights_mask,
3616 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SystemAccessModeFlags")
3617 : },
3618 : {
3619 : .name = discard_const_p(char, "num_local_claims"),
3620 : .get = py_security_token_get_num_local_claims,
3621 : .set = py_security_token_set_num_local_claims,
3622 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3623 : },
3624 : {
3625 : .name = discard_const_p(char, "num_user_claims"),
3626 : .get = py_security_token_get_num_user_claims,
3627 : .set = py_security_token_set_num_user_claims,
3628 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3629 : },
3630 : {
3631 : .name = discard_const_p(char, "num_device_claims"),
3632 : .get = py_security_token_get_num_device_claims,
3633 : .set = py_security_token_set_num_device_claims,
3634 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3635 : },
3636 : {
3637 : .name = discard_const_p(char, "num_device_sids"),
3638 : .get = py_security_token_get_num_device_sids,
3639 : .set = py_security_token_set_num_device_sids,
3640 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3641 : },
3642 : {
3643 : .name = discard_const_p(char, "local_claims"),
3644 : .get = py_security_token_get_local_claims,
3645 : .set = py_security_token_set_local_claims,
3646 : .doc = discard_const_p(char, "PIDL-generated element of base type CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1")
3647 : },
3648 : {
3649 : .name = discard_const_p(char, "user_claims"),
3650 : .get = py_security_token_get_user_claims,
3651 : .set = py_security_token_set_user_claims,
3652 : .doc = discard_const_p(char, "PIDL-generated element of base type CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1")
3653 : },
3654 : {
3655 : .name = discard_const_p(char, "device_claims"),
3656 : .get = py_security_token_get_device_claims,
3657 : .set = py_security_token_set_device_claims,
3658 : .doc = discard_const_p(char, "PIDL-generated element of base type CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1")
3659 : },
3660 : {
3661 : .name = discard_const_p(char, "device_sids"),
3662 : .get = py_security_token_get_device_sids,
3663 : .set = py_security_token_set_device_sids,
3664 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
3665 : },
3666 : {
3667 : .name = discard_const_p(char, "evaluate_claims"),
3668 : .get = py_security_token_get_evaluate_claims,
3669 : .set = py_security_token_set_evaluate_claims,
3670 : .doc = discard_const_p(char, "PIDL-generated element of base type claims_evaluation_control")
3671 : },
3672 : { .name = NULL }
3673 : };
3674 :
3675 0 : static PyObject *py_security_token_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3676 : {
3677 0 : return pytalloc_new(struct security_token, type);
3678 : }
3679 :
3680 0 : static PyObject *py_security_token_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3681 : {
3682 0 : struct security_token *object = pytalloc_get_ptr(py_obj);
3683 0 : PyObject *ret = NULL;
3684 0 : DATA_BLOB blob;
3685 0 : enum ndr_err_code err;
3686 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3687 0 : if (tmp_ctx == NULL) {
3688 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3689 0 : return NULL;
3690 : }
3691 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_token);
3692 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3693 0 : TALLOC_FREE(tmp_ctx);
3694 0 : PyErr_SetNdrError(err);
3695 0 : return NULL;
3696 : }
3697 :
3698 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3699 0 : TALLOC_FREE(tmp_ctx);
3700 0 : return ret;
3701 : }
3702 :
3703 0 : static PyObject *py_security_token_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3704 : {
3705 0 : struct security_token *object = pytalloc_get_ptr(py_obj);
3706 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3707 0 : Py_ssize_t blob_length = 0;
3708 0 : enum ndr_err_code err;
3709 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3710 0 : PyObject *allow_remaining_obj = NULL;
3711 0 : bool allow_remaining = false;
3712 :
3713 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3714 : discard_const_p(char *, kwnames),
3715 : &blob.data, &blob_length,
3716 : &allow_remaining_obj)) {
3717 0 : return NULL;
3718 : }
3719 0 : blob.length = blob_length;
3720 :
3721 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3722 0 : allow_remaining = true;
3723 : }
3724 :
3725 0 : if (allow_remaining) {
3726 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token);
3727 : } else {
3728 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token);
3729 : }
3730 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3731 0 : PyErr_SetNdrError(err);
3732 0 : return NULL;
3733 : }
3734 :
3735 0 : Py_RETURN_NONE;
3736 : }
3737 :
3738 0 : static PyObject *py_security_token_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3739 : {
3740 0 : struct security_token *object = pytalloc_get_ptr(py_obj);
3741 0 : PyObject *ret;
3742 0 : char *retstr;
3743 :
3744 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_token, "security_token", object);
3745 0 : ret = PyUnicode_FromString(retstr);
3746 0 : talloc_free(retstr);
3747 :
3748 0 : return ret;
3749 : }
3750 :
3751 : static PyMethodDef py_security_token_methods[] = {
3752 : { "__ndr_pack__", (PyCFunction)py_security_token_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3753 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_token_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3754 : { "__ndr_print__", (PyCFunction)py_security_token_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3755 : { NULL, NULL, 0, NULL }
3756 : };
3757 :
3758 :
3759 : static PyTypeObject security_token_Type = {
3760 : PyVarObject_HEAD_INIT(NULL, 0)
3761 : .tp_name = "security.token",
3762 : .tp_getset = py_security_token_getsetters,
3763 : .tp_methods = py_security_token_methods,
3764 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3765 : .tp_new = py_security_token_new,
3766 : };
3767 :
3768 :
3769 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_get_token(PyObject *obj, void *closure)
3770 : {
3771 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(obj);
3772 0 : PyObject *py_token;
3773 0 : py_token = pytalloc_reference_ex(&security_token_Type, pytalloc_get_mem_ctx(obj), &object->token);
3774 0 : return py_token;
3775 : }
3776 :
3777 0 : static int py_security_token_descriptor_fuzzing_pair_set_token(PyObject *py_obj, PyObject *value, void *closure)
3778 : {
3779 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(py_obj);
3780 0 : if (value == NULL) {
3781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->token");
3782 0 : return -1;
3783 : }
3784 0 : PY_CHECK_TYPE(&security_token_Type, value, return -1;);
3785 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3786 0 : PyErr_NoMemory();
3787 0 : return -1;
3788 : }
3789 0 : object->token = *(struct security_token *)pytalloc_get_ptr(value);
3790 0 : return 0;
3791 : }
3792 :
3793 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_get_sd(PyObject *obj, void *closure)
3794 : {
3795 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(obj);
3796 0 : PyObject *py_sd;
3797 0 : py_sd = pytalloc_reference_ex(&security_descriptor_Type, pytalloc_get_mem_ctx(obj), &object->sd);
3798 0 : return py_sd;
3799 : }
3800 :
3801 0 : static int py_security_token_descriptor_fuzzing_pair_set_sd(PyObject *py_obj, PyObject *value, void *closure)
3802 : {
3803 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(py_obj);
3804 0 : if (value == NULL) {
3805 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sd");
3806 0 : return -1;
3807 : }
3808 0 : PY_CHECK_TYPE(&security_descriptor_Type, value, return -1;);
3809 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3810 0 : PyErr_NoMemory();
3811 0 : return -1;
3812 : }
3813 0 : object->sd = *(struct security_descriptor *)pytalloc_get_ptr(value);
3814 0 : return 0;
3815 : }
3816 :
3817 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_get_access_desired(PyObject *obj, void *closure)
3818 : {
3819 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(obj);
3820 0 : PyObject *py_access_desired;
3821 0 : py_access_desired = PyLong_FromUnsignedLongLong((uint32_t)(object->access_desired));
3822 0 : return py_access_desired;
3823 : }
3824 :
3825 0 : static int py_security_token_descriptor_fuzzing_pair_set_access_desired(PyObject *py_obj, PyObject *value, void *closure)
3826 : {
3827 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(py_obj);
3828 0 : if (value == NULL) {
3829 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->access_desired");
3830 0 : return -1;
3831 : }
3832 : {
3833 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->access_desired));
3834 0 : if (PyLong_Check(value)) {
3835 0 : unsigned long long test_var;
3836 0 : test_var = PyLong_AsUnsignedLongLong(value);
3837 0 : if (PyErr_Occurred() != NULL) {
3838 0 : return -1;
3839 : }
3840 0 : if (test_var > uint_max) {
3841 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3842 : PyLong_Type.tp_name, uint_max, test_var);
3843 0 : return -1;
3844 : }
3845 0 : object->access_desired = test_var;
3846 : } else {
3847 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3848 : PyLong_Type.tp_name);
3849 0 : return -1;
3850 : }
3851 : }
3852 0 : return 0;
3853 : }
3854 :
3855 : static PyGetSetDef py_security_token_descriptor_fuzzing_pair_getsetters[] = {
3856 : {
3857 : .name = discard_const_p(char, "token"),
3858 : .get = py_security_token_descriptor_fuzzing_pair_get_token,
3859 : .set = py_security_token_descriptor_fuzzing_pair_set_token,
3860 : .doc = discard_const_p(char, "PIDL-generated element of base type security_token")
3861 : },
3862 : {
3863 : .name = discard_const_p(char, "sd"),
3864 : .get = py_security_token_descriptor_fuzzing_pair_get_sd,
3865 : .set = py_security_token_descriptor_fuzzing_pair_set_sd,
3866 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
3867 : },
3868 : {
3869 : .name = discard_const_p(char, "access_desired"),
3870 : .get = py_security_token_descriptor_fuzzing_pair_get_access_desired,
3871 : .set = py_security_token_descriptor_fuzzing_pair_set_access_desired,
3872 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3873 : },
3874 : { .name = NULL }
3875 : };
3876 :
3877 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3878 : {
3879 0 : return pytalloc_new(struct security_token_descriptor_fuzzing_pair, type);
3880 : }
3881 :
3882 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3883 : {
3884 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(py_obj);
3885 0 : PyObject *ret = NULL;
3886 0 : DATA_BLOB blob;
3887 0 : enum ndr_err_code err;
3888 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3889 0 : if (tmp_ctx == NULL) {
3890 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3891 0 : return NULL;
3892 : }
3893 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_token_descriptor_fuzzing_pair);
3894 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3895 0 : TALLOC_FREE(tmp_ctx);
3896 0 : PyErr_SetNdrError(err);
3897 0 : return NULL;
3898 : }
3899 :
3900 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3901 0 : TALLOC_FREE(tmp_ctx);
3902 0 : return ret;
3903 : }
3904 :
3905 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3906 : {
3907 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(py_obj);
3908 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3909 0 : Py_ssize_t blob_length = 0;
3910 0 : enum ndr_err_code err;
3911 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3912 0 : PyObject *allow_remaining_obj = NULL;
3913 0 : bool allow_remaining = false;
3914 :
3915 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3916 : discard_const_p(char *, kwnames),
3917 : &blob.data, &blob_length,
3918 : &allow_remaining_obj)) {
3919 0 : return NULL;
3920 : }
3921 0 : blob.length = blob_length;
3922 :
3923 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3924 0 : allow_remaining = true;
3925 : }
3926 :
3927 0 : if (allow_remaining) {
3928 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token_descriptor_fuzzing_pair);
3929 : } else {
3930 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token_descriptor_fuzzing_pair);
3931 : }
3932 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3933 0 : PyErr_SetNdrError(err);
3934 0 : return NULL;
3935 : }
3936 :
3937 0 : Py_RETURN_NONE;
3938 : }
3939 :
3940 0 : static PyObject *py_security_token_descriptor_fuzzing_pair_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3941 : {
3942 0 : struct security_token_descriptor_fuzzing_pair *object = pytalloc_get_ptr(py_obj);
3943 0 : PyObject *ret;
3944 0 : char *retstr;
3945 :
3946 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_token_descriptor_fuzzing_pair, "security_token_descriptor_fuzzing_pair", object);
3947 0 : ret = PyUnicode_FromString(retstr);
3948 0 : talloc_free(retstr);
3949 :
3950 0 : return ret;
3951 : }
3952 :
3953 : static PyMethodDef py_security_token_descriptor_fuzzing_pair_methods[] = {
3954 : { "__ndr_pack__", (PyCFunction)py_security_token_descriptor_fuzzing_pair_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3955 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_token_descriptor_fuzzing_pair_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3956 : { "__ndr_print__", (PyCFunction)py_security_token_descriptor_fuzzing_pair_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3957 : { NULL, NULL, 0, NULL }
3958 : };
3959 :
3960 :
3961 : static PyTypeObject security_token_descriptor_fuzzing_pair_Type = {
3962 : PyVarObject_HEAD_INIT(NULL, 0)
3963 : .tp_name = "security.token_descriptor_fuzzing_pair",
3964 : .tp_getset = py_security_token_descriptor_fuzzing_pair_getsetters,
3965 : .tp_methods = py_security_token_descriptor_fuzzing_pair_methods,
3966 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3967 : .tp_new = py_security_token_descriptor_fuzzing_pair_new,
3968 : };
3969 :
3970 :
3971 0 : static PyObject *py_security_unix_token_get_uid(PyObject *obj, void *closure)
3972 : {
3973 0 : struct security_unix_token *object = pytalloc_get_ptr(obj);
3974 0 : PyObject *py_uid;
3975 0 : py_uid = PyLong_FromUnsignedLongLong(object->uid);
3976 0 : return py_uid;
3977 : }
3978 :
3979 0 : static int py_security_unix_token_set_uid(PyObject *py_obj, PyObject *value, void *closure)
3980 : {
3981 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
3982 0 : if (value == NULL) {
3983 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->uid");
3984 0 : return -1;
3985 : }
3986 : {
3987 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
3988 0 : if (PyLong_Check(value)) {
3989 0 : unsigned long long test_var;
3990 0 : test_var = PyLong_AsUnsignedLongLong(value);
3991 0 : if (PyErr_Occurred() != NULL) {
3992 0 : return -1;
3993 : }
3994 0 : if (test_var > uint_max) {
3995 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3996 : PyLong_Type.tp_name, uint_max, test_var);
3997 0 : return -1;
3998 : }
3999 0 : object->uid = test_var;
4000 : } else {
4001 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4002 : PyLong_Type.tp_name);
4003 0 : return -1;
4004 : }
4005 : }
4006 0 : return 0;
4007 : }
4008 :
4009 0 : static PyObject *py_security_unix_token_get_gid(PyObject *obj, void *closure)
4010 : {
4011 0 : struct security_unix_token *object = pytalloc_get_ptr(obj);
4012 0 : PyObject *py_gid;
4013 0 : py_gid = PyLong_FromUnsignedLongLong(object->gid);
4014 0 : return py_gid;
4015 : }
4016 :
4017 0 : static int py_security_unix_token_set_gid(PyObject *py_obj, PyObject *value, void *closure)
4018 : {
4019 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
4020 0 : if (value == NULL) {
4021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->gid");
4022 0 : return -1;
4023 : }
4024 : {
4025 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->gid));
4026 0 : if (PyLong_Check(value)) {
4027 0 : unsigned long long test_var;
4028 0 : test_var = PyLong_AsUnsignedLongLong(value);
4029 0 : if (PyErr_Occurred() != NULL) {
4030 0 : return -1;
4031 : }
4032 0 : if (test_var > uint_max) {
4033 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4034 : PyLong_Type.tp_name, uint_max, test_var);
4035 0 : return -1;
4036 : }
4037 0 : object->gid = test_var;
4038 : } else {
4039 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4040 : PyLong_Type.tp_name);
4041 0 : return -1;
4042 : }
4043 : }
4044 0 : return 0;
4045 : }
4046 :
4047 0 : static PyObject *py_security_unix_token_get_ngroups(PyObject *obj, void *closure)
4048 : {
4049 0 : struct security_unix_token *object = pytalloc_get_ptr(obj);
4050 0 : PyObject *py_ngroups;
4051 0 : py_ngroups = PyLong_FromUnsignedLongLong((uint32_t)(object->ngroups));
4052 0 : return py_ngroups;
4053 : }
4054 :
4055 0 : static int py_security_unix_token_set_ngroups(PyObject *py_obj, PyObject *value, void *closure)
4056 : {
4057 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
4058 0 : if (value == NULL) {
4059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ngroups");
4060 0 : return -1;
4061 : }
4062 : {
4063 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ngroups));
4064 0 : if (PyLong_Check(value)) {
4065 0 : unsigned long long test_var;
4066 0 : test_var = PyLong_AsUnsignedLongLong(value);
4067 0 : if (PyErr_Occurred() != NULL) {
4068 0 : return -1;
4069 : }
4070 0 : if (test_var > uint_max) {
4071 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4072 : PyLong_Type.tp_name, uint_max, test_var);
4073 0 : return -1;
4074 : }
4075 0 : object->ngroups = test_var;
4076 : } else {
4077 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4078 : PyLong_Type.tp_name);
4079 0 : return -1;
4080 : }
4081 : }
4082 0 : return 0;
4083 : }
4084 :
4085 0 : static PyObject *py_security_unix_token_get_groups(PyObject *obj, void *closure)
4086 : {
4087 0 : struct security_unix_token *object = pytalloc_get_ptr(obj);
4088 0 : PyObject *py_groups;
4089 0 : py_groups = PyList_New(object->ngroups);
4090 0 : if (py_groups == NULL) {
4091 0 : return NULL;
4092 : }
4093 : {
4094 : int groups_cntr_0;
4095 0 : for (groups_cntr_0 = 0; groups_cntr_0 < (object->ngroups); groups_cntr_0++) {
4096 0 : PyObject *py_groups_0;
4097 0 : py_groups_0 = PyLong_FromUnsignedLongLong((object->groups)[groups_cntr_0]);
4098 0 : PyList_SetItem(py_groups, groups_cntr_0, py_groups_0);
4099 : }
4100 : }
4101 0 : return py_groups;
4102 : }
4103 :
4104 0 : static int py_security_unix_token_set_groups(PyObject *py_obj, PyObject *value, void *closure)
4105 : {
4106 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
4107 0 : if (value == NULL) {
4108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->groups");
4109 0 : return -1;
4110 : }
4111 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4112 : {
4113 0 : int groups_cntr_0;
4114 0 : object->groups = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->groups, PyList_GET_SIZE(value));
4115 0 : if (!object->groups) { return -1; }
4116 0 : talloc_set_name_const(object->groups, "ARRAY: object->groups");
4117 0 : for (groups_cntr_0 = 0; groups_cntr_0 < PyList_GET_SIZE(value); groups_cntr_0++) {
4118 0 : if (PyList_GET_ITEM(value, groups_cntr_0) == NULL) {
4119 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->groups)[groups_cntr_0]");
4120 0 : return -1;
4121 : }
4122 : {
4123 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->groups)[groups_cntr_0]));
4124 0 : if (PyLong_Check(PyList_GET_ITEM(value, groups_cntr_0))) {
4125 0 : unsigned long long test_var;
4126 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, groups_cntr_0));
4127 0 : if (PyErr_Occurred() != NULL) {
4128 0 : return -1;
4129 : }
4130 0 : if (test_var > uint_max) {
4131 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4132 : PyLong_Type.tp_name, uint_max, test_var);
4133 0 : return -1;
4134 : }
4135 0 : (object->groups)[groups_cntr_0] = test_var;
4136 : } else {
4137 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4138 : PyLong_Type.tp_name);
4139 0 : return -1;
4140 : }
4141 : }
4142 : }
4143 : }
4144 0 : return 0;
4145 : }
4146 :
4147 : static PyGetSetDef py_security_unix_token_getsetters[] = {
4148 : {
4149 : .name = discard_const_p(char, "uid"),
4150 : .get = py_security_unix_token_get_uid,
4151 : .set = py_security_unix_token_set_uid,
4152 : .doc = discard_const_p(char, "PIDL-generated element of base type uid_t")
4153 : },
4154 : {
4155 : .name = discard_const_p(char, "gid"),
4156 : .get = py_security_unix_token_get_gid,
4157 : .set = py_security_unix_token_set_gid,
4158 : .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
4159 : },
4160 : {
4161 : .name = discard_const_p(char, "ngroups"),
4162 : .get = py_security_unix_token_get_ngroups,
4163 : .set = py_security_unix_token_set_ngroups,
4164 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4165 : },
4166 : {
4167 : .name = discard_const_p(char, "groups"),
4168 : .get = py_security_unix_token_get_groups,
4169 : .set = py_security_unix_token_set_groups,
4170 : .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
4171 : },
4172 : { .name = NULL }
4173 : };
4174 :
4175 0 : static PyObject *py_security_unix_token_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4176 : {
4177 0 : return pytalloc_new(struct security_unix_token, type);
4178 : }
4179 :
4180 0 : static PyObject *py_security_unix_token_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4181 : {
4182 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
4183 0 : PyObject *ret = NULL;
4184 0 : DATA_BLOB blob;
4185 0 : enum ndr_err_code err;
4186 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4187 0 : if (tmp_ctx == NULL) {
4188 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4189 0 : return NULL;
4190 : }
4191 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_unix_token);
4192 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4193 0 : TALLOC_FREE(tmp_ctx);
4194 0 : PyErr_SetNdrError(err);
4195 0 : return NULL;
4196 : }
4197 :
4198 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4199 0 : TALLOC_FREE(tmp_ctx);
4200 0 : return ret;
4201 : }
4202 :
4203 0 : static PyObject *py_security_unix_token_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4204 : {
4205 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
4206 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4207 0 : Py_ssize_t blob_length = 0;
4208 0 : enum ndr_err_code err;
4209 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4210 0 : PyObject *allow_remaining_obj = NULL;
4211 0 : bool allow_remaining = false;
4212 :
4213 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4214 : discard_const_p(char *, kwnames),
4215 : &blob.data, &blob_length,
4216 : &allow_remaining_obj)) {
4217 0 : return NULL;
4218 : }
4219 0 : blob.length = blob_length;
4220 :
4221 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4222 0 : allow_remaining = true;
4223 : }
4224 :
4225 0 : if (allow_remaining) {
4226 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_unix_token);
4227 : } else {
4228 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_unix_token);
4229 : }
4230 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4231 0 : PyErr_SetNdrError(err);
4232 0 : return NULL;
4233 : }
4234 :
4235 0 : Py_RETURN_NONE;
4236 : }
4237 :
4238 0 : static PyObject *py_security_unix_token_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4239 : {
4240 0 : struct security_unix_token *object = pytalloc_get_ptr(py_obj);
4241 0 : PyObject *ret;
4242 0 : char *retstr;
4243 :
4244 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_unix_token, "security_unix_token", object);
4245 0 : ret = PyUnicode_FromString(retstr);
4246 0 : talloc_free(retstr);
4247 :
4248 0 : return ret;
4249 : }
4250 :
4251 : static PyMethodDef py_security_unix_token_methods[] = {
4252 : { "__ndr_pack__", (PyCFunction)py_security_unix_token_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4253 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_unix_token_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4254 : { "__ndr_print__", (PyCFunction)py_security_unix_token_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4255 : { NULL, NULL, 0, NULL }
4256 : };
4257 :
4258 :
4259 : static PyTypeObject security_unix_token_Type = {
4260 : PyVarObject_HEAD_INIT(NULL, 0)
4261 : .tp_name = "security.unix_token",
4262 : .tp_getset = py_security_unix_token_getsetters,
4263 : .tp_methods = py_security_unix_token_methods,
4264 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4265 : .tp_new = py_security_unix_token_new,
4266 : };
4267 :
4268 :
4269 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_Flags(PyObject *obj, void *closure)
4270 : {
4271 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(obj);
4272 0 : PyObject *py_Flags;
4273 0 : py_Flags = PyLong_FromUnsignedLongLong((uint32_t)(object->Flags));
4274 0 : return py_Flags;
4275 : }
4276 :
4277 0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
4278 : {
4279 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(py_obj);
4280 0 : if (value == NULL) {
4281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Flags");
4282 0 : return -1;
4283 : }
4284 : {
4285 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
4286 0 : if (PyLong_Check(value)) {
4287 0 : unsigned long long test_var;
4288 0 : test_var = PyLong_AsUnsignedLongLong(value);
4289 0 : if (PyErr_Occurred() != NULL) {
4290 0 : return -1;
4291 : }
4292 0 : if (test_var > uint_max) {
4293 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4294 : PyLong_Type.tp_name, uint_max, test_var);
4295 0 : return -1;
4296 : }
4297 0 : object->Flags = test_var;
4298 : } else {
4299 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4300 : PyLong_Type.tp_name);
4301 0 : return -1;
4302 : }
4303 : }
4304 0 : return 0;
4305 : }
4306 :
4307 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_TokenIL(PyObject *obj, void *closure)
4308 : {
4309 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(obj);
4310 0 : PyObject *py_TokenIL;
4311 0 : py_TokenIL = PyLong_FromUnsignedLongLong((uint32_t)(object->TokenIL));
4312 0 : return py_TokenIL;
4313 : }
4314 :
4315 0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_TokenIL(PyObject *py_obj, PyObject *value, void *closure)
4316 : {
4317 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(py_obj);
4318 0 : if (value == NULL) {
4319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->TokenIL");
4320 0 : return -1;
4321 : }
4322 : {
4323 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->TokenIL));
4324 0 : if (PyLong_Check(value)) {
4325 0 : unsigned long long test_var;
4326 0 : test_var = PyLong_AsUnsignedLongLong(value);
4327 0 : if (PyErr_Occurred() != NULL) {
4328 0 : return -1;
4329 : }
4330 0 : if (test_var > uint_max) {
4331 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4332 : PyLong_Type.tp_name, uint_max, test_var);
4333 0 : return -1;
4334 : }
4335 0 : object->TokenIL = test_var;
4336 : } else {
4337 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4338 : PyLong_Type.tp_name);
4339 0 : return -1;
4340 : }
4341 : }
4342 0 : return 0;
4343 : }
4344 :
4345 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_MachineId(PyObject *obj, void *closure)
4346 : {
4347 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(obj);
4348 0 : PyObject *py_MachineId;
4349 0 : py_MachineId = PyList_New(32);
4350 0 : if (py_MachineId == NULL) {
4351 0 : return NULL;
4352 : }
4353 : {
4354 : int MachineId_cntr_0;
4355 0 : for (MachineId_cntr_0 = 0; MachineId_cntr_0 < (32); MachineId_cntr_0++) {
4356 0 : PyObject *py_MachineId_0;
4357 0 : py_MachineId_0 = PyLong_FromLong((uint16_t)((object->MachineId)[MachineId_cntr_0]));
4358 0 : PyList_SetItem(py_MachineId, MachineId_cntr_0, py_MachineId_0);
4359 : }
4360 : }
4361 0 : return py_MachineId;
4362 : }
4363 :
4364 0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_MachineId(PyObject *py_obj, PyObject *value, void *closure)
4365 : {
4366 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(py_obj);
4367 0 : if (value == NULL) {
4368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->MachineId");
4369 0 : return -1;
4370 : }
4371 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4372 : {
4373 0 : int MachineId_cntr_0;
4374 0 : if (ARRAY_SIZE(object->MachineId) != PyList_GET_SIZE(value)) {
4375 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->MachineId), PyList_GET_SIZE(value));
4376 0 : return -1;
4377 : }
4378 0 : for (MachineId_cntr_0 = 0; MachineId_cntr_0 < PyList_GET_SIZE(value); MachineId_cntr_0++) {
4379 0 : if (PyList_GET_ITEM(value, MachineId_cntr_0) == NULL) {
4380 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->MachineId)[MachineId_cntr_0]");
4381 0 : return -1;
4382 : }
4383 : {
4384 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->MachineId)[MachineId_cntr_0]));
4385 0 : if (PyLong_Check(PyList_GET_ITEM(value, MachineId_cntr_0))) {
4386 0 : unsigned long long test_var;
4387 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, MachineId_cntr_0));
4388 0 : if (PyErr_Occurred() != NULL) {
4389 0 : return -1;
4390 : }
4391 0 : if (test_var > uint_max) {
4392 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4393 : PyLong_Type.tp_name, uint_max, test_var);
4394 0 : return -1;
4395 : }
4396 0 : (object->MachineId)[MachineId_cntr_0] = test_var;
4397 : } else {
4398 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4399 : PyLong_Type.tp_name);
4400 0 : return -1;
4401 : }
4402 : }
4403 : }
4404 : }
4405 0 : return 0;
4406 : }
4407 :
4408 : static PyGetSetDef py_LSAP_TOKEN_INFO_INTEGRITY_getsetters[] = {
4409 : {
4410 : .name = discard_const_p(char, "Flags"),
4411 : .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_Flags,
4412 : .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_Flags,
4413 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4414 : },
4415 : {
4416 : .name = discard_const_p(char, "TokenIL"),
4417 : .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_TokenIL,
4418 : .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_TokenIL,
4419 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4420 : },
4421 : {
4422 : .name = discard_const_p(char, "MachineId"),
4423 : .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_MachineId,
4424 : .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_MachineId,
4425 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4426 : },
4427 : { .name = NULL }
4428 : };
4429 :
4430 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4431 : {
4432 0 : return pytalloc_new(struct LSAP_TOKEN_INFO_INTEGRITY, type);
4433 : }
4434 :
4435 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4436 : {
4437 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(py_obj);
4438 0 : PyObject *ret = NULL;
4439 0 : DATA_BLOB blob;
4440 0 : enum ndr_err_code err;
4441 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4442 0 : if (tmp_ctx == NULL) {
4443 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4444 0 : return NULL;
4445 : }
4446 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_LSAP_TOKEN_INFO_INTEGRITY);
4447 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4448 0 : TALLOC_FREE(tmp_ctx);
4449 0 : PyErr_SetNdrError(err);
4450 0 : return NULL;
4451 : }
4452 :
4453 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4454 0 : TALLOC_FREE(tmp_ctx);
4455 0 : return ret;
4456 : }
4457 :
4458 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4459 : {
4460 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(py_obj);
4461 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4462 0 : Py_ssize_t blob_length = 0;
4463 0 : enum ndr_err_code err;
4464 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4465 0 : PyObject *allow_remaining_obj = NULL;
4466 0 : bool allow_remaining = false;
4467 :
4468 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4469 : discard_const_p(char *, kwnames),
4470 : &blob.data, &blob_length,
4471 : &allow_remaining_obj)) {
4472 0 : return NULL;
4473 : }
4474 0 : blob.length = blob_length;
4475 :
4476 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4477 0 : allow_remaining = true;
4478 : }
4479 :
4480 0 : if (allow_remaining) {
4481 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_LSAP_TOKEN_INFO_INTEGRITY);
4482 : } else {
4483 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_LSAP_TOKEN_INFO_INTEGRITY);
4484 : }
4485 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4486 0 : PyErr_SetNdrError(err);
4487 0 : return NULL;
4488 : }
4489 :
4490 0 : Py_RETURN_NONE;
4491 : }
4492 :
4493 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4494 : {
4495 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = pytalloc_get_ptr(py_obj);
4496 0 : PyObject *ret;
4497 0 : char *retstr;
4498 :
4499 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_LSAP_TOKEN_INFO_INTEGRITY, "LSAP_TOKEN_INFO_INTEGRITY", object);
4500 0 : ret = PyUnicode_FromString(retstr);
4501 0 : talloc_free(retstr);
4502 :
4503 0 : return ret;
4504 : }
4505 :
4506 : static PyMethodDef py_LSAP_TOKEN_INFO_INTEGRITY_methods[] = {
4507 : { "__ndr_pack__", (PyCFunction)py_LSAP_TOKEN_INFO_INTEGRITY_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4508 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_LSAP_TOKEN_INFO_INTEGRITY_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4509 : { "__ndr_print__", (PyCFunction)py_LSAP_TOKEN_INFO_INTEGRITY_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4510 : { NULL, NULL, 0, NULL }
4511 : };
4512 :
4513 :
4514 : static PyTypeObject LSAP_TOKEN_INFO_INTEGRITY_Type = {
4515 : PyVarObject_HEAD_INIT(NULL, 0)
4516 : .tp_name = "security.LSAP_TOKEN_INFO_INTEGRITY",
4517 : .tp_getset = py_LSAP_TOKEN_INFO_INTEGRITY_getsetters,
4518 : .tp_methods = py_LSAP_TOKEN_INFO_INTEGRITY_methods,
4519 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4520 : .tp_new = py_LSAP_TOKEN_INFO_INTEGRITY_new,
4521 : };
4522 :
4523 :
4524 0 : static PyObject *py_generic_mapping_get_generic_read(PyObject *obj, void *closure)
4525 : {
4526 0 : struct generic_mapping *object = pytalloc_get_ptr(obj);
4527 0 : PyObject *py_generic_read;
4528 0 : py_generic_read = PyLong_FromUnsignedLongLong((uint32_t)(object->generic_read));
4529 0 : return py_generic_read;
4530 : }
4531 :
4532 0 : static int py_generic_mapping_set_generic_read(PyObject *py_obj, PyObject *value, void *closure)
4533 : {
4534 0 : struct generic_mapping *object = pytalloc_get_ptr(py_obj);
4535 0 : if (value == NULL) {
4536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->generic_read");
4537 0 : return -1;
4538 : }
4539 : {
4540 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_read));
4541 0 : if (PyLong_Check(value)) {
4542 0 : unsigned long long test_var;
4543 0 : test_var = PyLong_AsUnsignedLongLong(value);
4544 0 : if (PyErr_Occurred() != NULL) {
4545 0 : return -1;
4546 : }
4547 0 : if (test_var > uint_max) {
4548 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4549 : PyLong_Type.tp_name, uint_max, test_var);
4550 0 : return -1;
4551 : }
4552 0 : object->generic_read = test_var;
4553 : } else {
4554 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4555 : PyLong_Type.tp_name);
4556 0 : return -1;
4557 : }
4558 : }
4559 0 : return 0;
4560 : }
4561 :
4562 0 : static PyObject *py_generic_mapping_get_generic_write(PyObject *obj, void *closure)
4563 : {
4564 0 : struct generic_mapping *object = pytalloc_get_ptr(obj);
4565 0 : PyObject *py_generic_write;
4566 0 : py_generic_write = PyLong_FromUnsignedLongLong((uint32_t)(object->generic_write));
4567 0 : return py_generic_write;
4568 : }
4569 :
4570 0 : static int py_generic_mapping_set_generic_write(PyObject *py_obj, PyObject *value, void *closure)
4571 : {
4572 0 : struct generic_mapping *object = pytalloc_get_ptr(py_obj);
4573 0 : if (value == NULL) {
4574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->generic_write");
4575 0 : return -1;
4576 : }
4577 : {
4578 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_write));
4579 0 : if (PyLong_Check(value)) {
4580 0 : unsigned long long test_var;
4581 0 : test_var = PyLong_AsUnsignedLongLong(value);
4582 0 : if (PyErr_Occurred() != NULL) {
4583 0 : return -1;
4584 : }
4585 0 : if (test_var > uint_max) {
4586 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4587 : PyLong_Type.tp_name, uint_max, test_var);
4588 0 : return -1;
4589 : }
4590 0 : object->generic_write = test_var;
4591 : } else {
4592 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4593 : PyLong_Type.tp_name);
4594 0 : return -1;
4595 : }
4596 : }
4597 0 : return 0;
4598 : }
4599 :
4600 0 : static PyObject *py_generic_mapping_get_generic_execute(PyObject *obj, void *closure)
4601 : {
4602 0 : struct generic_mapping *object = pytalloc_get_ptr(obj);
4603 0 : PyObject *py_generic_execute;
4604 0 : py_generic_execute = PyLong_FromUnsignedLongLong((uint32_t)(object->generic_execute));
4605 0 : return py_generic_execute;
4606 : }
4607 :
4608 0 : static int py_generic_mapping_set_generic_execute(PyObject *py_obj, PyObject *value, void *closure)
4609 : {
4610 0 : struct generic_mapping *object = pytalloc_get_ptr(py_obj);
4611 0 : if (value == NULL) {
4612 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->generic_execute");
4613 0 : return -1;
4614 : }
4615 : {
4616 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_execute));
4617 0 : if (PyLong_Check(value)) {
4618 0 : unsigned long long test_var;
4619 0 : test_var = PyLong_AsUnsignedLongLong(value);
4620 0 : if (PyErr_Occurred() != NULL) {
4621 0 : return -1;
4622 : }
4623 0 : if (test_var > uint_max) {
4624 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4625 : PyLong_Type.tp_name, uint_max, test_var);
4626 0 : return -1;
4627 : }
4628 0 : object->generic_execute = test_var;
4629 : } else {
4630 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4631 : PyLong_Type.tp_name);
4632 0 : return -1;
4633 : }
4634 : }
4635 0 : return 0;
4636 : }
4637 :
4638 0 : static PyObject *py_generic_mapping_get_generic_all(PyObject *obj, void *closure)
4639 : {
4640 0 : struct generic_mapping *object = pytalloc_get_ptr(obj);
4641 0 : PyObject *py_generic_all;
4642 0 : py_generic_all = PyLong_FromUnsignedLongLong((uint32_t)(object->generic_all));
4643 0 : return py_generic_all;
4644 : }
4645 :
4646 0 : static int py_generic_mapping_set_generic_all(PyObject *py_obj, PyObject *value, void *closure)
4647 : {
4648 0 : struct generic_mapping *object = pytalloc_get_ptr(py_obj);
4649 0 : if (value == NULL) {
4650 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->generic_all");
4651 0 : return -1;
4652 : }
4653 : {
4654 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_all));
4655 0 : if (PyLong_Check(value)) {
4656 0 : unsigned long long test_var;
4657 0 : test_var = PyLong_AsUnsignedLongLong(value);
4658 0 : if (PyErr_Occurred() != NULL) {
4659 0 : return -1;
4660 : }
4661 0 : if (test_var > uint_max) {
4662 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4663 : PyLong_Type.tp_name, uint_max, test_var);
4664 0 : return -1;
4665 : }
4666 0 : object->generic_all = test_var;
4667 : } else {
4668 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4669 : PyLong_Type.tp_name);
4670 0 : return -1;
4671 : }
4672 : }
4673 0 : return 0;
4674 : }
4675 :
4676 : static PyGetSetDef py_generic_mapping_getsetters[] = {
4677 : {
4678 : .name = discard_const_p(char, "generic_read"),
4679 : .get = py_generic_mapping_get_generic_read,
4680 : .set = py_generic_mapping_set_generic_read,
4681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4682 : },
4683 : {
4684 : .name = discard_const_p(char, "generic_write"),
4685 : .get = py_generic_mapping_get_generic_write,
4686 : .set = py_generic_mapping_set_generic_write,
4687 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4688 : },
4689 : {
4690 : .name = discard_const_p(char, "generic_execute"),
4691 : .get = py_generic_mapping_get_generic_execute,
4692 : .set = py_generic_mapping_set_generic_execute,
4693 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4694 : },
4695 : {
4696 : .name = discard_const_p(char, "generic_all"),
4697 : .get = py_generic_mapping_get_generic_all,
4698 : .set = py_generic_mapping_set_generic_all,
4699 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4700 : },
4701 : { .name = NULL }
4702 : };
4703 :
4704 0 : static PyObject *py_generic_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4705 : {
4706 0 : return pytalloc_new(struct generic_mapping, type);
4707 : }
4708 :
4709 :
4710 : static PyTypeObject generic_mapping_Type = {
4711 : PyVarObject_HEAD_INIT(NULL, 0)
4712 : .tp_name = "security.generic_mapping",
4713 : .tp_getset = py_generic_mapping_getsetters,
4714 : .tp_methods = NULL,
4715 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4716 : .tp_new = py_generic_mapping_new,
4717 : };
4718 :
4719 :
4720 0 : static PyObject *py_standard_mapping_get_std_read(PyObject *obj, void *closure)
4721 : {
4722 0 : struct standard_mapping *object = pytalloc_get_ptr(obj);
4723 0 : PyObject *py_std_read;
4724 0 : py_std_read = PyLong_FromUnsignedLongLong((uint32_t)(object->std_read));
4725 0 : return py_std_read;
4726 : }
4727 :
4728 0 : static int py_standard_mapping_set_std_read(PyObject *py_obj, PyObject *value, void *closure)
4729 : {
4730 0 : struct standard_mapping *object = pytalloc_get_ptr(py_obj);
4731 0 : if (value == NULL) {
4732 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->std_read");
4733 0 : return -1;
4734 : }
4735 : {
4736 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_read));
4737 0 : if (PyLong_Check(value)) {
4738 0 : unsigned long long test_var;
4739 0 : test_var = PyLong_AsUnsignedLongLong(value);
4740 0 : if (PyErr_Occurred() != NULL) {
4741 0 : return -1;
4742 : }
4743 0 : if (test_var > uint_max) {
4744 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4745 : PyLong_Type.tp_name, uint_max, test_var);
4746 0 : return -1;
4747 : }
4748 0 : object->std_read = test_var;
4749 : } else {
4750 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4751 : PyLong_Type.tp_name);
4752 0 : return -1;
4753 : }
4754 : }
4755 0 : return 0;
4756 : }
4757 :
4758 0 : static PyObject *py_standard_mapping_get_std_write(PyObject *obj, void *closure)
4759 : {
4760 0 : struct standard_mapping *object = pytalloc_get_ptr(obj);
4761 0 : PyObject *py_std_write;
4762 0 : py_std_write = PyLong_FromUnsignedLongLong((uint32_t)(object->std_write));
4763 0 : return py_std_write;
4764 : }
4765 :
4766 0 : static int py_standard_mapping_set_std_write(PyObject *py_obj, PyObject *value, void *closure)
4767 : {
4768 0 : struct standard_mapping *object = pytalloc_get_ptr(py_obj);
4769 0 : if (value == NULL) {
4770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->std_write");
4771 0 : return -1;
4772 : }
4773 : {
4774 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_write));
4775 0 : if (PyLong_Check(value)) {
4776 0 : unsigned long long test_var;
4777 0 : test_var = PyLong_AsUnsignedLongLong(value);
4778 0 : if (PyErr_Occurred() != NULL) {
4779 0 : return -1;
4780 : }
4781 0 : if (test_var > uint_max) {
4782 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4783 : PyLong_Type.tp_name, uint_max, test_var);
4784 0 : return -1;
4785 : }
4786 0 : object->std_write = test_var;
4787 : } else {
4788 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4789 : PyLong_Type.tp_name);
4790 0 : return -1;
4791 : }
4792 : }
4793 0 : return 0;
4794 : }
4795 :
4796 0 : static PyObject *py_standard_mapping_get_std_execute(PyObject *obj, void *closure)
4797 : {
4798 0 : struct standard_mapping *object = pytalloc_get_ptr(obj);
4799 0 : PyObject *py_std_execute;
4800 0 : py_std_execute = PyLong_FromUnsignedLongLong((uint32_t)(object->std_execute));
4801 0 : return py_std_execute;
4802 : }
4803 :
4804 0 : static int py_standard_mapping_set_std_execute(PyObject *py_obj, PyObject *value, void *closure)
4805 : {
4806 0 : struct standard_mapping *object = pytalloc_get_ptr(py_obj);
4807 0 : if (value == NULL) {
4808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->std_execute");
4809 0 : return -1;
4810 : }
4811 : {
4812 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_execute));
4813 0 : if (PyLong_Check(value)) {
4814 0 : unsigned long long test_var;
4815 0 : test_var = PyLong_AsUnsignedLongLong(value);
4816 0 : if (PyErr_Occurred() != NULL) {
4817 0 : return -1;
4818 : }
4819 0 : if (test_var > uint_max) {
4820 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4821 : PyLong_Type.tp_name, uint_max, test_var);
4822 0 : return -1;
4823 : }
4824 0 : object->std_execute = test_var;
4825 : } else {
4826 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4827 : PyLong_Type.tp_name);
4828 0 : return -1;
4829 : }
4830 : }
4831 0 : return 0;
4832 : }
4833 :
4834 0 : static PyObject *py_standard_mapping_get_std_all(PyObject *obj, void *closure)
4835 : {
4836 0 : struct standard_mapping *object = pytalloc_get_ptr(obj);
4837 0 : PyObject *py_std_all;
4838 0 : py_std_all = PyLong_FromUnsignedLongLong((uint32_t)(object->std_all));
4839 0 : return py_std_all;
4840 : }
4841 :
4842 0 : static int py_standard_mapping_set_std_all(PyObject *py_obj, PyObject *value, void *closure)
4843 : {
4844 0 : struct standard_mapping *object = pytalloc_get_ptr(py_obj);
4845 0 : if (value == NULL) {
4846 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->std_all");
4847 0 : return -1;
4848 : }
4849 : {
4850 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_all));
4851 0 : if (PyLong_Check(value)) {
4852 0 : unsigned long long test_var;
4853 0 : test_var = PyLong_AsUnsignedLongLong(value);
4854 0 : if (PyErr_Occurred() != NULL) {
4855 0 : return -1;
4856 : }
4857 0 : if (test_var > uint_max) {
4858 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4859 : PyLong_Type.tp_name, uint_max, test_var);
4860 0 : return -1;
4861 : }
4862 0 : object->std_all = test_var;
4863 : } else {
4864 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4865 : PyLong_Type.tp_name);
4866 0 : return -1;
4867 : }
4868 : }
4869 0 : return 0;
4870 : }
4871 :
4872 : static PyGetSetDef py_standard_mapping_getsetters[] = {
4873 : {
4874 : .name = discard_const_p(char, "std_read"),
4875 : .get = py_standard_mapping_get_std_read,
4876 : .set = py_standard_mapping_set_std_read,
4877 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4878 : },
4879 : {
4880 : .name = discard_const_p(char, "std_write"),
4881 : .get = py_standard_mapping_get_std_write,
4882 : .set = py_standard_mapping_set_std_write,
4883 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4884 : },
4885 : {
4886 : .name = discard_const_p(char, "std_execute"),
4887 : .get = py_standard_mapping_get_std_execute,
4888 : .set = py_standard_mapping_set_std_execute,
4889 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4890 : },
4891 : {
4892 : .name = discard_const_p(char, "std_all"),
4893 : .get = py_standard_mapping_get_std_all,
4894 : .set = py_standard_mapping_set_std_all,
4895 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4896 : },
4897 : { .name = NULL }
4898 : };
4899 :
4900 0 : static PyObject *py_standard_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4901 : {
4902 0 : return pytalloc_new(struct standard_mapping, type);
4903 : }
4904 :
4905 :
4906 : static PyTypeObject standard_mapping_Type = {
4907 : PyVarObject_HEAD_INIT(NULL, 0)
4908 : .tp_name = "security.standard_mapping",
4909 : .tp_getset = py_standard_mapping_getsetters,
4910 : .tp_methods = NULL,
4911 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4912 : .tp_new = py_standard_mapping_new,
4913 : };
4914 :
4915 :
4916 : const struct PyNdrRpcMethodDef py_ndr_security_methods[] = {
4917 : {0}
4918 : };
4919 :
4920 0 : static PyObject *interface_security_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4921 : {
4922 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_security);
4923 : }
4924 :
4925 : static PyTypeObject security_InterfaceType = {
4926 : PyVarObject_HEAD_INIT(NULL, 0)
4927 : .tp_name = "security.security",
4928 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
4929 : .tp_doc = "security(binding, lp_ctx=None, credentials=None) -> connection\n"
4930 : "\n"
4931 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
4932 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
4933 : "credentials should be a credentials.Credentials object.\n\n",
4934 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4935 : .tp_new = interface_security_new,
4936 : };
4937 :
4938 0 : static PyObject *syntax_security_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4939 : {
4940 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_security.syntax_id);
4941 : }
4942 :
4943 : static PyTypeObject security_SyntaxType = {
4944 : PyVarObject_HEAD_INIT(NULL, 0)
4945 : .tp_name = "security.security_abstract_syntax",
4946 : .tp_doc = "security_abstract_syntax()\n",
4947 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4948 : .tp_new = syntax_security_new,
4949 : };
4950 :
4951 : static PyMethodDef security_methods[] = {
4952 : { NULL, NULL, 0, NULL }
4953 : };
4954 :
4955 : static struct PyModuleDef moduledef = {
4956 : PyModuleDef_HEAD_INIT,
4957 : .m_name = "security",
4958 : .m_doc = "security DCE/RPC",
4959 : .m_size = -1,
4960 : .m_methods = security_methods,
4961 : };
4962 7649 : MODULE_INIT_FUNC(security)
4963 : {
4964 7649 : PyObject *m = NULL;
4965 7649 : PyObject *dep_samba_dcerpc_misc = NULL;
4966 7649 : PyObject *dep_talloc = NULL;
4967 7649 : PyObject *dep_samba_dcerpc_base = NULL;
4968 :
4969 7649 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
4970 7649 : if (dep_samba_dcerpc_misc == NULL)
4971 0 : goto out;
4972 :
4973 7649 : dep_talloc = PyImport_ImportModule("talloc");
4974 7649 : if (dep_talloc == NULL)
4975 0 : goto out;
4976 :
4977 7649 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
4978 7649 : if (dep_samba_dcerpc_base == NULL)
4979 0 : goto out;
4980 :
4981 7649 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
4982 7649 : if (BaseObject_Type == NULL)
4983 0 : goto out;
4984 :
4985 7649 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
4986 7649 : if (GUID_Type == NULL)
4987 0 : goto out;
4988 :
4989 7649 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
4990 7649 : if (ClientConnection_Type == NULL)
4991 0 : goto out;
4992 :
4993 7649 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
4994 7649 : if (ndr_syntax_id_Type == NULL)
4995 0 : goto out;
4996 :
4997 7649 : dom_sid_Type.tp_base = BaseObject_Type;
4998 7649 : dom_sid_Type.tp_basicsize = pytalloc_BaseObject_size();
4999 :
5000 7649 : security_ace_object_type_Type.tp_base = BaseObject_Type;
5001 7649 : security_ace_object_type_Type.tp_basicsize = pytalloc_BaseObject_size();
5002 :
5003 7649 : security_ace_object_inherited_type_Type.tp_base = BaseObject_Type;
5004 7649 : security_ace_object_inherited_type_Type.tp_basicsize = pytalloc_BaseObject_size();
5005 :
5006 7649 : security_ace_object_Type.tp_base = BaseObject_Type;
5007 7649 : security_ace_object_Type.tp_basicsize = pytalloc_BaseObject_size();
5008 :
5009 7649 : claim_values_Type.tp_base = BaseObject_Type;
5010 7649 : claim_values_Type.tp_basicsize = pytalloc_BaseObject_size();
5011 :
5012 7649 : CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type.tp_base = BaseObject_Type;
5013 7649 : CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type.tp_basicsize = pytalloc_BaseObject_size();
5014 :
5015 7649 : security_ace_object_ctr_Type.tp_base = BaseObject_Type;
5016 7649 : security_ace_object_ctr_Type.tp_basicsize = pytalloc_BaseObject_size();
5017 :
5018 7649 : security_ace_coda_Type.tp_base = BaseObject_Type;
5019 7649 : security_ace_coda_Type.tp_basicsize = pytalloc_BaseObject_size();
5020 :
5021 7649 : security_ace_Type.tp_base = BaseObject_Type;
5022 7649 : security_ace_Type.tp_basicsize = pytalloc_BaseObject_size();
5023 :
5024 7649 : security_acl_Type.tp_base = BaseObject_Type;
5025 7649 : security_acl_Type.tp_basicsize = pytalloc_BaseObject_size();
5026 :
5027 7649 : security_descriptor_Type.tp_base = BaseObject_Type;
5028 7649 : security_descriptor_Type.tp_basicsize = pytalloc_BaseObject_size();
5029 :
5030 7649 : sec_desc_buf_Type.tp_base = BaseObject_Type;
5031 7649 : sec_desc_buf_Type.tp_basicsize = pytalloc_BaseObject_size();
5032 :
5033 7649 : security_token_Type.tp_base = BaseObject_Type;
5034 7649 : security_token_Type.tp_basicsize = pytalloc_BaseObject_size();
5035 :
5036 7649 : security_token_descriptor_fuzzing_pair_Type.tp_base = BaseObject_Type;
5037 7649 : security_token_descriptor_fuzzing_pair_Type.tp_basicsize = pytalloc_BaseObject_size();
5038 :
5039 7649 : security_unix_token_Type.tp_base = BaseObject_Type;
5040 7649 : security_unix_token_Type.tp_basicsize = pytalloc_BaseObject_size();
5041 :
5042 7649 : LSAP_TOKEN_INFO_INTEGRITY_Type.tp_base = BaseObject_Type;
5043 7649 : LSAP_TOKEN_INFO_INTEGRITY_Type.tp_basicsize = pytalloc_BaseObject_size();
5044 :
5045 7649 : generic_mapping_Type.tp_base = BaseObject_Type;
5046 7649 : generic_mapping_Type.tp_basicsize = pytalloc_BaseObject_size();
5047 :
5048 7649 : standard_mapping_Type.tp_base = BaseObject_Type;
5049 7649 : standard_mapping_Type.tp_basicsize = pytalloc_BaseObject_size();
5050 :
5051 7649 : security_InterfaceType.tp_base = ClientConnection_Type;
5052 :
5053 7649 : security_SyntaxType.tp_base = ndr_syntax_id_Type;
5054 7649 : security_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
5055 :
5056 7649 : if (PyType_Ready(&dom_sid_Type) < 0)
5057 0 : goto out;
5058 7649 : if (PyType_Ready(&security_ace_object_type_Type) < 0)
5059 0 : goto out;
5060 7649 : if (PyType_Ready(&security_ace_object_inherited_type_Type) < 0)
5061 0 : goto out;
5062 7649 : if (PyType_Ready(&security_ace_object_Type) < 0)
5063 0 : goto out;
5064 7649 : if (PyType_Ready(&claim_values_Type) < 0)
5065 0 : goto out;
5066 7649 : if (PyType_Ready(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type) < 0)
5067 0 : goto out;
5068 7649 : if (PyType_Ready(&security_ace_object_ctr_Type) < 0)
5069 0 : goto out;
5070 7649 : if (PyType_Ready(&security_ace_coda_Type) < 0)
5071 0 : goto out;
5072 7649 : if (PyType_Ready(&security_ace_Type) < 0)
5073 0 : goto out;
5074 7649 : if (PyType_Ready(&security_acl_Type) < 0)
5075 0 : goto out;
5076 7649 : if (PyType_Ready(&security_descriptor_Type) < 0)
5077 0 : goto out;
5078 7649 : if (PyType_Ready(&sec_desc_buf_Type) < 0)
5079 0 : goto out;
5080 7649 : if (PyType_Ready(&security_token_Type) < 0)
5081 0 : goto out;
5082 7649 : if (PyType_Ready(&security_token_descriptor_fuzzing_pair_Type) < 0)
5083 0 : goto out;
5084 7649 : if (PyType_Ready(&security_unix_token_Type) < 0)
5085 0 : goto out;
5086 7649 : if (PyType_Ready(&LSAP_TOKEN_INFO_INTEGRITY_Type) < 0)
5087 0 : goto out;
5088 7649 : if (PyType_Ready(&generic_mapping_Type) < 0)
5089 0 : goto out;
5090 7649 : if (PyType_Ready(&standard_mapping_Type) < 0)
5091 0 : goto out;
5092 7649 : if (PyType_Ready(&security_InterfaceType) < 0)
5093 0 : goto out;
5094 7649 : if (PyType_Ready(&security_SyntaxType) < 0)
5095 0 : goto out;
5096 7649 : if (!PyInterface_AddNdrRpcMethods(&security_InterfaceType, py_ndr_security_methods))
5097 0 : return NULL;
5098 :
5099 : #ifdef PY_DOM_SID_PATCH
5100 7649 : PY_DOM_SID_PATCH(&dom_sid_Type);
5101 : #endif
5102 : #ifdef PY_ACE_OBJECT_TYPE_PATCH
5103 : PY_ACE_OBJECT_TYPE_PATCH(&security_ace_object_type_Type);
5104 : #endif
5105 : #ifdef PY_ACE_OBJECT_INHERITED_TYPE_PATCH
5106 : PY_ACE_OBJECT_INHERITED_TYPE_PATCH(&security_ace_object_inherited_type_Type);
5107 : #endif
5108 : #ifdef PY_ACE_OBJECT_PATCH
5109 : PY_ACE_OBJECT_PATCH(&security_ace_object_Type);
5110 : #endif
5111 : #ifdef PY_CLAIM_VALUES_PATCH
5112 : PY_CLAIM_VALUES_PATCH(&claim_values_Type);
5113 : #endif
5114 : #ifdef PY_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_PATCH
5115 : PY_CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_PATCH(&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type);
5116 : #endif
5117 : #ifdef PY_ACE_OBJECT_CTR_PATCH
5118 : PY_ACE_OBJECT_CTR_PATCH(&security_ace_object_ctr_Type);
5119 : #endif
5120 : #ifdef PY_ACE_CODA_PATCH
5121 : PY_ACE_CODA_PATCH(&security_ace_coda_Type);
5122 : #endif
5123 : #ifdef PY_ACE_PATCH
5124 7649 : PY_ACE_PATCH(&security_ace_Type);
5125 : #endif
5126 : #ifdef PY_ACL_PATCH
5127 : PY_ACL_PATCH(&security_acl_Type);
5128 : #endif
5129 : #ifdef PY_DESCRIPTOR_PATCH
5130 7649 : PY_DESCRIPTOR_PATCH(&security_descriptor_Type);
5131 : #endif
5132 : #ifdef PY_SEC_DESC_BUF_PATCH
5133 : PY_SEC_DESC_BUF_PATCH(&sec_desc_buf_Type);
5134 : #endif
5135 : #ifdef PY_TOKEN_PATCH
5136 7649 : PY_TOKEN_PATCH(&security_token_Type);
5137 : #endif
5138 : #ifdef PY_TOKEN_DESCRIPTOR_FUZZING_PAIR_PATCH
5139 : PY_TOKEN_DESCRIPTOR_FUZZING_PAIR_PATCH(&security_token_descriptor_fuzzing_pair_Type);
5140 : #endif
5141 : #ifdef PY_UNIX_TOKEN_PATCH
5142 : PY_UNIX_TOKEN_PATCH(&security_unix_token_Type);
5143 : #endif
5144 : #ifdef PY_LSAP_TOKEN_INFO_INTEGRITY_PATCH
5145 : PY_LSAP_TOKEN_INFO_INTEGRITY_PATCH(&LSAP_TOKEN_INFO_INTEGRITY_Type);
5146 : #endif
5147 : #ifdef PY_GENERIC_MAPPING_PATCH
5148 : PY_GENERIC_MAPPING_PATCH(&generic_mapping_Type);
5149 : #endif
5150 : #ifdef PY_STANDARD_MAPPING_PATCH
5151 : PY_STANDARD_MAPPING_PATCH(&standard_mapping_Type);
5152 : #endif
5153 : #ifdef PY_SECURITY_PATCH
5154 : PY_SECURITY_PATCH(&security_InterfaceType);
5155 : #endif
5156 : #ifdef PY_SECURITY_ABSTRACT_SYNTAX_PATCH
5157 : PY_SECURITY_ABSTRACT_SYNTAX_PATCH(&security_SyntaxType);
5158 : #endif
5159 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
5160 : PY_ABSTRACT_SYNTAX_PATCH(&security_SyntaxType);
5161 : #endif
5162 :
5163 7649 : m = PyModule_Create(&moduledef);
5164 7649 : if (m == NULL)
5165 0 : goto out;
5166 :
5167 7649 : PyModule_AddObject(m, "SEC_MASK_GENERIC", PyLong_FromUnsignedLongLong(0xF0000000));
5168 7649 : PyModule_AddObject(m, "SEC_MASK_FLAGS", PyLong_FromUnsignedLongLong(0x0F000000));
5169 7649 : PyModule_AddObject(m, "SEC_MASK_STANDARD", PyLong_FromUnsignedLongLong(0x00FF0000));
5170 7649 : PyModule_AddObject(m, "SEC_MASK_SPECIFIC", PyLong_FromUnsignedLongLong(0x0000FFFF));
5171 7649 : PyModule_AddObject(m, "SEC_GENERIC_ALL", PyLong_FromUnsignedLongLong(0x10000000));
5172 7649 : PyModule_AddObject(m, "SEC_GENERIC_EXECUTE", PyLong_FromUnsignedLongLong(0x20000000));
5173 7649 : PyModule_AddObject(m, "SEC_GENERIC_WRITE", PyLong_FromUnsignedLongLong(0x40000000));
5174 7649 : PyModule_AddObject(m, "SEC_GENERIC_READ", PyLong_FromUnsignedLongLong(0x80000000));
5175 7649 : PyModule_AddObject(m, "SEC_FLAG_SYSTEM_SECURITY", PyLong_FromUnsignedLongLong(0x01000000));
5176 7649 : PyModule_AddObject(m, "SEC_FLAG_MAXIMUM_ALLOWED", PyLong_FromUnsignedLongLong(0x02000000));
5177 7649 : PyModule_AddObject(m, "SEC_STD_DELETE", PyLong_FromUnsignedLongLong(0x00010000));
5178 7649 : PyModule_AddObject(m, "SEC_STD_READ_CONTROL", PyLong_FromUnsignedLongLong(0x00020000));
5179 7649 : PyModule_AddObject(m, "SEC_STD_WRITE_DAC", PyLong_FromUnsignedLongLong(0x00040000));
5180 7649 : PyModule_AddObject(m, "SEC_STD_WRITE_OWNER", PyLong_FromUnsignedLongLong(0x00080000));
5181 7649 : PyModule_AddObject(m, "SEC_STD_SYNCHRONIZE", PyLong_FromUnsignedLongLong(0x00100000));
5182 7649 : PyModule_AddObject(m, "SEC_STD_REQUIRED", PyLong_FromUnsignedLongLong(0x000F0000));
5183 7649 : PyModule_AddObject(m, "SEC_STD_ALL", PyLong_FromUnsignedLongLong(0x001F0000));
5184 7649 : PyModule_AddObject(m, "SEC_FILE_READ_DATA", PyLong_FromUnsignedLongLong(0x00000001));
5185 7649 : PyModule_AddObject(m, "SEC_FILE_WRITE_DATA", PyLong_FromUnsignedLongLong(0x00000002));
5186 7649 : PyModule_AddObject(m, "SEC_FILE_APPEND_DATA", PyLong_FromUnsignedLongLong(0x00000004));
5187 7649 : PyModule_AddObject(m, "SEC_FILE_READ_EA", PyLong_FromUnsignedLongLong(0x00000008));
5188 7649 : PyModule_AddObject(m, "SEC_FILE_WRITE_EA", PyLong_FromUnsignedLongLong(0x00000010));
5189 7649 : PyModule_AddObject(m, "SEC_FILE_EXECUTE", PyLong_FromUnsignedLongLong(0x00000020));
5190 7649 : PyModule_AddObject(m, "SEC_FILE_READ_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000080));
5191 7649 : PyModule_AddObject(m, "SEC_FILE_WRITE_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000100));
5192 7649 : PyModule_AddObject(m, "SEC_FILE_ALL", PyLong_FromUnsignedLongLong(0x000001ff));
5193 7649 : PyModule_AddObject(m, "SEC_DIR_LIST", PyLong_FromUnsignedLongLong(0x00000001));
5194 7649 : PyModule_AddObject(m, "SEC_DIR_ADD_FILE", PyLong_FromUnsignedLongLong(0x00000002));
5195 7649 : PyModule_AddObject(m, "SEC_DIR_ADD_SUBDIR", PyLong_FromUnsignedLongLong(0x00000004));
5196 7649 : PyModule_AddObject(m, "SEC_DIR_READ_EA", PyLong_FromUnsignedLongLong(0x00000008));
5197 7649 : PyModule_AddObject(m, "SEC_DIR_WRITE_EA", PyLong_FromUnsignedLongLong(0x00000010));
5198 7649 : PyModule_AddObject(m, "SEC_DIR_TRAVERSE", PyLong_FromUnsignedLongLong(0x00000020));
5199 7649 : PyModule_AddObject(m, "SEC_DIR_DELETE_CHILD", PyLong_FromUnsignedLongLong(0x00000040));
5200 7649 : PyModule_AddObject(m, "SEC_DIR_READ_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000080));
5201 7649 : PyModule_AddObject(m, "SEC_DIR_WRITE_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000100));
5202 7649 : PyModule_AddObject(m, "SEC_REG_QUERY_VALUE", PyLong_FromUnsignedLongLong(0x00000001));
5203 7649 : PyModule_AddObject(m, "SEC_REG_SET_VALUE", PyLong_FromUnsignedLongLong(0x00000002));
5204 7649 : PyModule_AddObject(m, "SEC_REG_CREATE_SUBKEY", PyLong_FromUnsignedLongLong(0x00000004));
5205 7649 : PyModule_AddObject(m, "SEC_REG_ENUM_SUBKEYS", PyLong_FromUnsignedLongLong(0x00000008));
5206 7649 : PyModule_AddObject(m, "SEC_REG_NOTIFY", PyLong_FromUnsignedLongLong(0x00000010));
5207 7649 : PyModule_AddObject(m, "SEC_REG_CREATE_LINK", PyLong_FromUnsignedLongLong(0x00000020));
5208 7649 : PyModule_AddObject(m, "SEC_ADS_CREATE_CHILD", PyLong_FromUnsignedLongLong(0x00000001));
5209 7649 : PyModule_AddObject(m, "SEC_ADS_DELETE_CHILD", PyLong_FromUnsignedLongLong(0x00000002));
5210 7649 : PyModule_AddObject(m, "SEC_ADS_LIST", PyLong_FromUnsignedLongLong(0x00000004));
5211 7649 : PyModule_AddObject(m, "SEC_ADS_SELF_WRITE", PyLong_FromUnsignedLongLong(0x00000008));
5212 7649 : PyModule_AddObject(m, "SEC_ADS_READ_PROP", PyLong_FromUnsignedLongLong(0x00000010));
5213 7649 : PyModule_AddObject(m, "SEC_ADS_WRITE_PROP", PyLong_FromUnsignedLongLong(0x00000020));
5214 7649 : PyModule_AddObject(m, "SEC_ADS_DELETE_TREE", PyLong_FromUnsignedLongLong(0x00000040));
5215 7649 : PyModule_AddObject(m, "SEC_ADS_LIST_OBJECT", PyLong_FromUnsignedLongLong(0x00000080));
5216 7649 : PyModule_AddObject(m, "SEC_ADS_CONTROL_ACCESS", PyLong_FromUnsignedLongLong(0x00000100));
5217 7649 : PyModule_AddObject(m, "SEC_MASK_INVALID", PyLong_FromUnsignedLongLong(0x0ce0fe00));
5218 7649 : PyModule_AddObject(m, "SEC_RIGHTS_FILE_READ", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA));
5219 7649 : PyModule_AddObject(m, "SEC_RIGHTS_FILE_WRITE", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA));
5220 7649 : PyModule_AddObject(m, "SEC_RIGHTS_FILE_EXECUTE", PyLong_FromLong(SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE));
5221 7649 : PyModule_AddObject(m, "SEC_RIGHTS_FILE_ALL", PyLong_FromLong(SEC_STD_ALL|SEC_FILE_ALL));
5222 7649 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_READ", PyLong_FromLong(SEC_RIGHTS_FILE_READ));
5223 7649 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_WRITE", PyLong_FromLong(SEC_RIGHTS_FILE_WRITE));
5224 7649 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_EXECUTE", PyLong_FromLong(SEC_RIGHTS_FILE_EXECUTE));
5225 7649 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_ALL", PyLong_FromLong(SEC_RIGHTS_FILE_ALL));
5226 7649 : PyModule_AddObject(m, "SEC_RIGHTS_PRIV_BACKUP", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_FLAG_SYSTEM_SECURITY|SEC_RIGHTS_FILE_READ|SEC_DIR_TRAVERSE));
5227 7649 : PyModule_AddObject(m, "SEC_RIGHTS_PRIV_RESTORE", PyLong_FromLong(SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER|SEC_FLAG_SYSTEM_SECURITY|SEC_RIGHTS_FILE_WRITE|SEC_DIR_ADD_FILE|SEC_DIR_ADD_SUBDIR|SEC_STD_DELETE));
5228 7649 : PyModule_AddObject(m, "STANDARD_RIGHTS_ALL_ACCESS", PyLong_FromLong(SEC_STD_ALL));
5229 7649 : PyModule_AddObject(m, "STANDARD_RIGHTS_MODIFY_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
5230 7649 : PyModule_AddObject(m, "STANDARD_RIGHTS_EXECUTE_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
5231 7649 : PyModule_AddObject(m, "STANDARD_RIGHTS_READ_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
5232 7649 : PyModule_AddObject(m, "STANDARD_RIGHTS_WRITE_ACCESS", PyLong_FromLong((SEC_STD_WRITE_OWNER|SEC_STD_WRITE_DAC|SEC_STD_DELETE)));
5233 7649 : PyModule_AddObject(m, "STANDARD_RIGHTS_REQUIRED_ACCESS", PyLong_FromLong((SEC_STD_DELETE|SEC_STD_READ_CONTROL|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER)));
5234 7649 : PyModule_AddObject(m, "SEC_ADS_GENERIC_ALL_DS", PyLong_FromLong((SEC_STD_DELETE|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER|SEC_ADS_CREATE_CHILD|SEC_ADS_DELETE_CHILD|SEC_ADS_DELETE_TREE|SEC_ADS_CONTROL_ACCESS)));
5235 7649 : PyModule_AddObject(m, "SEC_ADS_GENERIC_EXECUTE", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_ADS_LIST));
5236 7649 : PyModule_AddObject(m, "SEC_ADS_GENERIC_WRITE", PyLong_FromLong((SEC_STD_READ_CONTROL|SEC_ADS_SELF_WRITE|SEC_ADS_WRITE_PROP)));
5237 7649 : PyModule_AddObject(m, "SEC_ADS_GENERIC_READ", PyLong_FromLong((SEC_STD_READ_CONTROL|SEC_ADS_LIST|SEC_ADS_READ_PROP|SEC_ADS_LIST_OBJECT)));
5238 7649 : PyModule_AddObject(m, "SEC_ADS_GENERIC_ALL", PyLong_FromLong((SEC_ADS_GENERIC_EXECUTE|SEC_ADS_GENERIC_WRITE|SEC_ADS_GENERIC_READ|SEC_ADS_GENERIC_ALL_DS)));
5239 7649 : PyModule_AddObject(m, "SID_NULL", PyUnicode_FromString("S-1-0-0"));
5240 7649 : PyModule_AddObject(m, "NAME_WORLD", PyUnicode_FromString("WORLD"));
5241 7649 : PyModule_AddObject(m, "SID_WORLD_DOMAIN", PyUnicode_FromString("S-1-1"));
5242 7649 : PyModule_AddObject(m, "SID_WORLD", PyUnicode_FromString("S-1-1-0"));
5243 7649 : PyModule_AddObject(m, "SID_CREATOR_OWNER_DOMAIN", PyUnicode_FromString("S-1-3"));
5244 7649 : PyModule_AddObject(m, "SID_CREATOR_OWNER", PyUnicode_FromString("S-1-3-0"));
5245 7649 : PyModule_AddObject(m, "SID_CREATOR_GROUP", PyUnicode_FromString("S-1-3-1"));
5246 7649 : PyModule_AddObject(m, "SID_OWNER_RIGHTS", PyUnicode_FromString("S-1-3-4"));
5247 7649 : PyModule_AddObject(m, "NAME_NT_AUTHORITY", PyUnicode_FromString("NT AUTHORITY"));
5248 7649 : PyModule_AddObject(m, "SID_NT_AUTHORITY", PyUnicode_FromString("S-1-5"));
5249 7649 : PyModule_AddObject(m, "SID_NT_DIALUP", PyUnicode_FromString("S-1-5-1"));
5250 7649 : PyModule_AddObject(m, "SID_NT_NETWORK", PyUnicode_FromString("S-1-5-2"));
5251 7649 : PyModule_AddObject(m, "SID_NT_BATCH", PyUnicode_FromString("S-1-5-3"));
5252 7649 : PyModule_AddObject(m, "SID_NT_INTERACTIVE", PyUnicode_FromString("S-1-5-4"));
5253 7649 : PyModule_AddObject(m, "SID_NT_SERVICE", PyUnicode_FromString("S-1-5-6"));
5254 7649 : PyModule_AddObject(m, "SID_NT_ANONYMOUS", PyUnicode_FromString("S-1-5-7"));
5255 7649 : PyModule_AddObject(m, "SID_NT_PROXY", PyUnicode_FromString("S-1-5-8"));
5256 7649 : PyModule_AddObject(m, "SID_NT_ENTERPRISE_DCS", PyUnicode_FromString("S-1-5-9"));
5257 7649 : PyModule_AddObject(m, "SID_NT_SELF", PyUnicode_FromString("S-1-5-10"));
5258 7649 : PyModule_AddObject(m, "SID_NT_AUTHENTICATED_USERS", PyUnicode_FromString("S-1-5-11"));
5259 7649 : PyModule_AddObject(m, "SID_NT_RESTRICTED", PyUnicode_FromString("S-1-5-12"));
5260 7649 : PyModule_AddObject(m, "SID_NT_TERMINAL_SERVER_USERS", PyUnicode_FromString("S-1-5-13"));
5261 7649 : PyModule_AddObject(m, "SID_NT_REMOTE_INTERACTIVE", PyUnicode_FromString("S-1-5-14"));
5262 7649 : PyModule_AddObject(m, "SID_NT_THIS_ORGANISATION", PyUnicode_FromString("S-1-5-15"));
5263 7649 : PyModule_AddObject(m, "SID_NT_IUSR", PyUnicode_FromString("S-1-5-17"));
5264 7649 : PyModule_AddObject(m, "SID_NT_SYSTEM", PyUnicode_FromString("S-1-5-18"));
5265 7649 : PyModule_AddObject(m, "SID_NT_LOCAL_SERVICE", PyUnicode_FromString("S-1-5-19"));
5266 7649 : PyModule_AddObject(m, "SID_NT_NETWORK_SERVICE", PyUnicode_FromString("S-1-5-20"));
5267 7649 : PyModule_AddObject(m, "SID_NT_DIGEST_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-21"));
5268 7649 : PyModule_AddObject(m, "SID_NT_NTLM_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-10"));
5269 7649 : PyModule_AddObject(m, "SID_NT_SCHANNEL_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-14"));
5270 7649 : PyModule_AddObject(m, "SID_NT_OTHER_ORGANISATION", PyUnicode_FromString("S-1-5-1000"));
5271 7649 : PyModule_AddObject(m, "NAME_BUILTIN", PyUnicode_FromString("BUILTIN"));
5272 7649 : PyModule_AddObject(m, "SID_BUILTIN", PyUnicode_FromString("S-1-5-32"));
5273 7649 : PyModule_AddObject(m, "SID_BUILTIN_ADMINISTRATORS", PyUnicode_FromString("S-1-5-32-544"));
5274 7649 : PyModule_AddObject(m, "SID_BUILTIN_USERS", PyUnicode_FromString("S-1-5-32-545"));
5275 7649 : PyModule_AddObject(m, "SID_BUILTIN_GUESTS", PyUnicode_FromString("S-1-5-32-546"));
5276 7649 : PyModule_AddObject(m, "SID_BUILTIN_POWER_USERS", PyUnicode_FromString("S-1-5-32-547"));
5277 7649 : PyModule_AddObject(m, "SID_BUILTIN_ACCOUNT_OPERATORS", PyUnicode_FromString("S-1-5-32-548"));
5278 7649 : PyModule_AddObject(m, "SID_BUILTIN_SERVER_OPERATORS", PyUnicode_FromString("S-1-5-32-549"));
5279 7649 : PyModule_AddObject(m, "SID_BUILTIN_PRINT_OPERATORS", PyUnicode_FromString("S-1-5-32-550"));
5280 7649 : PyModule_AddObject(m, "SID_BUILTIN_BACKUP_OPERATORS", PyUnicode_FromString("S-1-5-32-551"));
5281 7649 : PyModule_AddObject(m, "SID_BUILTIN_REPLICATOR", PyUnicode_FromString("S-1-5-32-552"));
5282 7649 : PyModule_AddObject(m, "SID_BUILTIN_RAS_SERVERS", PyUnicode_FromString("S-1-5-32-553"));
5283 7649 : PyModule_AddObject(m, "SID_BUILTIN_PREW2K", PyUnicode_FromString("S-1-5-32-554"));
5284 7649 : PyModule_AddObject(m, "SID_BUILTIN_REMOTE_DESKTOP_USERS", PyUnicode_FromString("S-1-5-32-555"));
5285 7649 : PyModule_AddObject(m, "SID_BUILTIN_NETWORK_CONF_OPERATORS", PyUnicode_FromString("S-1-5-32-556"));
5286 7649 : PyModule_AddObject(m, "SID_BUILTIN_INCOMING_FOREST_TRUST", PyUnicode_FromString("S-1-5-32-557"));
5287 7649 : PyModule_AddObject(m, "SID_BUILTIN_PERFMON_USERS", PyUnicode_FromString("S-1-5-32-558"));
5288 7649 : PyModule_AddObject(m, "SID_BUILTIN_PERFLOG_USERS", PyUnicode_FromString("S-1-5-32-559"));
5289 7649 : PyModule_AddObject(m, "SID_BUILTIN_AUTH_ACCESS", PyUnicode_FromString("S-1-5-32-560"));
5290 7649 : PyModule_AddObject(m, "SID_BUILTIN_TS_LICENSE_SERVERS", PyUnicode_FromString("S-1-5-32-561"));
5291 7649 : PyModule_AddObject(m, "SID_BUILTIN_DISTRIBUTED_COM_USERS", PyUnicode_FromString("S-1-5-32-562"));
5292 7649 : PyModule_AddObject(m, "SID_BUILTIN_IUSERS", PyUnicode_FromString("S-1-5-32-568"));
5293 7649 : PyModule_AddObject(m, "SID_BUILTIN_CRYPTO_OPERATORS", PyUnicode_FromString("S-1-5-32-569"));
5294 7649 : PyModule_AddObject(m, "SID_BUILTIN_EVENT_LOG_READERS", PyUnicode_FromString("S-1-5-32-573"));
5295 7649 : PyModule_AddObject(m, "SID_BUILTIN_CERT_SERV_DCOM_ACCESS", PyUnicode_FromString("S-1-5-32-574"));
5296 7649 : PyModule_AddObject(m, "SID_BUILTIN_RDS_REMOTE_ACCESS_SERVERS", PyUnicode_FromString("S-1-5-32-575"));
5297 7649 : PyModule_AddObject(m, "SID_BUILTIN_RDS_ENDPOINT_SERVERS", PyUnicode_FromString("S-1-5-32-576"));
5298 7649 : PyModule_AddObject(m, "SID_BUILTIN_RDS_MANAGEMENT_SERVERS", PyUnicode_FromString("S-1-5-32-577"));
5299 7649 : PyModule_AddObject(m, "SID_BUILTIN_HYPER_V_ADMINS", PyUnicode_FromString("S-1-5-32-578"));
5300 7649 : PyModule_AddObject(m, "SID_BUILTIN_ACCESS_CONTROL_ASSISTANCE_OPS", PyUnicode_FromString("S-1-5-32-579"));
5301 7649 : PyModule_AddObject(m, "SID_BUILTIN_REMOTE_MANAGEMENT_USERS", PyUnicode_FromString("S-1-5-32-580"));
5302 7649 : PyModule_AddObject(m, "SID_BUILTIN_SYSTEM_MANAGED_ACCOUNTS_GRP", PyUnicode_FromString("S-1-5-32-581"));
5303 7649 : PyModule_AddObject(m, "SID_BUILTIN_STORAGE_REPLICA_ADMINISTRATORS", PyUnicode_FromString("S-1-5-32-582"));
5304 7649 : PyModule_AddObject(m, "SID_SECURITY_RESTRICTED_CODE", PyUnicode_FromString("S-1-5-33"));
5305 7649 : PyModule_AddObject(m, "SID_SAMBA_UNIX_USER_OWNER", PyUnicode_FromString("S-1-22-1"));
5306 7649 : PyModule_AddObject(m, "SID_SAMBA_UNIX_GROUP_OWNER", PyUnicode_FromString("S-1-22-2"));
5307 7649 : PyModule_AddObject(m, "NAME_NT_SERVICE", PyUnicode_FromString("NT SERVICE"));
5308 7649 : PyModule_AddObject(m, "SID_NT_NT_SERVICE", PyUnicode_FromString("S-1-5-80"));
5309 7649 : PyModule_AddObject(m, "SID_NT_TRUSTED_INSTALLER", PyUnicode_FromString("S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464"));
5310 7649 : PyModule_AddObject(m, "SID_AUTHENTICATION_AUTHORITY_ASSERTED_IDENTITY", PyUnicode_FromString("S-1-18-1"));
5311 7649 : PyModule_AddObject(m, "SID_SERVICE_ASSERTED_IDENTITY", PyUnicode_FromString("S-1-18-2"));
5312 7649 : PyModule_AddObject(m, "SID_FRESH_PUBLIC_KEY_IDENTITY", PyUnicode_FromString("S-1-18-3"));
5313 7649 : PyModule_AddObject(m, "SID_COMPOUNDED_AUTHENTICATION", PyUnicode_FromString("S-1-5-21-0-0-0-496"));
5314 7649 : PyModule_AddObject(m, "SID_CLAIMS_VALID", PyUnicode_FromString("S-1-5-21-0-0-0-497"));
5315 7649 : PyModule_AddObject(m, "SID_USER_MODE_DRIVERS", PyUnicode_FromString("S-1-5-84-0-0-0-0-0"));
5316 7649 : PyModule_AddObject(m, "SID_SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE", PyUnicode_FromString("S-1-15-2-1"));
5317 7649 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_LOW", PyUnicode_FromString("S-1-16-4096"));
5318 7649 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_MEDIUM", PyUnicode_FromString("S-1-16-8192"));
5319 7649 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_MEDIUM_PLUS", PyUnicode_FromString("S-1-16-8448"));
5320 7649 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_HIGH", PyUnicode_FromString("S-1-16-12288"));
5321 7649 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_SYSTEM", PyUnicode_FromString("S-1-16-16384"));
5322 7649 : PyModule_AddObject(m, "SID_NT_NFS_SUBSYSTEM", PyUnicode_FromString("S-1-5-88"));
5323 7649 : PyModule_AddObject(m, "SID_NT_NFS_USER", PyUnicode_FromString("S-1-5-88-1"));
5324 7649 : PyModule_AddObject(m, "SID_NT_NFS_GROUP", PyUnicode_FromString("S-1-5-88-2"));
5325 7649 : PyModule_AddObject(m, "SID_NT_NFS_MASK", PyUnicode_FromString("S-1-5-88-3"));
5326 7649 : PyModule_AddObject(m, "SID_NT_NFS_OTHERS", PyUnicode_FromString("S-1-5-88-4"));
5327 7649 : PyModule_AddObject(m, "DOMAIN_RID_LOGON", PyLong_FromUnsignedLongLong(9));
5328 7649 : PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_READONLY_DCS", PyLong_FromUnsignedLongLong(498));
5329 7649 : PyModule_AddObject(m, "DOMAIN_RID_ADMINISTRATOR", PyLong_FromUnsignedLongLong(500));
5330 7649 : PyModule_AddObject(m, "DOMAIN_RID_GUEST", PyLong_FromUnsignedLongLong(501));
5331 7649 : PyModule_AddObject(m, "DOMAIN_RID_KRBTGT", PyLong_FromUnsignedLongLong(502));
5332 7649 : PyModule_AddObject(m, "DOMAIN_RID_ADMINS", PyLong_FromUnsignedLongLong(512));
5333 7649 : PyModule_AddObject(m, "DOMAIN_RID_USERS", PyLong_FromUnsignedLongLong(513));
5334 7649 : PyModule_AddObject(m, "DOMAIN_RID_GUESTS", PyLong_FromUnsignedLongLong(514));
5335 7649 : PyModule_AddObject(m, "DOMAIN_RID_DOMAIN_MEMBERS", PyLong_FromUnsignedLongLong(515));
5336 7649 : PyModule_AddObject(m, "DOMAIN_RID_DCS", PyLong_FromUnsignedLongLong(516));
5337 7649 : PyModule_AddObject(m, "DOMAIN_RID_CERT_ADMINS", PyLong_FromUnsignedLongLong(517));
5338 7649 : PyModule_AddObject(m, "DOMAIN_RID_SCHEMA_ADMINS", PyLong_FromUnsignedLongLong(518));
5339 7649 : PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_ADMINS", PyLong_FromUnsignedLongLong(519));
5340 7649 : PyModule_AddObject(m, "DOMAIN_RID_POLICY_ADMINS", PyLong_FromUnsignedLongLong(520));
5341 7649 : PyModule_AddObject(m, "DOMAIN_RID_READONLY_DCS", PyLong_FromUnsignedLongLong(521));
5342 7649 : PyModule_AddObject(m, "DOMAIN_RID_CLONEABLE_CONTROLLERS", PyLong_FromUnsignedLongLong(522));
5343 7649 : PyModule_AddObject(m, "DOMAIN_RID_PROTECTED_USERS", PyLong_FromUnsignedLongLong(525));
5344 7649 : PyModule_AddObject(m, "DOMAIN_RID_KEY_ADMINS", PyLong_FromUnsignedLongLong(526));
5345 7649 : PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_KEY_ADMINS", PyLong_FromUnsignedLongLong(527));
5346 7649 : PyModule_AddObject(m, "DOMAIN_RID_RAS_SERVERS", PyLong_FromUnsignedLongLong(553));
5347 7649 : PyModule_AddObject(m, "DOMAIN_RID_RODC_ALLOW", PyLong_FromUnsignedLongLong(571));
5348 7649 : PyModule_AddObject(m, "DOMAIN_RID_RODC_DENY", PyLong_FromUnsignedLongLong(572));
5349 7649 : PyModule_AddObject(m, "BUILTIN_RID_ADMINISTRATORS", PyLong_FromUnsignedLongLong(544));
5350 7649 : PyModule_AddObject(m, "BUILTIN_RID_USERS", PyLong_FromUnsignedLongLong(545));
5351 7649 : PyModule_AddObject(m, "BUILTIN_RID_GUESTS", PyLong_FromUnsignedLongLong(546));
5352 7649 : PyModule_AddObject(m, "BUILTIN_RID_POWER_USERS", PyLong_FromUnsignedLongLong(547));
5353 7649 : PyModule_AddObject(m, "BUILTIN_RID_ACCOUNT_OPERATORS", PyLong_FromUnsignedLongLong(548));
5354 7649 : PyModule_AddObject(m, "BUILTIN_RID_SERVER_OPERATORS", PyLong_FromUnsignedLongLong(549));
5355 7649 : PyModule_AddObject(m, "BUILTIN_RID_PRINT_OPERATORS", PyLong_FromUnsignedLongLong(550));
5356 7649 : PyModule_AddObject(m, "BUILTIN_RID_BACKUP_OPERATORS", PyLong_FromUnsignedLongLong(551));
5357 7649 : PyModule_AddObject(m, "BUILTIN_RID_REPLICATOR", PyLong_FromUnsignedLongLong(552));
5358 7649 : PyModule_AddObject(m, "BUILTIN_RID_RAS_SERVERS", PyLong_FromUnsignedLongLong(553));
5359 7649 : PyModule_AddObject(m, "BUILTIN_RID_PRE_2K_ACCESS", PyLong_FromUnsignedLongLong(554));
5360 7649 : PyModule_AddObject(m, "BUILTIN_RID_REMOTE_DESKTOP_USERS", PyLong_FromUnsignedLongLong(555));
5361 7649 : PyModule_AddObject(m, "BUILTIN_RID_NETWORK_CONF_OPERATORS", PyLong_FromUnsignedLongLong(556));
5362 7649 : PyModule_AddObject(m, "BUILTIN_RID_INCOMING_FOREST_TRUST", PyLong_FromUnsignedLongLong(557));
5363 7649 : PyModule_AddObject(m, "BUILTIN_RID_PERFMON_USERS", PyLong_FromUnsignedLongLong(558));
5364 7649 : PyModule_AddObject(m, "BUILTIN_RID_PERFLOG_USERS", PyLong_FromUnsignedLongLong(559));
5365 7649 : PyModule_AddObject(m, "BUILTIN_RID_AUTH_ACCESS", PyLong_FromUnsignedLongLong(560));
5366 7649 : PyModule_AddObject(m, "BUILTIN_RID_TS_LICENSE_SERVERS", PyLong_FromUnsignedLongLong(561));
5367 7649 : PyModule_AddObject(m, "BUILTIN_RID_DISTRIBUTED_COM_USERS", PyLong_FromUnsignedLongLong(562));
5368 7649 : PyModule_AddObject(m, "BUILTIN_RID_IUSERS", PyLong_FromUnsignedLongLong(568));
5369 7649 : PyModule_AddObject(m, "BUILTIN_RID_CRYPTO_OPERATORS", PyLong_FromUnsignedLongLong(569));
5370 7649 : PyModule_AddObject(m, "BUILTIN_RID_EVENT_LOG_READERS", PyLong_FromUnsignedLongLong(573));
5371 7649 : PyModule_AddObject(m, "BUILTIN_RID_CERT_SERV_DCOM_ACCESS", PyLong_FromUnsignedLongLong(574));
5372 7649 : PyModule_AddObject(m, "BUILTIN_RID_RDS_REMOTE_ACCESS_SERVERS", PyLong_FromUnsignedLongLong(575));
5373 7649 : PyModule_AddObject(m, "BUILTIN_RID_RDS_ENDPOINT_SERVERS", PyLong_FromUnsignedLongLong(576));
5374 7649 : PyModule_AddObject(m, "BUILTIN_RID_RDS_MANAGEMENT_SERVERS", PyLong_FromUnsignedLongLong(577));
5375 7649 : PyModule_AddObject(m, "BUILTIN_RID_HYPER_V_ADMINS", PyLong_FromUnsignedLongLong(578));
5376 7649 : PyModule_AddObject(m, "BUILTIN_RID_ACCESS_CONTROL_ASSISTANCE_OPS", PyLong_FromUnsignedLongLong(579));
5377 7649 : PyModule_AddObject(m, "BUILTIN_RID_REMOTE_MANAGEMENT_USERS", PyLong_FromUnsignedLongLong(580));
5378 7649 : PyModule_AddObject(m, "NT4_ACL_REVISION", PyLong_FromUnsignedLongLong((uint32_t)(SECURITY_ACL_REVISION_NT4)));
5379 7649 : PyModule_AddObject(m, "SD_REVISION", PyLong_FromLong(SECURITY_DESCRIPTOR_REVISION_1));
5380 7649 : PyModule_AddObject(m, "SE_GROUP_DEFAULT_FLAGS", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_MANDATORY|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_ENABLED)));
5381 7649 : PyModule_AddObject(m, "SMB_SUPPORTED_SECINFO_FLAGS", PyLong_FromLong((SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL|SECINFO_LABEL|SECINFO_ATTRIBUTE|SECINFO_SCOPE|SECINFO_BACKUP|0)));
5382 7649 : PyModule_AddObject(m, "GUID_DRS_ALLOCATE_RIDS", PyUnicode_FromString("1abd7cf8-0a99-11d1-adbb-00c04fd8d5cd"));
5383 7649 : PyModule_AddObject(m, "GUID_DRS_CHANGE_DOMAIN_MASTER", PyUnicode_FromString("014bf69c-7b3b-11d1-85f6-08002be74fab"));
5384 7649 : PyModule_AddObject(m, "GUID_DRS_CHANGE_INFR_MASTER", PyUnicode_FromString("cc17b1fb-33d9-11d2-97d4-00c04fd8d5cd"));
5385 7649 : PyModule_AddObject(m, "GUID_DRS_CHANGE_PDC", PyUnicode_FromString("bae50096-4752-11d1-9052-00c04fc2d4cf"));
5386 7649 : PyModule_AddObject(m, "GUID_DRS_CHANGE_RID_MASTER", PyUnicode_FromString("d58d5f36-0a98-11d1-adbb-00c04fd8d5cd"));
5387 7649 : PyModule_AddObject(m, "GUID_DRS_CHANGE_SCHEMA_MASTER", PyUnicode_FromString("e12b56b6-0a95-11d1-adbb-00c04fd8d5cd"));
5388 7649 : PyModule_AddObject(m, "GUID_DRS_GET_CHANGES", PyUnicode_FromString("1131f6aa-9c07-11d1-f79f-00c04fc2dcd2"));
5389 7649 : PyModule_AddObject(m, "GUID_DRS_REPL_SYNCRONIZE", PyUnicode_FromString("1131f6ab-9c07-11d1-f79f-00c04fc2dcd2"));
5390 7649 : PyModule_AddObject(m, "GUID_DRS_MANAGE_TOPOLOGY", PyUnicode_FromString("1131f6ac-9c07-11d1-f79f-00c04fc2dcd2"));
5391 7649 : PyModule_AddObject(m, "GUID_DRS_GET_ALL_CHANGES", PyUnicode_FromString("1131f6ad-9c07-11d1-f79f-00c04fc2dcd2"));
5392 7649 : PyModule_AddObject(m, "GUID_DRS_RO_REPL_SECRET_SYNC", PyUnicode_FromString("1131f6ae-9c07-11d1-f79f-00c04fc2dcd2"));
5393 7649 : PyModule_AddObject(m, "GUID_DRS_GET_FILTERED_ATTRIBUTES", PyUnicode_FromString("89e95b76-444d-4c62-991a-0facbeda640c"));
5394 7649 : PyModule_AddObject(m, "GUID_DRS_MONITOR_TOPOLOGY", PyUnicode_FromString("f98340fb-7c5b-4cdb-a00b-2ebdfa115a96"));
5395 7649 : PyModule_AddObject(m, "GUID_DRS_USER_CHANGE_PASSWORD", PyUnicode_FromString("ab721a53-1e2f-11d0-9819-00aa0040529b"));
5396 7649 : PyModule_AddObject(m, "GUID_DRS_FORCE_CHANGE_PASSWORD", PyUnicode_FromString("00299570-246d-11d0-a768-00aa006e0529"));
5397 7649 : PyModule_AddObject(m, "GUID_DRS_UPDATE_PASSWORD_NOT_REQUIRED_BIT", PyUnicode_FromString("280f369c-67c7-438e-ae98-1d46f3c6f541"));
5398 7649 : PyModule_AddObject(m, "GUID_DRS_UNEXPIRE_PASSWORD", PyUnicode_FromString("ccc2dc7d-a6ad-4a7a-8846-c04e3cc53501"));
5399 7649 : PyModule_AddObject(m, "GUID_DRS_ENABLE_PER_USER_REVERSIBLY_ENCRYPTED_PASSWORD", PyUnicode_FromString("05c74c5e-4deb-43b4-bd9f-86664c2a7fd5"));
5400 7649 : PyModule_AddObject(m, "GUID_DRS_DS_INSTALL_REPLICA", PyUnicode_FromString("9923a32a-3607-11d2-b9be-0000f87a36b2"));
5401 7649 : PyModule_AddObject(m, "GUID_DRS_REANIMATE_TOMBSTONE", PyUnicode_FromString("45ec5156-db7e-47bb-b53f-dbeb2d03c40f"));
5402 7649 : PyModule_AddObject(m, "GUID_DRS_ALLOWED_TO_AUTHENTICATE", PyUnicode_FromString("68b1d179-0d15-4D4F-ab71-46152e79a7bc"));
5403 7649 : PyModule_AddObject(m, "GUID_DRS_VALIDATE_SPN", PyUnicode_FromString("f3a64788-5306-11d1-a9c5-0000f80367c1"));
5404 7649 : PyModule_AddObject(m, "GUID_DRS_SELF_MEMBERSHIP", PyUnicode_FromString("bf9679c0-0de6-11d0-a285-00aa003049e2"));
5405 7649 : PyModule_AddObject(m, "GUID_DRS_DNS_HOST_NAME", PyUnicode_FromString("72e39547-7b18-11d1-adef-00c04fd8d5cd"));
5406 7649 : PyModule_AddObject(m, "GUID_DRS_ADD_DNS_HOST_NAME", PyUnicode_FromString("80863791-dbe9-4eb8-837e-7f0ab55d9ac7"));
5407 7649 : PyModule_AddObject(m, "GUID_DRS_BEHAVIOR_VERSION", PyUnicode_FromString("d31a8757-2447-4545-8081-3bb610cacbf2"));
5408 7649 : PyModule_AddObject(m, "IMPLICIT_OWNER_READ_CONTROL_RIGHTS", PyLong_FromLong((uint16_t)(IMPLICIT_OWNER_READ_CONTROL_RIGHTS)));
5409 7649 : PyModule_AddObject(m, "IMPLICIT_OWNER_READ_CONTROL_AND_WRITE_DAC_RIGHTS", PyLong_FromLong((uint16_t)(IMPLICIT_OWNER_READ_CONTROL_AND_WRITE_DAC_RIGHTS)));
5410 7649 : PyModule_AddObject(m, "SEC_PRIV_INVALID", PyLong_FromLong((uint16_t)(SEC_PRIV_INVALID)));
5411 7649 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_QUOTA", PyLong_FromLong((uint16_t)(SEC_PRIV_INCREASE_QUOTA)));
5412 7649 : PyModule_AddObject(m, "SEC_PRIV_MACHINE_ACCOUNT", PyLong_FromLong((uint16_t)(SEC_PRIV_MACHINE_ACCOUNT)));
5413 7649 : PyModule_AddObject(m, "SEC_PRIV_SECURITY", PyLong_FromLong((uint16_t)(SEC_PRIV_SECURITY)));
5414 7649 : PyModule_AddObject(m, "SEC_PRIV_TAKE_OWNERSHIP", PyLong_FromLong((uint16_t)(SEC_PRIV_TAKE_OWNERSHIP)));
5415 7649 : PyModule_AddObject(m, "SEC_PRIV_LOAD_DRIVER", PyLong_FromLong((uint16_t)(SEC_PRIV_LOAD_DRIVER)));
5416 7649 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_PROFILE", PyLong_FromLong((uint16_t)(SEC_PRIV_SYSTEM_PROFILE)));
5417 7649 : PyModule_AddObject(m, "SEC_PRIV_SYSTEMTIME", PyLong_FromLong((uint16_t)(SEC_PRIV_SYSTEMTIME)));
5418 7649 : PyModule_AddObject(m, "SEC_PRIV_PROFILE_SINGLE_PROCESS", PyLong_FromLong((uint16_t)(SEC_PRIV_PROFILE_SINGLE_PROCESS)));
5419 7649 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_BASE_PRIORITY", PyLong_FromLong((uint16_t)(SEC_PRIV_INCREASE_BASE_PRIORITY)));
5420 7649 : PyModule_AddObject(m, "SEC_PRIV_CREATE_PAGEFILE", PyLong_FromLong((uint16_t)(SEC_PRIV_CREATE_PAGEFILE)));
5421 7649 : PyModule_AddObject(m, "SEC_PRIV_BACKUP", PyLong_FromLong((uint16_t)(SEC_PRIV_BACKUP)));
5422 7649 : PyModule_AddObject(m, "SEC_PRIV_RESTORE", PyLong_FromLong((uint16_t)(SEC_PRIV_RESTORE)));
5423 7649 : PyModule_AddObject(m, "SEC_PRIV_SHUTDOWN", PyLong_FromLong((uint16_t)(SEC_PRIV_SHUTDOWN)));
5424 7649 : PyModule_AddObject(m, "SEC_PRIV_DEBUG", PyLong_FromLong((uint16_t)(SEC_PRIV_DEBUG)));
5425 7649 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_ENVIRONMENT", PyLong_FromLong((uint16_t)(SEC_PRIV_SYSTEM_ENVIRONMENT)));
5426 7649 : PyModule_AddObject(m, "SEC_PRIV_CHANGE_NOTIFY", PyLong_FromLong((uint16_t)(SEC_PRIV_CHANGE_NOTIFY)));
5427 7649 : PyModule_AddObject(m, "SEC_PRIV_REMOTE_SHUTDOWN", PyLong_FromLong((uint16_t)(SEC_PRIV_REMOTE_SHUTDOWN)));
5428 7649 : PyModule_AddObject(m, "SEC_PRIV_UNDOCK", PyLong_FromLong((uint16_t)(SEC_PRIV_UNDOCK)));
5429 7649 : PyModule_AddObject(m, "SEC_PRIV_ENABLE_DELEGATION", PyLong_FromLong((uint16_t)(SEC_PRIV_ENABLE_DELEGATION)));
5430 7649 : PyModule_AddObject(m, "SEC_PRIV_MANAGE_VOLUME", PyLong_FromLong((uint16_t)(SEC_PRIV_MANAGE_VOLUME)));
5431 7649 : PyModule_AddObject(m, "SEC_PRIV_IMPERSONATE", PyLong_FromLong((uint16_t)(SEC_PRIV_IMPERSONATE)));
5432 7649 : PyModule_AddObject(m, "SEC_PRIV_CREATE_GLOBAL", PyLong_FromLong((uint16_t)(SEC_PRIV_CREATE_GLOBAL)));
5433 7649 : PyModule_AddObject(m, "SEC_PRIV_PRINT_OPERATOR", PyLong_FromLong((uint16_t)(SEC_PRIV_PRINT_OPERATOR)));
5434 7649 : PyModule_AddObject(m, "SEC_PRIV_ADD_USERS", PyLong_FromLong((uint16_t)(SEC_PRIV_ADD_USERS)));
5435 7649 : PyModule_AddObject(m, "SEC_PRIV_DISK_OPERATOR", PyLong_FromLong((uint16_t)(SEC_PRIV_DISK_OPERATOR)));
5436 7649 : PyModule_AddObject(m, "SEC_PRIV_MACHINE_ACCOUNT_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_MACHINE_ACCOUNT_BIT));
5437 7649 : PyModule_AddObject(m, "SEC_PRIV_PRINT_OPERATOR_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_PRINT_OPERATOR_BIT));
5438 7649 : PyModule_AddObject(m, "SEC_PRIV_ADD_USERS_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_ADD_USERS_BIT));
5439 7649 : PyModule_AddObject(m, "SEC_PRIV_DISK_OPERATOR_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_DISK_OPERATOR_BIT));
5440 7649 : PyModule_AddObject(m, "SEC_PRIV_REMOTE_SHUTDOWN_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_REMOTE_SHUTDOWN_BIT));
5441 7649 : PyModule_AddObject(m, "SEC_PRIV_BACKUP_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_BACKUP_BIT));
5442 7649 : PyModule_AddObject(m, "SEC_PRIV_RESTORE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_RESTORE_BIT));
5443 7649 : PyModule_AddObject(m, "SEC_PRIV_TAKE_OWNERSHIP_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_TAKE_OWNERSHIP_BIT));
5444 7649 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_QUOTA_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_INCREASE_QUOTA_BIT));
5445 7649 : PyModule_AddObject(m, "SEC_PRIV_SECURITY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SECURITY_BIT));
5446 7649 : PyModule_AddObject(m, "SEC_PRIV_LOAD_DRIVER_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_LOAD_DRIVER_BIT));
5447 7649 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_PROFILE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEM_PROFILE_BIT));
5448 7649 : PyModule_AddObject(m, "SEC_PRIV_SYSTEMTIME_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEMTIME_BIT));
5449 7649 : PyModule_AddObject(m, "SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT));
5450 7649 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_BASE_PRIORITY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_INCREASE_BASE_PRIORITY_BIT));
5451 7649 : PyModule_AddObject(m, "SEC_PRIV_CREATE_PAGEFILE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CREATE_PAGEFILE_BIT));
5452 7649 : PyModule_AddObject(m, "SEC_PRIV_SHUTDOWN_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SHUTDOWN_BIT));
5453 7649 : PyModule_AddObject(m, "SEC_PRIV_DEBUG_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_DEBUG_BIT));
5454 7649 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_ENVIRONMENT_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEM_ENVIRONMENT_BIT));
5455 7649 : PyModule_AddObject(m, "SEC_PRIV_CHANGE_NOTIFY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CHANGE_NOTIFY_BIT));
5456 7649 : PyModule_AddObject(m, "SEC_PRIV_UNDOCK_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_UNDOCK_BIT));
5457 7649 : PyModule_AddObject(m, "SEC_PRIV_ENABLE_DELEGATION_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_ENABLE_DELEGATION_BIT));
5458 7649 : PyModule_AddObject(m, "SEC_PRIV_MANAGE_VOLUME_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_MANAGE_VOLUME_BIT));
5459 7649 : PyModule_AddObject(m, "SEC_PRIV_IMPERSONATE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_IMPERSONATE_BIT));
5460 7649 : PyModule_AddObject(m, "SEC_PRIV_CREATE_GLOBAL_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CREATE_GLOBAL_BIT));
5461 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_INTERACTIVE)));
5462 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_NETWORK)));
5463 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_BATCH", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_BATCH)));
5464 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_SERVICE)));
5465 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_PROXY", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_PROXY)));
5466 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_DENY_INTERACTIVE)));
5467 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_DENY_NETWORK)));
5468 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_BATCH", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_DENY_BATCH)));
5469 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_DENY_SERVICE)));
5470 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_REMOTE_INTERACTIVE)));
5471 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE)));
5472 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_ALL", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_ALL)));
5473 7649 : PyModule_AddObject(m, "LSA_POLICY_MODE_ALL_NT4", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_MODE_ALL_NT4)));
5474 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_OBJECT_INHERIT", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_OBJECT_INHERIT)));
5475 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_CONTAINER_INHERIT", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_CONTAINER_INHERIT)));
5476 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_NO_PROPAGATE_INHERIT)));
5477 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_INHERIT_ONLY", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_INHERIT_ONLY)));
5478 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_INHERITED_ACE", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_INHERITED_ACE)));
5479 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_VALID_INHERIT", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_VALID_INHERIT)));
5480 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_SUCCESSFUL_ACCESS)));
5481 7649 : PyModule_AddObject(m, "SEC_ACE_FLAG_FAILED_ACCESS", PyLong_FromLong((uint16_t)(SEC_ACE_FLAG_FAILED_ACCESS)));
5482 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_ALLOWED)));
5483 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_DENIED)));
5484 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_AUDIT)));
5485 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_ALARM)));
5486 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ALLOWED_COMPOUND", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ALLOWED_COMPOUND)));
5487 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)));
5488 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_DENIED_OBJECT)));
5489 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT)));
5490 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT)));
5491 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK)));
5492 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK)));
5493 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT)));
5494 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT)));
5495 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK)));
5496 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM_CALLBACK", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_ALARM_CALLBACK)));
5497 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT)));
5498 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT)));
5499 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_MANDATORY_LABEL", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_MANDATORY_LABEL)));
5500 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE)));
5501 7649 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_SCOPED_POLICY_ID", PyLong_FromLong((uint16_t)(SEC_ACE_TYPE_SYSTEM_SCOPED_POLICY_ID)));
5502 7649 : PyModule_AddObject(m, "SEC_ACE_OBJECT_TYPE_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)(SEC_ACE_OBJECT_TYPE_PRESENT)));
5503 7649 : PyModule_AddObject(m, "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)));
5504 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE)));
5505 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE)));
5506 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY)));
5507 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT)));
5508 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_DISABLED)));
5509 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_MANDATORY", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_MANDATORY)));
5510 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_MANUAL", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_MANUAL)));
5511 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_POLICY_DERIVED", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_POLICY_DERIVED)));
5512 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_UNIQUE_AND_SORTED", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_UNIQUE_AND_SORTED)));
5513 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_RESERVED_FOR_SAMBA", PyLong_FromUnsignedLongLong((uint32_t)(CLAIM_SECURITY_ATTRIBUTE_RESERVED_FOR_SAMBA)));
5514 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64", PyLong_FromLong((uint16_t)(CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64)));
5515 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64", PyLong_FromLong((uint16_t)(CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64)));
5516 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING", PyLong_FromLong((uint16_t)(CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING)));
5517 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_TYPE_SID", PyLong_FromLong((uint16_t)(CLAIM_SECURITY_ATTRIBUTE_TYPE_SID)));
5518 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN", PyLong_FromLong((uint16_t)(CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN)));
5519 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING", PyLong_FromLong((uint16_t)(CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING)));
5520 7649 : PyModule_AddObject(m, "SECURITY_ACL_REVISION_NT4", PyLong_FromLong((uint16_t)(SECURITY_ACL_REVISION_NT4)));
5521 7649 : PyModule_AddObject(m, "SECURITY_ACL_REVISION_ADS", PyLong_FromLong((uint16_t)(SECURITY_ACL_REVISION_ADS)));
5522 7649 : PyModule_AddObject(m, "SECURITY_DESCRIPTOR_REVISION_1", PyLong_FromLong((uint16_t)(SECURITY_DESCRIPTOR_REVISION_1)));
5523 7649 : PyModule_AddObject(m, "SEC_DESC_OWNER_DEFAULTED", PyLong_FromLong((uint16_t)(SEC_DESC_OWNER_DEFAULTED)));
5524 7649 : PyModule_AddObject(m, "SEC_DESC_GROUP_DEFAULTED", PyLong_FromLong((uint16_t)(SEC_DESC_GROUP_DEFAULTED)));
5525 7649 : PyModule_AddObject(m, "SEC_DESC_DACL_PRESENT", PyLong_FromLong((uint16_t)(SEC_DESC_DACL_PRESENT)));
5526 7649 : PyModule_AddObject(m, "SEC_DESC_DACL_DEFAULTED", PyLong_FromLong((uint16_t)(SEC_DESC_DACL_DEFAULTED)));
5527 7649 : PyModule_AddObject(m, "SEC_DESC_SACL_PRESENT", PyLong_FromLong((uint16_t)(SEC_DESC_SACL_PRESENT)));
5528 7649 : PyModule_AddObject(m, "SEC_DESC_SACL_DEFAULTED", PyLong_FromLong((uint16_t)(SEC_DESC_SACL_DEFAULTED)));
5529 7649 : PyModule_AddObject(m, "SEC_DESC_DACL_TRUSTED", PyLong_FromLong((uint16_t)(SEC_DESC_DACL_TRUSTED)));
5530 7649 : PyModule_AddObject(m, "SEC_DESC_SERVER_SECURITY", PyLong_FromLong((uint16_t)(SEC_DESC_SERVER_SECURITY)));
5531 7649 : PyModule_AddObject(m, "SEC_DESC_DACL_AUTO_INHERIT_REQ", PyLong_FromLong((uint16_t)(SEC_DESC_DACL_AUTO_INHERIT_REQ)));
5532 7649 : PyModule_AddObject(m, "SEC_DESC_SACL_AUTO_INHERIT_REQ", PyLong_FromLong((uint16_t)(SEC_DESC_SACL_AUTO_INHERIT_REQ)));
5533 7649 : PyModule_AddObject(m, "SEC_DESC_DACL_AUTO_INHERITED", PyLong_FromLong((uint16_t)(SEC_DESC_DACL_AUTO_INHERITED)));
5534 7649 : PyModule_AddObject(m, "SEC_DESC_SACL_AUTO_INHERITED", PyLong_FromLong((uint16_t)(SEC_DESC_SACL_AUTO_INHERITED)));
5535 7649 : PyModule_AddObject(m, "SEC_DESC_DACL_PROTECTED", PyLong_FromLong((uint16_t)(SEC_DESC_DACL_PROTECTED)));
5536 7649 : PyModule_AddObject(m, "SEC_DESC_SACL_PROTECTED", PyLong_FromLong((uint16_t)(SEC_DESC_SACL_PROTECTED)));
5537 7649 : PyModule_AddObject(m, "SEC_DESC_RM_CONTROL_VALID", PyLong_FromLong((uint16_t)(SEC_DESC_RM_CONTROL_VALID)));
5538 7649 : PyModule_AddObject(m, "SEC_DESC_SELF_RELATIVE", PyLong_FromLong((uint16_t)(SEC_DESC_SELF_RELATIVE)));
5539 7649 : PyModule_AddObject(m, "SE_GROUP_MANDATORY", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_MANDATORY)));
5540 7649 : PyModule_AddObject(m, "SE_GROUP_ENABLED_BY_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_ENABLED_BY_DEFAULT)));
5541 7649 : PyModule_AddObject(m, "SE_GROUP_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_ENABLED)));
5542 7649 : PyModule_AddObject(m, "SE_GROUP_OWNER", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_OWNER)));
5543 7649 : PyModule_AddObject(m, "SE_GROUP_USE_FOR_DENY_ONLY", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_USE_FOR_DENY_ONLY)));
5544 7649 : PyModule_AddObject(m, "SE_GROUP_INTEGRITY", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_INTEGRITY)));
5545 7649 : PyModule_AddObject(m, "SE_GROUP_INTEGRITY_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_INTEGRITY_ENABLED)));
5546 7649 : PyModule_AddObject(m, "SE_GROUP_RESOURCE", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_RESOURCE)));
5547 7649 : PyModule_AddObject(m, "SE_GROUP_LOGON_ID", PyLong_FromUnsignedLongLong((uint32_t)(SE_GROUP_LOGON_ID)));
5548 7649 : PyModule_AddObject(m, "CLAIMS_EVALUATION_INVALID_STATE", PyLong_FromLong((uint16_t)(CLAIMS_EVALUATION_INVALID_STATE)));
5549 7649 : PyModule_AddObject(m, "CLAIMS_EVALUATION_NEVER", PyLong_FromLong((uint16_t)(CLAIMS_EVALUATION_NEVER)));
5550 7649 : PyModule_AddObject(m, "CLAIMS_EVALUATION_ALWAYS", PyLong_FromLong((uint16_t)(CLAIMS_EVALUATION_ALWAYS)));
5551 7649 : PyModule_AddObject(m, "SECINFO_OWNER", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_OWNER)));
5552 7649 : PyModule_AddObject(m, "SECINFO_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_GROUP)));
5553 7649 : PyModule_AddObject(m, "SECINFO_DACL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_DACL)));
5554 7649 : PyModule_AddObject(m, "SECINFO_SACL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_SACL)));
5555 7649 : PyModule_AddObject(m, "SECINFO_LABEL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_LABEL)));
5556 7649 : PyModule_AddObject(m, "SECINFO_ATTRIBUTE", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_ATTRIBUTE)));
5557 7649 : PyModule_AddObject(m, "SECINFO_SCOPE", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_SCOPE)));
5558 7649 : PyModule_AddObject(m, "SECINFO_BACKUP", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_BACKUP)));
5559 7649 : PyModule_AddObject(m, "SECINFO_UNPROTECTED_SACL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_UNPROTECTED_SACL)));
5560 7649 : PyModule_AddObject(m, "SECINFO_UNPROTECTED_DACL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_UNPROTECTED_DACL)));
5561 7649 : PyModule_AddObject(m, "SECINFO_PROTECTED_SACL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_PROTECTED_SACL)));
5562 7649 : PyModule_AddObject(m, "SECINFO_PROTECTED_DACL", PyLong_FromUnsignedLongLong((uint32_t)(SECINFO_PROTECTED_DACL)));
5563 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_DES_CBC_CRC", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_DES_CBC_CRC)));
5564 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_DES_CBC_MD5", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_DES_CBC_MD5)));
5565 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_RC4_HMAC_MD5", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_RC4_HMAC_MD5)));
5566 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96)));
5567 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96)));
5568 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK)));
5569 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_FAST_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_FAST_SUPPORTED)));
5570 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED)));
5571 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_CLAIMS_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_CLAIMS_SUPPORTED)));
5572 7649 : PyModule_AddObject(m, "KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)(KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED)));
5573 7649 : PyModule_AddObject(m, "SEC_DACL_AUTO_INHERIT", PyLong_FromUnsignedLongLong((uint32_t)(SEC_DACL_AUTO_INHERIT)));
5574 7649 : PyModule_AddObject(m, "SEC_SACL_AUTO_INHERIT", PyLong_FromUnsignedLongLong((uint32_t)(SEC_SACL_AUTO_INHERIT)));
5575 7649 : PyModule_AddObject(m, "SEC_DEFAULT_DESCRIPTOR", PyLong_FromUnsignedLongLong((uint32_t)(SEC_DEFAULT_DESCRIPTOR)));
5576 7649 : PyModule_AddObject(m, "SEC_OWNER_FROM_PARENT", PyLong_FromUnsignedLongLong((uint32_t)(SEC_OWNER_FROM_PARENT)));
5577 7649 : PyModule_AddObject(m, "SEC_GROUP_FROM_PARENT", PyLong_FromUnsignedLongLong((uint32_t)(SEC_GROUP_FROM_PARENT)));
5578 6406 : Py_INCREF((PyObject *)(void *)&dom_sid_Type);
5579 7649 : PyModule_AddObject(m, "dom_sid", (PyObject *)(void *)&dom_sid_Type);
5580 6406 : Py_INCREF((PyObject *)(void *)&security_ace_object_type_Type);
5581 7649 : PyModule_AddObject(m, "ace_object_type", (PyObject *)(void *)&security_ace_object_type_Type);
5582 6406 : Py_INCREF((PyObject *)(void *)&security_ace_object_inherited_type_Type);
5583 7649 : PyModule_AddObject(m, "ace_object_inherited_type", (PyObject *)(void *)&security_ace_object_inherited_type_Type);
5584 6406 : Py_INCREF((PyObject *)(void *)&security_ace_object_Type);
5585 7649 : PyModule_AddObject(m, "ace_object", (PyObject *)(void *)&security_ace_object_Type);
5586 6406 : Py_INCREF((PyObject *)(void *)&claim_values_Type);
5587 7649 : PyModule_AddObject(m, "claim_values", (PyObject *)(void *)&claim_values_Type);
5588 6406 : Py_INCREF((PyObject *)(void *)&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type);
5589 7649 : PyModule_AddObject(m, "CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1", (PyObject *)(void *)&CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Type);
5590 6406 : Py_INCREF((PyObject *)(void *)&security_ace_object_ctr_Type);
5591 7649 : PyModule_AddObject(m, "ace_object_ctr", (PyObject *)(void *)&security_ace_object_ctr_Type);
5592 6406 : Py_INCREF((PyObject *)(void *)&security_ace_coda_Type);
5593 7649 : PyModule_AddObject(m, "ace_coda", (PyObject *)(void *)&security_ace_coda_Type);
5594 6406 : Py_INCREF((PyObject *)(void *)&security_ace_Type);
5595 7649 : PyModule_AddObject(m, "ace", (PyObject *)(void *)&security_ace_Type);
5596 6406 : Py_INCREF((PyObject *)(void *)&security_acl_Type);
5597 7649 : PyModule_AddObject(m, "acl", (PyObject *)(void *)&security_acl_Type);
5598 6406 : Py_INCREF((PyObject *)(void *)&security_descriptor_Type);
5599 7649 : PyModule_AddObject(m, "descriptor", (PyObject *)(void *)&security_descriptor_Type);
5600 6406 : Py_INCREF((PyObject *)(void *)&sec_desc_buf_Type);
5601 7649 : PyModule_AddObject(m, "sec_desc_buf", (PyObject *)(void *)&sec_desc_buf_Type);
5602 6406 : Py_INCREF((PyObject *)(void *)&security_token_Type);
5603 7649 : PyModule_AddObject(m, "token", (PyObject *)(void *)&security_token_Type);
5604 6406 : Py_INCREF((PyObject *)(void *)&security_token_descriptor_fuzzing_pair_Type);
5605 7649 : PyModule_AddObject(m, "token_descriptor_fuzzing_pair", (PyObject *)(void *)&security_token_descriptor_fuzzing_pair_Type);
5606 6406 : Py_INCREF((PyObject *)(void *)&security_unix_token_Type);
5607 7649 : PyModule_AddObject(m, "unix_token", (PyObject *)(void *)&security_unix_token_Type);
5608 6406 : Py_INCREF((PyObject *)(void *)&LSAP_TOKEN_INFO_INTEGRITY_Type);
5609 7649 : PyModule_AddObject(m, "LSAP_TOKEN_INFO_INTEGRITY", (PyObject *)(void *)&LSAP_TOKEN_INFO_INTEGRITY_Type);
5610 6406 : Py_INCREF((PyObject *)(void *)&generic_mapping_Type);
5611 7649 : PyModule_AddObject(m, "generic_mapping", (PyObject *)(void *)&generic_mapping_Type);
5612 6406 : Py_INCREF((PyObject *)(void *)&standard_mapping_Type);
5613 7649 : PyModule_AddObject(m, "standard_mapping", (PyObject *)(void *)&standard_mapping_Type);
5614 6406 : Py_INCREF((PyObject *)(void *)&security_InterfaceType);
5615 7649 : PyModule_AddObject(m, "security", (PyObject *)(void *)&security_InterfaceType);
5616 6406 : Py_INCREF((PyObject *)(void *)&security_SyntaxType);
5617 7649 : PyModule_AddObject(m, "security_abstract_syntax", (PyObject *)(void *)&security_SyntaxType);
5618 6406 : Py_INCREF((PyObject *)(void *)&security_SyntaxType);
5619 7649 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&security_SyntaxType);
5620 : #ifdef PY_MOD_SECURITY_PATCH
5621 7649 : PY_MOD_SECURITY_PATCH(m);
5622 : #endif
5623 7649 : out:
5624 7649 : Py_XDECREF(dep_samba_dcerpc_misc);
5625 7649 : Py_XDECREF(dep_talloc);
5626 7649 : Py_XDECREF(dep_samba_dcerpc_base);
5627 7456 : return m;
5628 :
5629 : }
|