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