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 553785 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 553785 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 276922 : case 4:
38 276922 : return UINT32_MAX;
39 274343 : case 2:
40 274343 : return UINT16_MAX;
41 2520 : case 1:
42 2520 : 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 security_ace_object_ctr_Type;
70 : static PyTypeObject security_ace_Type;
71 : static PyTypeObject security_acl_Type;
72 : static PyTypeObject security_descriptor_Type;
73 : static PyTypeObject sec_desc_buf_Type;
74 : static PyTypeObject security_token_Type;
75 : static PyTypeObject security_unix_token_Type;
76 : static PyTypeObject LSAP_TOKEN_INFO_INTEGRITY_Type;
77 : static PyTypeObject generic_mapping_Type;
78 : static PyTypeObject standard_mapping_Type;
79 : static PyTypeObject security_InterfaceType;
80 :
81 : static PyTypeObject *BaseObject_Type;
82 : static PyTypeObject *GUID_Type;
83 : static PyTypeObject *ClientConnection_Type;
84 : static PyTypeObject *ndr_syntax_id_Type;
85 : #include "librpc/ndr/py_security.c"
86 :
87 :
88 0 : static PyObject *py_dom_sid_get_sid_rev_num(PyObject *obj, void *closure)
89 : {
90 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
91 : PyObject *py_sid_rev_num;
92 0 : py_sid_rev_num = PyLong_FromLong((uint16_t)object->sid_rev_num);
93 0 : return py_sid_rev_num;
94 : }
95 :
96 0 : static int py_dom_sid_set_sid_rev_num(PyObject *py_obj, PyObject *value, void *closure)
97 : {
98 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
99 0 : if (value == NULL) {
100 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_rev_num");
101 0 : return -1;
102 : }
103 : {
104 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_rev_num));
105 0 : if (PyLong_Check(value)) {
106 : unsigned long long test_var;
107 0 : test_var = PyLong_AsUnsignedLongLong(value);
108 0 : if (PyErr_Occurred() != NULL) {
109 0 : return -1;
110 : }
111 0 : if (test_var > uint_max) {
112 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
113 : PyLong_Type.tp_name, uint_max, test_var);
114 0 : return -1;
115 : }
116 0 : object->sid_rev_num = test_var;
117 : } else {
118 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
119 : PyLong_Type.tp_name);
120 0 : return -1;
121 : }
122 : }
123 0 : return 0;
124 : }
125 :
126 0 : static PyObject *py_dom_sid_get_num_auths(PyObject *obj, void *closure)
127 : {
128 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
129 : PyObject *py_num_auths;
130 0 : py_num_auths = PyLong_FromLong(object->num_auths);
131 0 : return py_num_auths;
132 : }
133 :
134 0 : static int py_dom_sid_set_num_auths(PyObject *py_obj, PyObject *value, void *closure)
135 : {
136 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
137 0 : if (value == NULL) {
138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_auths");
139 0 : return -1;
140 : }
141 : {
142 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->num_auths));
143 0 : const long long int_min = -int_max - 1;
144 0 : if (PyLong_Check(value)) {
145 : long long test_var;
146 0 : test_var = PyLong_AsLongLong(value);
147 0 : if (PyErr_Occurred() != NULL) {
148 0 : return -1;
149 : }
150 0 : if (test_var < int_min || test_var > int_max) {
151 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
152 : PyLong_Type.tp_name, int_min, int_max, test_var);
153 0 : return -1;
154 : }
155 0 : object->num_auths = test_var;
156 : } else {
157 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
158 : PyLong_Type.tp_name);
159 0 : return -1;
160 : }
161 : }
162 0 : return 0;
163 : }
164 :
165 0 : static PyObject *py_dom_sid_get_id_auth(PyObject *obj, void *closure)
166 : {
167 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
168 : PyObject *py_id_auth;
169 0 : py_id_auth = PyList_New(6);
170 0 : if (py_id_auth == NULL) {
171 0 : return NULL;
172 : }
173 : {
174 : int id_auth_cntr_0;
175 0 : for (id_auth_cntr_0 = 0; id_auth_cntr_0 < (6); id_auth_cntr_0++) {
176 : PyObject *py_id_auth_0;
177 0 : py_id_auth_0 = PyLong_FromLong((uint16_t)object->id_auth[id_auth_cntr_0]);
178 0 : PyList_SetItem(py_id_auth, id_auth_cntr_0, py_id_auth_0);
179 : }
180 : }
181 0 : return py_id_auth;
182 : }
183 :
184 0 : static int py_dom_sid_set_id_auth(PyObject *py_obj, PyObject *value, void *closure)
185 : {
186 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
187 0 : if (value == NULL) {
188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->id_auth");
189 0 : return -1;
190 : }
191 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
192 : {
193 : int id_auth_cntr_0;
194 0 : if (ARRAY_SIZE(object->id_auth) != PyList_GET_SIZE(value)) {
195 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));
196 0 : return -1;
197 : }
198 0 : for (id_auth_cntr_0 = 0; id_auth_cntr_0 < PyList_GET_SIZE(value); id_auth_cntr_0++) {
199 0 : if (PyList_GET_ITEM(value, id_auth_cntr_0) == NULL) {
200 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->id_auth[id_auth_cntr_0]");
201 0 : return -1;
202 : }
203 : {
204 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id_auth[id_auth_cntr_0]));
205 0 : if (PyLong_Check(PyList_GET_ITEM(value, id_auth_cntr_0))) {
206 : unsigned long long test_var;
207 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, id_auth_cntr_0));
208 0 : if (PyErr_Occurred() != NULL) {
209 0 : return -1;
210 : }
211 0 : if (test_var > uint_max) {
212 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
213 : PyLong_Type.tp_name, uint_max, test_var);
214 0 : return -1;
215 : }
216 0 : object->id_auth[id_auth_cntr_0] = test_var;
217 : } else {
218 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
219 : PyLong_Type.tp_name);
220 0 : return -1;
221 : }
222 : }
223 : }
224 : }
225 0 : return 0;
226 : }
227 :
228 0 : static PyObject *py_dom_sid_get_sub_auths(PyObject *obj, void *closure)
229 : {
230 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
231 : PyObject *py_sub_auths;
232 0 : py_sub_auths = PyList_New(15);
233 0 : if (py_sub_auths == NULL) {
234 0 : return NULL;
235 : }
236 : {
237 : int sub_auths_cntr_0;
238 0 : for (sub_auths_cntr_0 = 0; sub_auths_cntr_0 < (15); sub_auths_cntr_0++) {
239 : PyObject *py_sub_auths_0;
240 0 : py_sub_auths_0 = PyLong_FromUnsignedLongLong((uint32_t)object->sub_auths[sub_auths_cntr_0]);
241 0 : PyList_SetItem(py_sub_auths, sub_auths_cntr_0, py_sub_auths_0);
242 : }
243 : }
244 0 : return py_sub_auths;
245 : }
246 :
247 0 : static int py_dom_sid_set_sub_auths(PyObject *py_obj, PyObject *value, void *closure)
248 : {
249 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
250 0 : if (value == NULL) {
251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub_auths");
252 0 : return -1;
253 : }
254 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
255 : {
256 : int sub_auths_cntr_0;
257 0 : if (ARRAY_SIZE(object->sub_auths) != PyList_GET_SIZE(value)) {
258 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));
259 0 : return -1;
260 : }
261 0 : for (sub_auths_cntr_0 = 0; sub_auths_cntr_0 < PyList_GET_SIZE(value); sub_auths_cntr_0++) {
262 0 : if (PyList_GET_ITEM(value, sub_auths_cntr_0) == NULL) {
263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub_auths[sub_auths_cntr_0]");
264 0 : return -1;
265 : }
266 : {
267 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sub_auths[sub_auths_cntr_0]));
268 0 : if (PyLong_Check(PyList_GET_ITEM(value, sub_auths_cntr_0))) {
269 : unsigned long long test_var;
270 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, sub_auths_cntr_0));
271 0 : if (PyErr_Occurred() != NULL) {
272 0 : return -1;
273 : }
274 0 : if (test_var > uint_max) {
275 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
276 : PyLong_Type.tp_name, uint_max, test_var);
277 0 : return -1;
278 : }
279 0 : object->sub_auths[sub_auths_cntr_0] = test_var;
280 : } else {
281 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
282 : PyLong_Type.tp_name);
283 0 : return -1;
284 : }
285 : }
286 : }
287 : }
288 0 : return 0;
289 : }
290 :
291 : static PyGetSetDef py_dom_sid_getsetters[] = {
292 : {
293 : .name = discard_const_p(char, "sid_rev_num"),
294 : .get = py_dom_sid_get_sid_rev_num,
295 : .set = py_dom_sid_set_sid_rev_num,
296 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
297 : },
298 : {
299 : .name = discard_const_p(char, "num_auths"),
300 : .get = py_dom_sid_get_num_auths,
301 : .set = py_dom_sid_set_num_auths,
302 : .doc = discard_const_p(char, "PIDL-generated element of base type int8")
303 : },
304 : {
305 : .name = discard_const_p(char, "id_auth"),
306 : .get = py_dom_sid_get_id_auth,
307 : .set = py_dom_sid_set_id_auth,
308 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
309 : },
310 : {
311 : .name = discard_const_p(char, "sub_auths"),
312 : .get = py_dom_sid_get_sub_auths,
313 : .set = py_dom_sid_set_sub_auths,
314 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
315 : },
316 : { .name = NULL }
317 : };
318 :
319 30043 : static PyObject *py_dom_sid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
320 : {
321 30043 : return pytalloc_new(struct dom_sid, type);
322 : }
323 :
324 181 : static PyObject *py_dom_sid_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
325 : {
326 181 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
327 181 : PyObject *ret = NULL;
328 : DATA_BLOB blob;
329 : enum ndr_err_code err;
330 181 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
331 181 : if (tmp_ctx == NULL) {
332 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
333 0 : return NULL;
334 : }
335 181 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dom_sid);
336 181 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
337 0 : TALLOC_FREE(tmp_ctx);
338 0 : PyErr_SetNdrError(err);
339 0 : return NULL;
340 : }
341 :
342 181 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
343 181 : TALLOC_FREE(tmp_ctx);
344 181 : return ret;
345 : }
346 :
347 11217 : static PyObject *py_dom_sid_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
348 : {
349 11217 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
350 11217 : DATA_BLOB blob = {.data = NULL, .length = 0};
351 11217 : Py_ssize_t blob_length = 0;
352 : enum ndr_err_code err;
353 11217 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
354 11217 : PyObject *allow_remaining_obj = NULL;
355 11217 : bool allow_remaining = false;
356 :
357 11217 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
358 : discard_const_p(char *, kwnames),
359 : &blob.data, &blob_length,
360 : &allow_remaining_obj)) {
361 0 : return NULL;
362 : }
363 11217 : blob.length = blob_length;
364 :
365 11217 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
366 0 : allow_remaining = true;
367 : }
368 :
369 11217 : if (allow_remaining) {
370 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
371 : } else {
372 11217 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
373 : }
374 11217 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
375 0 : PyErr_SetNdrError(err);
376 0 : return NULL;
377 : }
378 :
379 11217 : Py_RETURN_NONE;
380 : }
381 :
382 0 : static PyObject *py_dom_sid_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
383 : {
384 0 : struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
385 : PyObject *ret;
386 : char *retstr;
387 :
388 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dom_sid, "dom_sid", object);
389 0 : ret = PyUnicode_FromString(retstr);
390 0 : talloc_free(retstr);
391 :
392 0 : return ret;
393 : }
394 :
395 : static PyMethodDef py_dom_sid_methods[] = {
396 : { "__ndr_pack__", (PyCFunction)py_dom_sid_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
397 : { "__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" },
398 : { "__ndr_print__", (PyCFunction)py_dom_sid_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
399 : { NULL, NULL, 0, NULL }
400 : };
401 :
402 :
403 : static PyTypeObject dom_sid_Type = {
404 : PyVarObject_HEAD_INIT(NULL, 0)
405 : .tp_name = "security.dom_sid",
406 : .tp_getset = py_dom_sid_getsetters,
407 : .tp_methods = py_dom_sid_methods,
408 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
409 : .tp_new = py_dom_sid_new,
410 : };
411 :
412 0 : static PyObject *py_import_security_ace_object_type(TALLOC_CTX *mem_ctx, int level, union security_ace_object_type *in)
413 : {
414 : PyObject *ret;
415 :
416 0 : switch (level) {
417 0 : case SEC_ACE_OBJECT_TYPE_PRESENT:
418 0 : ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->type);
419 0 : return ret;
420 :
421 0 : default:
422 0 : ret = Py_None;
423 0 : Py_INCREF(ret);
424 0 : return ret;
425 :
426 : }
427 : PyErr_SetString(PyExc_TypeError, "unknown union level");
428 : return NULL;
429 : }
430 :
431 0 : static union security_ace_object_type *py_export_security_ace_object_type(TALLOC_CTX *mem_ctx, int level, PyObject *in)
432 : {
433 0 : union security_ace_object_type *ret = talloc_zero(mem_ctx, union security_ace_object_type);
434 0 : switch (level) {
435 0 : case SEC_ACE_OBJECT_TYPE_PRESENT:
436 0 : if (in == NULL) {
437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->type");
438 0 : talloc_free(ret); return NULL;
439 : }
440 0 : PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
441 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
442 0 : PyErr_NoMemory();
443 0 : talloc_free(ret); return NULL;
444 : }
445 0 : ret->type = *(struct GUID *)pytalloc_get_ptr(in);
446 0 : break;
447 :
448 0 : default:
449 0 : break;
450 :
451 : }
452 :
453 0 : return ret;
454 : }
455 :
456 0 : static PyObject *py_security_ace_object_type_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
457 : {
458 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
459 0 : PyObject *mem_ctx_obj = NULL;
460 0 : TALLOC_CTX *mem_ctx = NULL;
461 0 : int level = 0;
462 0 : PyObject *in_obj = NULL;
463 0 : union security_ace_object_type *in = NULL;
464 :
465 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
466 : discard_const_p(char *, kwnames),
467 : &mem_ctx_obj,
468 : &level,
469 : &in_obj)) {
470 0 : return NULL;
471 : }
472 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
473 0 : if (mem_ctx == NULL) {
474 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
475 0 : return NULL;
476 : }
477 0 : in = (union security_ace_object_type *)pytalloc_get_ptr(in_obj);
478 0 : if (in == NULL) {
479 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_type!");
480 0 : return NULL;
481 : }
482 :
483 0 : return py_import_security_ace_object_type(mem_ctx, level, in);
484 : }
485 :
486 0 : static PyObject *py_security_ace_object_type_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
487 : {
488 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
489 0 : PyObject *mem_ctx_obj = NULL;
490 0 : TALLOC_CTX *mem_ctx = NULL;
491 0 : int level = 0;
492 0 : PyObject *in = NULL;
493 0 : union security_ace_object_type *out = NULL;
494 :
495 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
496 : discard_const_p(char *, kwnames),
497 : &mem_ctx_obj,
498 : &level,
499 : &in)) {
500 0 : return NULL;
501 : }
502 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
503 0 : if (mem_ctx == NULL) {
504 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
505 0 : return NULL;
506 : }
507 :
508 0 : out = py_export_security_ace_object_type(mem_ctx, level, in);
509 0 : if (out == NULL) {
510 0 : return NULL;
511 : }
512 :
513 0 : return pytalloc_GenericObject_reference(out);
514 : }
515 :
516 : static PyMethodDef py_security_ace_object_type_methods[] = {
517 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_type_import),
518 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
519 : "T.__import__(mem_ctx, level, in) => ret." },
520 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_type_export),
521 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
522 : "T.__export__(mem_ctx, level, in) => ret." },
523 : { NULL, NULL, 0, NULL }
524 : };
525 :
526 0 : static PyObject *py_security_ace_object_type_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
527 : {
528 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
529 0 : return NULL;
530 : }
531 :
532 :
533 : static PyTypeObject security_ace_object_type_Type = {
534 : PyVarObject_HEAD_INIT(NULL, 0)
535 : .tp_name = "security.ace_object_type",
536 : .tp_getset = NULL,
537 : .tp_methods = py_security_ace_object_type_methods,
538 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
539 : .tp_new = py_security_ace_object_type_new,
540 : };
541 :
542 20585 : static PyObject *py_import_security_ace_object_inherited_type(TALLOC_CTX *mem_ctx, int level, union security_ace_object_inherited_type *in)
543 : {
544 : PyObject *ret;
545 :
546 20585 : switch (level) {
547 20585 : case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
548 20585 : ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->inherited_type);
549 20585 : return ret;
550 :
551 0 : default:
552 0 : ret = Py_None;
553 0 : Py_INCREF(ret);
554 0 : return ret;
555 :
556 : }
557 : PyErr_SetString(PyExc_TypeError, "unknown union level");
558 : return NULL;
559 : }
560 :
561 0 : static union security_ace_object_inherited_type *py_export_security_ace_object_inherited_type(TALLOC_CTX *mem_ctx, int level, PyObject *in)
562 : {
563 0 : union security_ace_object_inherited_type *ret = talloc_zero(mem_ctx, union security_ace_object_inherited_type);
564 0 : switch (level) {
565 0 : case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
566 0 : if (in == NULL) {
567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->inherited_type");
568 0 : talloc_free(ret); return NULL;
569 : }
570 0 : PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
571 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
572 0 : PyErr_NoMemory();
573 0 : talloc_free(ret); return NULL;
574 : }
575 0 : ret->inherited_type = *(struct GUID *)pytalloc_get_ptr(in);
576 0 : break;
577 :
578 0 : default:
579 0 : break;
580 :
581 : }
582 :
583 0 : return ret;
584 : }
585 :
586 20585 : static PyObject *py_security_ace_object_inherited_type_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
587 : {
588 20585 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
589 20585 : PyObject *mem_ctx_obj = NULL;
590 20585 : TALLOC_CTX *mem_ctx = NULL;
591 20585 : int level = 0;
592 20585 : PyObject *in_obj = NULL;
593 20585 : union security_ace_object_inherited_type *in = NULL;
594 :
595 20585 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
596 : discard_const_p(char *, kwnames),
597 : &mem_ctx_obj,
598 : &level,
599 : &in_obj)) {
600 0 : return NULL;
601 : }
602 20585 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
603 20585 : if (mem_ctx == NULL) {
604 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
605 0 : return NULL;
606 : }
607 20585 : in = (union security_ace_object_inherited_type *)pytalloc_get_ptr(in_obj);
608 20585 : if (in == NULL) {
609 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_inherited_type!");
610 0 : return NULL;
611 : }
612 :
613 20585 : return py_import_security_ace_object_inherited_type(mem_ctx, level, in);
614 : }
615 :
616 0 : static PyObject *py_security_ace_object_inherited_type_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
617 : {
618 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
619 0 : PyObject *mem_ctx_obj = NULL;
620 0 : TALLOC_CTX *mem_ctx = NULL;
621 0 : int level = 0;
622 0 : PyObject *in = NULL;
623 0 : union security_ace_object_inherited_type *out = NULL;
624 :
625 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
626 : discard_const_p(char *, kwnames),
627 : &mem_ctx_obj,
628 : &level,
629 : &in)) {
630 0 : return NULL;
631 : }
632 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
633 0 : if (mem_ctx == NULL) {
634 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
635 0 : return NULL;
636 : }
637 :
638 0 : out = py_export_security_ace_object_inherited_type(mem_ctx, level, in);
639 0 : if (out == NULL) {
640 0 : return NULL;
641 : }
642 :
643 0 : return pytalloc_GenericObject_reference(out);
644 : }
645 :
646 : static PyMethodDef py_security_ace_object_inherited_type_methods[] = {
647 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_inherited_type_import),
648 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
649 : "T.__import__(mem_ctx, level, in) => ret." },
650 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_inherited_type_export),
651 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
652 : "T.__export__(mem_ctx, level, in) => ret." },
653 : { NULL, NULL, 0, NULL }
654 : };
655 :
656 0 : static PyObject *py_security_ace_object_inherited_type_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
657 : {
658 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
659 0 : return NULL;
660 : }
661 :
662 :
663 : static PyTypeObject security_ace_object_inherited_type_Type = {
664 : PyVarObject_HEAD_INIT(NULL, 0)
665 : .tp_name = "security.ace_object_inherited_type",
666 : .tp_getset = NULL,
667 : .tp_methods = py_security_ace_object_inherited_type_methods,
668 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
669 : .tp_new = py_security_ace_object_inherited_type_new,
670 : };
671 :
672 :
673 45345 : static PyObject *py_security_ace_object_get_flags(PyObject *obj, void *closure)
674 : {
675 45345 : struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(obj);
676 : PyObject *py_flags;
677 45345 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
678 45345 : return py_flags;
679 : }
680 :
681 0 : static int py_security_ace_object_set_flags(PyObject *py_obj, PyObject *value, void *closure)
682 : {
683 0 : struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(py_obj);
684 0 : if (value == NULL) {
685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
686 0 : return -1;
687 : }
688 : {
689 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
690 0 : if (PyLong_Check(value)) {
691 : unsigned long long test_var;
692 0 : test_var = PyLong_AsUnsignedLongLong(value);
693 0 : if (PyErr_Occurred() != NULL) {
694 0 : return -1;
695 : }
696 0 : if (test_var > uint_max) {
697 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
698 : PyLong_Type.tp_name, uint_max, test_var);
699 0 : return -1;
700 : }
701 0 : object->flags = test_var;
702 : } else {
703 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
704 : PyLong_Type.tp_name);
705 0 : return -1;
706 : }
707 : }
708 0 : return 0;
709 : }
710 :
711 0 : static PyObject *py_security_ace_object_get_type(PyObject *obj, void *closure)
712 : {
713 0 : struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(obj);
714 : PyObject *py_type;
715 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");
716 0 : if (py_type == NULL) {
717 0 : return NULL;
718 : }
719 0 : return py_type;
720 : }
721 :
722 0 : static int py_security_ace_object_set_type(PyObject *py_obj, PyObject *value, void *closure)
723 : {
724 0 : struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(py_obj);
725 0 : if (value == NULL) {
726 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
727 0 : return -1;
728 : }
729 : {
730 : union security_ace_object_type *type_switch_0;
731 0 : 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");
732 0 : if (type_switch_0 == NULL) {
733 0 : return -1;
734 : }
735 0 : object->type = *type_switch_0;
736 : }
737 0 : return 0;
738 : }
739 :
740 20585 : static PyObject *py_security_ace_object_get_inherited_type(PyObject *obj, void *closure)
741 : {
742 20585 : struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(obj);
743 : PyObject *py_inherited_type;
744 20585 : 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");
745 20585 : if (py_inherited_type == NULL) {
746 0 : return NULL;
747 : }
748 20585 : return py_inherited_type;
749 : }
750 :
751 0 : static int py_security_ace_object_set_inherited_type(PyObject *py_obj, PyObject *value, void *closure)
752 : {
753 0 : struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(py_obj);
754 0 : if (value == NULL) {
755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->inherited_type");
756 0 : return -1;
757 : }
758 : {
759 : union security_ace_object_inherited_type *inherited_type_switch_0;
760 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");
761 0 : if (inherited_type_switch_0 == NULL) {
762 0 : return -1;
763 : }
764 0 : object->inherited_type = *inherited_type_switch_0;
765 : }
766 0 : return 0;
767 : }
768 :
769 : static PyGetSetDef py_security_ace_object_getsetters[] = {
770 : {
771 : .name = discard_const_p(char, "flags"),
772 : .get = py_security_ace_object_get_flags,
773 : .set = py_security_ace_object_set_flags,
774 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_flags")
775 : },
776 : {
777 : .name = discard_const_p(char, "type"),
778 : .get = py_security_ace_object_get_type,
779 : .set = py_security_ace_object_set_type,
780 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_type")
781 : },
782 : {
783 : .name = discard_const_p(char, "inherited_type"),
784 : .get = py_security_ace_object_get_inherited_type,
785 : .set = py_security_ace_object_set_inherited_type,
786 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_inherited_type")
787 : },
788 : { .name = NULL }
789 : };
790 :
791 0 : static PyObject *py_security_ace_object_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
792 : {
793 0 : return pytalloc_new(struct security_ace_object, type);
794 : }
795 :
796 :
797 : static PyTypeObject security_ace_object_Type = {
798 : PyVarObject_HEAD_INIT(NULL, 0)
799 : .tp_name = "security.ace_object",
800 : .tp_getset = py_security_ace_object_getsetters,
801 : .tp_methods = NULL,
802 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
803 : .tp_new = py_security_ace_object_new,
804 : };
805 :
806 65930 : static PyObject *py_import_security_ace_object_ctr(TALLOC_CTX *mem_ctx, int level, union security_ace_object_ctr *in)
807 : {
808 : PyObject *ret;
809 :
810 65930 : switch (level) {
811 59298 : case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
812 59298 : ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
813 59298 : return ret;
814 :
815 0 : case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
816 0 : ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
817 0 : return ret;
818 :
819 6632 : case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
820 6632 : ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
821 6632 : return ret;
822 :
823 0 : case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
824 0 : ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
825 0 : return ret;
826 :
827 0 : default:
828 0 : ret = Py_None;
829 0 : Py_INCREF(ret);
830 0 : return ret;
831 :
832 : }
833 : PyErr_SetString(PyExc_TypeError, "unknown union level");
834 : return NULL;
835 : }
836 :
837 0 : static union security_ace_object_ctr *py_export_security_ace_object_ctr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
838 : {
839 0 : union security_ace_object_ctr *ret = talloc_zero(mem_ctx, union security_ace_object_ctr);
840 0 : switch (level) {
841 0 : case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
842 0 : if (in == NULL) {
843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
844 0 : talloc_free(ret); return NULL;
845 : }
846 0 : PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
847 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
848 0 : PyErr_NoMemory();
849 0 : talloc_free(ret); return NULL;
850 : }
851 0 : ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
852 0 : break;
853 :
854 0 : case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
855 0 : if (in == NULL) {
856 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
857 0 : talloc_free(ret); return NULL;
858 : }
859 0 : PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
860 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
861 0 : PyErr_NoMemory();
862 0 : talloc_free(ret); return NULL;
863 : }
864 0 : ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
865 0 : break;
866 :
867 0 : case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
868 0 : if (in == NULL) {
869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
870 0 : talloc_free(ret); return NULL;
871 : }
872 0 : PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
873 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
874 0 : PyErr_NoMemory();
875 0 : talloc_free(ret); return NULL;
876 : }
877 0 : ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
878 0 : break;
879 :
880 0 : case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
881 0 : if (in == NULL) {
882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
883 0 : talloc_free(ret); return NULL;
884 : }
885 0 : PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
886 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
887 0 : PyErr_NoMemory();
888 0 : talloc_free(ret); return NULL;
889 : }
890 0 : ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
891 0 : break;
892 :
893 0 : default:
894 0 : break;
895 :
896 : }
897 :
898 0 : return ret;
899 : }
900 :
901 65930 : static PyObject *py_security_ace_object_ctr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
902 : {
903 65930 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
904 65930 : PyObject *mem_ctx_obj = NULL;
905 65930 : TALLOC_CTX *mem_ctx = NULL;
906 65930 : int level = 0;
907 65930 : PyObject *in_obj = NULL;
908 65930 : union security_ace_object_ctr *in = NULL;
909 :
910 65930 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
911 : discard_const_p(char *, kwnames),
912 : &mem_ctx_obj,
913 : &level,
914 : &in_obj)) {
915 0 : return NULL;
916 : }
917 65930 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
918 65930 : if (mem_ctx == NULL) {
919 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
920 0 : return NULL;
921 : }
922 65930 : in = (union security_ace_object_ctr *)pytalloc_get_ptr(in_obj);
923 65930 : if (in == NULL) {
924 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_ctr!");
925 0 : return NULL;
926 : }
927 :
928 65930 : return py_import_security_ace_object_ctr(mem_ctx, level, in);
929 : }
930 :
931 0 : static PyObject *py_security_ace_object_ctr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
932 : {
933 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
934 0 : PyObject *mem_ctx_obj = NULL;
935 0 : TALLOC_CTX *mem_ctx = NULL;
936 0 : int level = 0;
937 0 : PyObject *in = NULL;
938 0 : union security_ace_object_ctr *out = NULL;
939 :
940 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
941 : discard_const_p(char *, kwnames),
942 : &mem_ctx_obj,
943 : &level,
944 : &in)) {
945 0 : return NULL;
946 : }
947 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
948 0 : if (mem_ctx == NULL) {
949 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
950 0 : return NULL;
951 : }
952 :
953 0 : out = py_export_security_ace_object_ctr(mem_ctx, level, in);
954 0 : if (out == NULL) {
955 0 : return NULL;
956 : }
957 :
958 0 : return pytalloc_GenericObject_reference(out);
959 : }
960 :
961 : static PyMethodDef py_security_ace_object_ctr_methods[] = {
962 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_ctr_import),
963 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
964 : "T.__import__(mem_ctx, level, in) => ret." },
965 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_ctr_export),
966 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
967 : "T.__export__(mem_ctx, level, in) => ret." },
968 : { NULL, NULL, 0, NULL }
969 : };
970 :
971 0 : static PyObject *py_security_ace_object_ctr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
972 : {
973 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
974 0 : return NULL;
975 : }
976 :
977 :
978 : static PyTypeObject security_ace_object_ctr_Type = {
979 : PyVarObject_HEAD_INIT(NULL, 0)
980 : .tp_name = "security.ace_object_ctr",
981 : .tp_getset = NULL,
982 : .tp_methods = py_security_ace_object_ctr_methods,
983 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
984 : .tp_new = py_security_ace_object_ctr_new,
985 : };
986 :
987 :
988 3475161 : static PyObject *py_security_ace_get_type(PyObject *obj, void *closure)
989 : {
990 3475161 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
991 : PyObject *py_type;
992 3475161 : py_type = PyLong_FromLong((uint16_t)object->type);
993 3475161 : return py_type;
994 : }
995 :
996 0 : static int py_security_ace_set_type(PyObject *py_obj, PyObject *value, void *closure)
997 : {
998 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
999 0 : if (value == NULL) {
1000 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
1001 0 : return -1;
1002 : }
1003 : {
1004 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1005 0 : if (PyLong_Check(value)) {
1006 : unsigned long long test_var;
1007 0 : test_var = PyLong_AsUnsignedLongLong(value);
1008 0 : if (PyErr_Occurred() != NULL) {
1009 0 : return -1;
1010 : }
1011 0 : if (test_var > uint_max) {
1012 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1013 : PyLong_Type.tp_name, uint_max, test_var);
1014 0 : return -1;
1015 : }
1016 0 : object->type = test_var;
1017 : } else {
1018 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1019 : PyLong_Type.tp_name);
1020 0 : return -1;
1021 : }
1022 : }
1023 0 : return 0;
1024 : }
1025 :
1026 3417439 : static PyObject *py_security_ace_get_flags(PyObject *obj, void *closure)
1027 : {
1028 3417439 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
1029 : PyObject *py_flags;
1030 3417439 : py_flags = PyLong_FromLong((uint16_t)object->flags);
1031 3417439 : return py_flags;
1032 : }
1033 :
1034 2520 : static int py_security_ace_set_flags(PyObject *py_obj, PyObject *value, void *closure)
1035 : {
1036 2520 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1037 2520 : if (value == NULL) {
1038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
1039 0 : return -1;
1040 : }
1041 : {
1042 2520 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
1043 2520 : if (PyLong_Check(value)) {
1044 : unsigned long long test_var;
1045 2520 : test_var = PyLong_AsUnsignedLongLong(value);
1046 2520 : if (PyErr_Occurred() != NULL) {
1047 0 : return -1;
1048 : }
1049 2520 : if (test_var > uint_max) {
1050 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1051 : PyLong_Type.tp_name, uint_max, test_var);
1052 0 : return -1;
1053 : }
1054 2520 : object->flags = test_var;
1055 : } else {
1056 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1057 : PyLong_Type.tp_name);
1058 0 : return -1;
1059 : }
1060 : }
1061 2520 : return 0;
1062 : }
1063 :
1064 0 : static PyObject *py_security_ace_get_size(PyObject *obj, void *closure)
1065 : {
1066 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
1067 : PyObject *py_size;
1068 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1069 0 : return py_size;
1070 : }
1071 :
1072 0 : static int py_security_ace_set_size(PyObject *py_obj, PyObject *value, void *closure)
1073 : {
1074 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1075 0 : if (value == NULL) {
1076 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1077 0 : return -1;
1078 : }
1079 : {
1080 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1081 0 : if (PyLong_Check(value)) {
1082 : unsigned long long test_var;
1083 0 : test_var = PyLong_AsUnsignedLongLong(value);
1084 0 : if (PyErr_Occurred() != NULL) {
1085 0 : return -1;
1086 : }
1087 0 : if (test_var > uint_max) {
1088 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1089 : PyLong_Type.tp_name, uint_max, test_var);
1090 0 : return -1;
1091 : }
1092 0 : object->size = test_var;
1093 : } else {
1094 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1095 : PyLong_Type.tp_name);
1096 0 : return -1;
1097 : }
1098 : }
1099 0 : return 0;
1100 : }
1101 :
1102 2579 : static PyObject *py_security_ace_get_access_mask(PyObject *obj, void *closure)
1103 : {
1104 2579 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
1105 : PyObject *py_access_mask;
1106 2579 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->access_mask);
1107 2579 : return py_access_mask;
1108 : }
1109 :
1110 2583 : static int py_security_ace_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
1111 : {
1112 2583 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1113 2583 : if (value == NULL) {
1114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->access_mask");
1115 0 : return -1;
1116 : }
1117 : {
1118 2583 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->access_mask));
1119 2583 : if (PyLong_Check(value)) {
1120 : unsigned long long test_var;
1121 2583 : test_var = PyLong_AsUnsignedLongLong(value);
1122 2583 : if (PyErr_Occurred() != NULL) {
1123 0 : return -1;
1124 : }
1125 2583 : if (test_var > uint_max) {
1126 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1127 : PyLong_Type.tp_name, uint_max, test_var);
1128 0 : return -1;
1129 : }
1130 2583 : object->access_mask = test_var;
1131 : } else {
1132 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1133 : PyLong_Type.tp_name);
1134 0 : return -1;
1135 : }
1136 : }
1137 2583 : return 0;
1138 : }
1139 :
1140 65930 : static PyObject *py_security_ace_get_object(PyObject *obj, void *closure)
1141 : {
1142 65930 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
1143 : PyObject *py_object;
1144 65930 : py_object = pyrpc_import_union(&security_ace_object_ctr_Type, pytalloc_get_mem_ctx(obj), object->type, &object->object, "union security_ace_object_ctr");
1145 65930 : if (py_object == NULL) {
1146 0 : return NULL;
1147 : }
1148 65930 : return py_object;
1149 : }
1150 :
1151 0 : static int py_security_ace_set_object(PyObject *py_obj, PyObject *value, void *closure)
1152 : {
1153 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1154 0 : if (value == NULL) {
1155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object");
1156 0 : return -1;
1157 : }
1158 : {
1159 : union security_ace_object_ctr *object_switch_0;
1160 0 : object_switch_0 = (union security_ace_object_ctr *)pyrpc_export_union(&security_ace_object_ctr_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union security_ace_object_ctr");
1161 0 : if (object_switch_0 == NULL) {
1162 0 : return -1;
1163 : }
1164 0 : object->object = *object_switch_0;
1165 : }
1166 0 : return 0;
1167 : }
1168 :
1169 7567 : static PyObject *py_security_ace_get_trustee(PyObject *obj, void *closure)
1170 : {
1171 7567 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
1172 : PyObject *py_trustee;
1173 7567 : py_trustee = pytalloc_reference_ex(&dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->trustee);
1174 7567 : return py_trustee;
1175 : }
1176 :
1177 40 : static int py_security_ace_set_trustee(PyObject *py_obj, PyObject *value, void *closure)
1178 : {
1179 40 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1180 40 : if (value == NULL) {
1181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trustee");
1182 0 : return -1;
1183 : }
1184 40 : PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
1185 40 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1186 0 : PyErr_NoMemory();
1187 0 : return -1;
1188 : }
1189 40 : object->trustee = *(struct dom_sid *)pytalloc_get_ptr(value);
1190 40 : return 0;
1191 : }
1192 :
1193 : static PyGetSetDef py_security_ace_getsetters[] = {
1194 : {
1195 : .name = discard_const_p(char, "type"),
1196 : .get = py_security_ace_get_type,
1197 : .set = py_security_ace_set_type,
1198 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_type")
1199 : },
1200 : {
1201 : .name = discard_const_p(char, "flags"),
1202 : .get = py_security_ace_get_flags,
1203 : .set = py_security_ace_set_flags,
1204 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_flags")
1205 : },
1206 : {
1207 : .name = discard_const_p(char, "size"),
1208 : .get = py_security_ace_get_size,
1209 : .set = py_security_ace_set_size,
1210 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1211 : },
1212 : {
1213 : .name = discard_const_p(char, "access_mask"),
1214 : .get = py_security_ace_get_access_mask,
1215 : .set = py_security_ace_set_access_mask,
1216 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1217 : },
1218 : {
1219 : .name = discard_const_p(char, "object"),
1220 : .get = py_security_ace_get_object,
1221 : .set = py_security_ace_set_object,
1222 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_ctr")
1223 : },
1224 : {
1225 : .name = discard_const_p(char, "trustee"),
1226 : .get = py_security_ace_get_trustee,
1227 : .set = py_security_ace_set_trustee,
1228 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1229 : },
1230 : { .name = NULL }
1231 : };
1232 :
1233 4 : static PyObject *py_security_ace_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1234 : {
1235 4 : return pytalloc_new(struct security_ace, type);
1236 : }
1237 :
1238 0 : static PyObject *py_security_ace_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1239 : {
1240 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1241 0 : PyObject *ret = NULL;
1242 : DATA_BLOB blob;
1243 : enum ndr_err_code err;
1244 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1245 0 : if (tmp_ctx == NULL) {
1246 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1247 0 : return NULL;
1248 : }
1249 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_ace);
1250 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1251 0 : TALLOC_FREE(tmp_ctx);
1252 0 : PyErr_SetNdrError(err);
1253 0 : return NULL;
1254 : }
1255 :
1256 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1257 0 : TALLOC_FREE(tmp_ctx);
1258 0 : return ret;
1259 : }
1260 :
1261 0 : static PyObject *py_security_ace_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1262 : {
1263 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1264 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1265 0 : Py_ssize_t blob_length = 0;
1266 : enum ndr_err_code err;
1267 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1268 0 : PyObject *allow_remaining_obj = NULL;
1269 0 : bool allow_remaining = false;
1270 :
1271 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1272 : discard_const_p(char *, kwnames),
1273 : &blob.data, &blob_length,
1274 : &allow_remaining_obj)) {
1275 0 : return NULL;
1276 : }
1277 0 : blob.length = blob_length;
1278 :
1279 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1280 0 : allow_remaining = true;
1281 : }
1282 :
1283 0 : if (allow_remaining) {
1284 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
1285 : } else {
1286 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
1287 : }
1288 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1289 0 : PyErr_SetNdrError(err);
1290 0 : return NULL;
1291 : }
1292 :
1293 0 : Py_RETURN_NONE;
1294 : }
1295 :
1296 0 : static PyObject *py_security_ace_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1297 : {
1298 0 : struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
1299 : PyObject *ret;
1300 : char *retstr;
1301 :
1302 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_ace, "security_ace", object);
1303 0 : ret = PyUnicode_FromString(retstr);
1304 0 : talloc_free(retstr);
1305 :
1306 0 : return ret;
1307 : }
1308 :
1309 : static PyMethodDef py_security_ace_methods[] = {
1310 : { "__ndr_pack__", (PyCFunction)py_security_ace_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1311 : { "__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" },
1312 : { "__ndr_print__", (PyCFunction)py_security_ace_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1313 : { NULL, NULL, 0, NULL }
1314 : };
1315 :
1316 :
1317 : static PyTypeObject security_ace_Type = {
1318 : PyVarObject_HEAD_INIT(NULL, 0)
1319 : .tp_name = "security.ace",
1320 : .tp_getset = py_security_ace_getsetters,
1321 : .tp_methods = py_security_ace_methods,
1322 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1323 : .tp_new = py_security_ace_new,
1324 : };
1325 :
1326 :
1327 0 : static PyObject *py_security_acl_get_revision(PyObject *obj, void *closure)
1328 : {
1329 0 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
1330 : PyObject *py_revision;
1331 0 : py_revision = PyLong_FromLong((uint16_t)object->revision);
1332 0 : return py_revision;
1333 : }
1334 :
1335 4 : static int py_security_acl_set_revision(PyObject *py_obj, PyObject *value, void *closure)
1336 : {
1337 4 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1338 4 : if (value == NULL) {
1339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->revision");
1340 0 : return -1;
1341 : }
1342 : {
1343 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
1344 4 : if (PyLong_Check(value)) {
1345 : unsigned long long test_var;
1346 4 : test_var = PyLong_AsUnsignedLongLong(value);
1347 4 : if (PyErr_Occurred() != NULL) {
1348 0 : return -1;
1349 : }
1350 4 : if (test_var > uint_max) {
1351 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1352 : PyLong_Type.tp_name, uint_max, test_var);
1353 0 : return -1;
1354 : }
1355 4 : object->revision = test_var;
1356 : } else {
1357 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1358 : PyLong_Type.tp_name);
1359 0 : return -1;
1360 : }
1361 : }
1362 4 : return 0;
1363 : }
1364 :
1365 0 : static PyObject *py_security_acl_get_size(PyObject *obj, void *closure)
1366 : {
1367 0 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
1368 : PyObject *py_size;
1369 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1370 0 : return py_size;
1371 : }
1372 :
1373 0 : static int py_security_acl_set_size(PyObject *py_obj, PyObject *value, void *closure)
1374 : {
1375 0 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1376 0 : if (value == NULL) {
1377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1378 0 : return -1;
1379 : }
1380 : {
1381 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1382 0 : if (PyLong_Check(value)) {
1383 : unsigned long long test_var;
1384 0 : test_var = PyLong_AsUnsignedLongLong(value);
1385 0 : if (PyErr_Occurred() != NULL) {
1386 0 : return -1;
1387 : }
1388 0 : if (test_var > uint_max) {
1389 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1390 : PyLong_Type.tp_name, uint_max, test_var);
1391 0 : return -1;
1392 : }
1393 0 : object->size = test_var;
1394 : } else {
1395 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1396 : PyLong_Type.tp_name);
1397 0 : return -1;
1398 : }
1399 : }
1400 0 : return 0;
1401 : }
1402 :
1403 0 : static PyObject *py_security_acl_get_num_aces(PyObject *obj, void *closure)
1404 : {
1405 0 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
1406 : PyObject *py_num_aces;
1407 0 : py_num_aces = PyLong_FromUnsignedLongLong((uint32_t)object->num_aces);
1408 0 : return py_num_aces;
1409 : }
1410 :
1411 4 : static int py_security_acl_set_num_aces(PyObject *py_obj, PyObject *value, void *closure)
1412 : {
1413 4 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1414 4 : if (value == NULL) {
1415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_aces");
1416 0 : return -1;
1417 : }
1418 : {
1419 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_aces));
1420 4 : if (PyLong_Check(value)) {
1421 : unsigned long long test_var;
1422 4 : test_var = PyLong_AsUnsignedLongLong(value);
1423 4 : if (PyErr_Occurred() != NULL) {
1424 0 : return -1;
1425 : }
1426 4 : if (test_var > uint_max) {
1427 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1428 : PyLong_Type.tp_name, uint_max, test_var);
1429 0 : return -1;
1430 : }
1431 4 : object->num_aces = test_var;
1432 : } else {
1433 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1434 : PyLong_Type.tp_name);
1435 0 : return -1;
1436 : }
1437 : }
1438 4 : return 0;
1439 : }
1440 :
1441 436165 : static PyObject *py_security_acl_get_aces(PyObject *obj, void *closure)
1442 : {
1443 436165 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
1444 : PyObject *py_aces;
1445 436165 : py_aces = PyList_New(object->num_aces);
1446 436165 : if (py_aces == NULL) {
1447 0 : return NULL;
1448 : }
1449 : {
1450 : int aces_cntr_0;
1451 2597714 : for (aces_cntr_0 = 0; aces_cntr_0 < (object->num_aces); aces_cntr_0++) {
1452 : PyObject *py_aces_0;
1453 2161549 : py_aces_0 = pytalloc_reference_ex(&security_ace_Type, object->aces, &object->aces[aces_cntr_0]);
1454 2161549 : PyList_SetItem(py_aces, aces_cntr_0, py_aces_0);
1455 : }
1456 : }
1457 436165 : return py_aces;
1458 : }
1459 :
1460 4 : static int py_security_acl_set_aces(PyObject *py_obj, PyObject *value, void *closure)
1461 : {
1462 4 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1463 4 : if (value == NULL) {
1464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->aces");
1465 0 : return -1;
1466 : }
1467 4 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1468 : {
1469 : int aces_cntr_0;
1470 4 : object->aces = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->aces, PyList_GET_SIZE(value));
1471 4 : if (!object->aces) { return -1;; }
1472 4 : talloc_set_name_const(object->aces, "ARRAY: object->aces");
1473 8 : for (aces_cntr_0 = 0; aces_cntr_0 < PyList_GET_SIZE(value); aces_cntr_0++) {
1474 4 : if (PyList_GET_ITEM(value, aces_cntr_0) == NULL) {
1475 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->aces[aces_cntr_0]");
1476 0 : return -1;
1477 : }
1478 4 : PY_CHECK_TYPE(&security_ace_Type, PyList_GET_ITEM(value, aces_cntr_0), return -1;);
1479 4 : if (talloc_reference(object->aces, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, aces_cntr_0))) == NULL) {
1480 0 : PyErr_NoMemory();
1481 0 : return -1;
1482 : }
1483 4 : object->aces[aces_cntr_0] = *(struct security_ace *)pytalloc_get_ptr(PyList_GET_ITEM(value, aces_cntr_0));
1484 : }
1485 : }
1486 4 : return 0;
1487 : }
1488 :
1489 : static PyGetSetDef py_security_acl_getsetters[] = {
1490 : {
1491 : .name = discard_const_p(char, "revision"),
1492 : .get = py_security_acl_get_revision,
1493 : .set = py_security_acl_set_revision,
1494 : .doc = discard_const_p(char, "PIDL-generated element of base type security_acl_revision")
1495 : },
1496 : {
1497 : .name = discard_const_p(char, "size"),
1498 : .get = py_security_acl_get_size,
1499 : .set = py_security_acl_set_size,
1500 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1501 : },
1502 : {
1503 : .name = discard_const_p(char, "num_aces"),
1504 : .get = py_security_acl_get_num_aces,
1505 : .set = py_security_acl_set_num_aces,
1506 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1507 : },
1508 : {
1509 : .name = discard_const_p(char, "aces"),
1510 : .get = py_security_acl_get_aces,
1511 : .set = py_security_acl_set_aces,
1512 : .doc = discard_const_p(char, "PIDL-generated element of base type security_ace")
1513 : },
1514 : { .name = NULL }
1515 : };
1516 :
1517 3560 : static PyObject *py_security_acl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1518 : {
1519 3560 : return pytalloc_new(struct security_acl, type);
1520 : }
1521 :
1522 3556 : static PyObject *py_security_acl_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1523 : {
1524 3556 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1525 3556 : PyObject *ret = NULL;
1526 : DATA_BLOB blob;
1527 : enum ndr_err_code err;
1528 3556 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1529 3556 : if (tmp_ctx == NULL) {
1530 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1531 0 : return NULL;
1532 : }
1533 3556 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_acl);
1534 3556 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1535 0 : TALLOC_FREE(tmp_ctx);
1536 0 : PyErr_SetNdrError(err);
1537 0 : return NULL;
1538 : }
1539 :
1540 3556 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1541 3556 : TALLOC_FREE(tmp_ctx);
1542 3556 : return ret;
1543 : }
1544 :
1545 3556 : static PyObject *py_security_acl_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1546 : {
1547 3556 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1548 3556 : DATA_BLOB blob = {.data = NULL, .length = 0};
1549 3556 : Py_ssize_t blob_length = 0;
1550 : enum ndr_err_code err;
1551 3556 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1552 3556 : PyObject *allow_remaining_obj = NULL;
1553 3556 : bool allow_remaining = false;
1554 :
1555 3556 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1556 : discard_const_p(char *, kwnames),
1557 : &blob.data, &blob_length,
1558 : &allow_remaining_obj)) {
1559 0 : return NULL;
1560 : }
1561 3556 : blob.length = blob_length;
1562 :
1563 3556 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1564 0 : allow_remaining = true;
1565 : }
1566 :
1567 3556 : if (allow_remaining) {
1568 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_acl);
1569 : } else {
1570 3556 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_acl);
1571 : }
1572 3556 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1573 0 : PyErr_SetNdrError(err);
1574 0 : return NULL;
1575 : }
1576 :
1577 3556 : Py_RETURN_NONE;
1578 : }
1579 :
1580 0 : static PyObject *py_security_acl_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1581 : {
1582 0 : struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
1583 : PyObject *ret;
1584 : char *retstr;
1585 :
1586 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_acl, "security_acl", object);
1587 0 : ret = PyUnicode_FromString(retstr);
1588 0 : talloc_free(retstr);
1589 :
1590 0 : return ret;
1591 : }
1592 :
1593 : static PyMethodDef py_security_acl_methods[] = {
1594 : { "__ndr_pack__", (PyCFunction)py_security_acl_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1595 : { "__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" },
1596 : { "__ndr_print__", (PyCFunction)py_security_acl_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1597 : { NULL, NULL, 0, NULL }
1598 : };
1599 :
1600 :
1601 : static PyTypeObject security_acl_Type = {
1602 : PyVarObject_HEAD_INIT(NULL, 0)
1603 : .tp_name = "security.acl",
1604 : .tp_getset = py_security_acl_getsetters,
1605 : .tp_methods = py_security_acl_methods,
1606 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1607 : .tp_new = py_security_acl_new,
1608 : };
1609 :
1610 :
1611 274331 : static PyObject *py_security_descriptor_get_revision(PyObject *obj, void *closure)
1612 : {
1613 274331 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
1614 : PyObject *py_revision;
1615 274331 : py_revision = PyLong_FromLong((uint16_t)object->revision);
1616 274331 : return py_revision;
1617 : }
1618 :
1619 274331 : static int py_security_descriptor_set_revision(PyObject *py_obj, PyObject *value, void *closure)
1620 : {
1621 274331 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1622 274331 : if (value == NULL) {
1623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->revision");
1624 0 : return -1;
1625 : }
1626 : {
1627 274331 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
1628 274331 : if (PyLong_Check(value)) {
1629 : unsigned long long test_var;
1630 274331 : test_var = PyLong_AsUnsignedLongLong(value);
1631 274331 : if (PyErr_Occurred() != NULL) {
1632 0 : return -1;
1633 : }
1634 274331 : if (test_var > uint_max) {
1635 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1636 : PyLong_Type.tp_name, uint_max, test_var);
1637 0 : return -1;
1638 : }
1639 274331 : object->revision = test_var;
1640 : } else {
1641 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1642 : PyLong_Type.tp_name);
1643 0 : return -1;
1644 : }
1645 : }
1646 274331 : return 0;
1647 : }
1648 :
1649 278043 : static PyObject *py_security_descriptor_get_type(PyObject *obj, void *closure)
1650 : {
1651 278043 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
1652 : PyObject *py_type;
1653 278043 : py_type = PyLong_FromLong((uint16_t)object->type);
1654 278043 : return py_type;
1655 : }
1656 :
1657 274343 : static int py_security_descriptor_set_type(PyObject *py_obj, PyObject *value, void *closure)
1658 : {
1659 274343 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1660 274343 : if (value == NULL) {
1661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
1662 0 : return -1;
1663 : }
1664 : {
1665 274343 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1666 274343 : if (PyLong_Check(value)) {
1667 : unsigned long long test_var;
1668 274343 : test_var = PyLong_AsUnsignedLongLong(value);
1669 274343 : if (PyErr_Occurred() != NULL) {
1670 0 : return -1;
1671 : }
1672 274343 : if (test_var > uint_max) {
1673 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1674 : PyLong_Type.tp_name, uint_max, test_var);
1675 0 : return -1;
1676 : }
1677 274343 : object->type = test_var;
1678 : } else {
1679 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1680 : PyLong_Type.tp_name);
1681 0 : return -1;
1682 : }
1683 : }
1684 274343 : return 0;
1685 : }
1686 :
1687 566476 : static PyObject *py_security_descriptor_get_owner_sid(PyObject *obj, void *closure)
1688 : {
1689 566476 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
1690 : PyObject *py_owner_sid;
1691 566476 : if (object->owner_sid == NULL) {
1692 201 : Py_RETURN_NONE;
1693 : }
1694 566275 : if (object->owner_sid == NULL) {
1695 0 : py_owner_sid = Py_None;
1696 0 : Py_INCREF(py_owner_sid);
1697 : } else {
1698 566275 : py_owner_sid = pytalloc_reference_ex(&dom_sid_Type, object->owner_sid, object->owner_sid);
1699 : }
1700 566275 : return py_owner_sid;
1701 : }
1702 :
1703 274386 : static int py_security_descriptor_set_owner_sid(PyObject *py_obj, PyObject *value, void *closure)
1704 : {
1705 274386 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1706 274386 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->owner_sid));
1707 274386 : if (value == NULL) {
1708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->owner_sid");
1709 0 : return -1;
1710 : }
1711 274386 : if (value == Py_None) {
1712 156 : object->owner_sid = NULL;
1713 : } else {
1714 274230 : object->owner_sid = NULL;
1715 274230 : PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
1716 274230 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1717 0 : PyErr_NoMemory();
1718 0 : return -1;
1719 : }
1720 274230 : object->owner_sid = (struct dom_sid *)pytalloc_get_ptr(value);
1721 : }
1722 274386 : return 0;
1723 : }
1724 :
1725 565863 : static PyObject *py_security_descriptor_get_group_sid(PyObject *obj, void *closure)
1726 : {
1727 565863 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
1728 : PyObject *py_group_sid;
1729 565863 : if (object->group_sid == NULL) {
1730 201 : Py_RETURN_NONE;
1731 : }
1732 565662 : if (object->group_sid == NULL) {
1733 0 : py_group_sid = Py_None;
1734 0 : Py_INCREF(py_group_sid);
1735 : } else {
1736 565662 : py_group_sid = pytalloc_reference_ex(&dom_sid_Type, object->group_sid, object->group_sid);
1737 : }
1738 565662 : return py_group_sid;
1739 : }
1740 :
1741 274382 : static int py_security_descriptor_set_group_sid(PyObject *py_obj, PyObject *value, void *closure)
1742 : {
1743 274382 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1744 274382 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->group_sid));
1745 274382 : if (value == NULL) {
1746 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_sid");
1747 0 : return -1;
1748 : }
1749 274382 : if (value == Py_None) {
1750 156 : object->group_sid = NULL;
1751 : } else {
1752 274226 : object->group_sid = NULL;
1753 274226 : PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
1754 274226 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1755 0 : PyErr_NoMemory();
1756 0 : return -1;
1757 : }
1758 274226 : object->group_sid = (struct dom_sid *)pytalloc_get_ptr(value);
1759 : }
1760 274382 : return 0;
1761 : }
1762 :
1763 424464 : static PyObject *py_security_descriptor_get_sacl(PyObject *obj, void *closure)
1764 : {
1765 424464 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
1766 : PyObject *py_sacl;
1767 424464 : if (object->sacl == NULL) {
1768 123638 : Py_RETURN_NONE;
1769 : }
1770 300826 : if (object->sacl == NULL) {
1771 0 : py_sacl = Py_None;
1772 0 : Py_INCREF(py_sacl);
1773 : } else {
1774 300826 : py_sacl = pytalloc_reference_ex(&security_acl_Type, object->sacl, object->sacl);
1775 : }
1776 300826 : return py_sacl;
1777 : }
1778 :
1779 0 : static int py_security_descriptor_set_sacl(PyObject *py_obj, PyObject *value, void *closure)
1780 : {
1781 0 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1782 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sacl));
1783 0 : if (value == NULL) {
1784 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sacl");
1785 0 : return -1;
1786 : }
1787 0 : if (value == Py_None) {
1788 0 : object->sacl = NULL;
1789 : } else {
1790 0 : object->sacl = NULL;
1791 0 : PY_CHECK_TYPE(&security_acl_Type, value, return -1;);
1792 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1793 0 : PyErr_NoMemory();
1794 0 : return -1;
1795 : }
1796 0 : object->sacl = (struct security_acl *)pytalloc_get_ptr(value);
1797 : }
1798 0 : return 0;
1799 : }
1800 :
1801 559803 : static PyObject *py_security_descriptor_get_dacl(PyObject *obj, void *closure)
1802 : {
1803 559803 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
1804 : PyObject *py_dacl;
1805 559803 : if (object->dacl == NULL) {
1806 0 : Py_RETURN_NONE;
1807 : }
1808 559803 : if (object->dacl == NULL) {
1809 0 : py_dacl = Py_None;
1810 0 : Py_INCREF(py_dacl);
1811 : } else {
1812 559803 : py_dacl = pytalloc_reference_ex(&security_acl_Type, object->dacl, object->dacl);
1813 : }
1814 559803 : return py_dacl;
1815 : }
1816 :
1817 4 : static int py_security_descriptor_set_dacl(PyObject *py_obj, PyObject *value, void *closure)
1818 : {
1819 4 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1820 4 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dacl));
1821 4 : if (value == NULL) {
1822 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dacl");
1823 0 : return -1;
1824 : }
1825 4 : if (value == Py_None) {
1826 0 : object->dacl = NULL;
1827 : } else {
1828 4 : object->dacl = NULL;
1829 4 : PY_CHECK_TYPE(&security_acl_Type, value, return -1;);
1830 4 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1831 0 : PyErr_NoMemory();
1832 0 : return -1;
1833 : }
1834 4 : object->dacl = (struct security_acl *)pytalloc_get_ptr(value);
1835 : }
1836 4 : return 0;
1837 : }
1838 :
1839 : static PyGetSetDef py_security_descriptor_getsetters[] = {
1840 : {
1841 : .name = discard_const_p(char, "revision"),
1842 : .get = py_security_descriptor_get_revision,
1843 : .set = py_security_descriptor_set_revision,
1844 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor_revision")
1845 : },
1846 : {
1847 : .name = discard_const_p(char, "type"),
1848 : .get = py_security_descriptor_get_type,
1849 : .set = py_security_descriptor_set_type,
1850 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor_type")
1851 : },
1852 : {
1853 : .name = discard_const_p(char, "owner_sid"),
1854 : .get = py_security_descriptor_get_owner_sid,
1855 : .set = py_security_descriptor_set_owner_sid,
1856 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1857 : },
1858 : {
1859 : .name = discard_const_p(char, "group_sid"),
1860 : .get = py_security_descriptor_get_group_sid,
1861 : .set = py_security_descriptor_set_group_sid,
1862 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1863 : },
1864 : {
1865 : .name = discard_const_p(char, "sacl"),
1866 : .get = py_security_descriptor_get_sacl,
1867 : .set = py_security_descriptor_set_sacl,
1868 : .doc = discard_const_p(char, "PIDL-generated element of base type security_acl")
1869 : },
1870 : {
1871 : .name = discard_const_p(char, "dacl"),
1872 : .get = py_security_descriptor_get_dacl,
1873 : .set = py_security_descriptor_set_dacl,
1874 : .doc = discard_const_p(char, "PIDL-generated element of base type security_acl")
1875 : },
1876 : { .name = NULL }
1877 : };
1878 :
1879 0 : static PyObject *py_security_descriptor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1880 : {
1881 0 : return pytalloc_new(struct security_descriptor, type);
1882 : }
1883 :
1884 29993 : static PyObject *py_security_descriptor_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1885 : {
1886 29993 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1887 29993 : PyObject *ret = NULL;
1888 : DATA_BLOB blob;
1889 : enum ndr_err_code err;
1890 29993 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1891 29993 : if (tmp_ctx == NULL) {
1892 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1893 0 : return NULL;
1894 : }
1895 29993 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_descriptor);
1896 29993 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1897 0 : TALLOC_FREE(tmp_ctx);
1898 0 : PyErr_SetNdrError(err);
1899 0 : return NULL;
1900 : }
1901 :
1902 29993 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1903 29993 : TALLOC_FREE(tmp_ctx);
1904 29993 : return ret;
1905 : }
1906 :
1907 368842 : static PyObject *py_security_descriptor_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1908 : {
1909 368842 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1910 368842 : DATA_BLOB blob = {.data = NULL, .length = 0};
1911 368842 : Py_ssize_t blob_length = 0;
1912 : enum ndr_err_code err;
1913 368842 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1914 368842 : PyObject *allow_remaining_obj = NULL;
1915 368842 : bool allow_remaining = false;
1916 :
1917 368842 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1918 : discard_const_p(char *, kwnames),
1919 : &blob.data, &blob_length,
1920 : &allow_remaining_obj)) {
1921 0 : return NULL;
1922 : }
1923 368842 : blob.length = blob_length;
1924 :
1925 368842 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1926 2 : allow_remaining = true;
1927 : }
1928 :
1929 368842 : if (allow_remaining) {
1930 2 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
1931 : } else {
1932 368840 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
1933 : }
1934 368842 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1935 0 : PyErr_SetNdrError(err);
1936 0 : return NULL;
1937 : }
1938 :
1939 368842 : Py_RETURN_NONE;
1940 : }
1941 :
1942 0 : static PyObject *py_security_descriptor_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1943 : {
1944 0 : struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
1945 : PyObject *ret;
1946 : char *retstr;
1947 :
1948 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_descriptor, "security_descriptor", object);
1949 0 : ret = PyUnicode_FromString(retstr);
1950 0 : talloc_free(retstr);
1951 :
1952 0 : return ret;
1953 : }
1954 :
1955 : static PyMethodDef py_security_descriptor_methods[] = {
1956 : { "__ndr_pack__", (PyCFunction)py_security_descriptor_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1957 : { "__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" },
1958 : { "__ndr_print__", (PyCFunction)py_security_descriptor_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1959 : { NULL, NULL, 0, NULL }
1960 : };
1961 :
1962 :
1963 : static PyTypeObject security_descriptor_Type = {
1964 : PyVarObject_HEAD_INIT(NULL, 0)
1965 : .tp_name = "security.descriptor",
1966 : .tp_getset = py_security_descriptor_getsetters,
1967 : .tp_methods = py_security_descriptor_methods,
1968 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1969 : .tp_new = py_security_descriptor_new,
1970 : };
1971 :
1972 :
1973 0 : static PyObject *py_sec_desc_buf_get_sd_size(PyObject *obj, void *closure)
1974 : {
1975 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(obj);
1976 : PyObject *py_sd_size;
1977 0 : py_sd_size = PyLong_FromUnsignedLongLong((uint32_t)object->sd_size);
1978 0 : return py_sd_size;
1979 : }
1980 :
1981 0 : static int py_sec_desc_buf_set_sd_size(PyObject *py_obj, PyObject *value, void *closure)
1982 : {
1983 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
1984 0 : if (value == NULL) {
1985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd_size");
1986 0 : return -1;
1987 : }
1988 : {
1989 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sd_size));
1990 0 : if (PyLong_Check(value)) {
1991 : unsigned long long test_var;
1992 0 : test_var = PyLong_AsUnsignedLongLong(value);
1993 0 : if (PyErr_Occurred() != NULL) {
1994 0 : return -1;
1995 : }
1996 0 : if (test_var > uint_max) {
1997 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1998 : PyLong_Type.tp_name, uint_max, test_var);
1999 0 : return -1;
2000 : }
2001 0 : object->sd_size = test_var;
2002 : } else {
2003 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2004 : PyLong_Type.tp_name);
2005 0 : return -1;
2006 : }
2007 : }
2008 0 : return 0;
2009 : }
2010 :
2011 0 : static PyObject *py_sec_desc_buf_get_sd(PyObject *obj, void *closure)
2012 : {
2013 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(obj);
2014 : PyObject *py_sd;
2015 0 : if (object->sd == NULL) {
2016 0 : Py_RETURN_NONE;
2017 : }
2018 0 : if (object->sd == NULL) {
2019 0 : py_sd = Py_None;
2020 0 : Py_INCREF(py_sd);
2021 : } else {
2022 0 : py_sd = pytalloc_reference_ex(&security_descriptor_Type, object->sd, object->sd);
2023 : }
2024 0 : return py_sd;
2025 : }
2026 :
2027 0 : static int py_sec_desc_buf_set_sd(PyObject *py_obj, PyObject *value, void *closure)
2028 : {
2029 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
2030 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sd));
2031 0 : if (value == NULL) {
2032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd");
2033 0 : return -1;
2034 : }
2035 0 : if (value == Py_None) {
2036 0 : object->sd = NULL;
2037 : } else {
2038 0 : object->sd = NULL;
2039 0 : PY_CHECK_TYPE(&security_descriptor_Type, value, return -1;);
2040 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2041 0 : PyErr_NoMemory();
2042 0 : return -1;
2043 : }
2044 0 : object->sd = (struct security_descriptor *)pytalloc_get_ptr(value);
2045 : }
2046 0 : return 0;
2047 : }
2048 :
2049 : static PyGetSetDef py_sec_desc_buf_getsetters[] = {
2050 : {
2051 : .name = discard_const_p(char, "sd_size"),
2052 : .get = py_sec_desc_buf_get_sd_size,
2053 : .set = py_sec_desc_buf_set_sd_size,
2054 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2055 : },
2056 : {
2057 : .name = discard_const_p(char, "sd"),
2058 : .get = py_sec_desc_buf_get_sd,
2059 : .set = py_sec_desc_buf_set_sd,
2060 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
2061 : },
2062 : { .name = NULL }
2063 : };
2064 :
2065 0 : static PyObject *py_sec_desc_buf_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2066 : {
2067 0 : return pytalloc_new(struct sec_desc_buf, type);
2068 : }
2069 :
2070 0 : static PyObject *py_sec_desc_buf_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2071 : {
2072 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
2073 0 : PyObject *ret = NULL;
2074 : DATA_BLOB blob;
2075 : enum ndr_err_code err;
2076 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2077 0 : if (tmp_ctx == NULL) {
2078 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2079 0 : return NULL;
2080 : }
2081 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_sec_desc_buf);
2082 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2083 0 : TALLOC_FREE(tmp_ctx);
2084 0 : PyErr_SetNdrError(err);
2085 0 : return NULL;
2086 : }
2087 :
2088 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2089 0 : TALLOC_FREE(tmp_ctx);
2090 0 : return ret;
2091 : }
2092 :
2093 0 : static PyObject *py_sec_desc_buf_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2094 : {
2095 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
2096 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2097 0 : Py_ssize_t blob_length = 0;
2098 : enum ndr_err_code err;
2099 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2100 0 : PyObject *allow_remaining_obj = NULL;
2101 0 : bool allow_remaining = false;
2102 :
2103 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2104 : discard_const_p(char *, kwnames),
2105 : &blob.data, &blob_length,
2106 : &allow_remaining_obj)) {
2107 0 : return NULL;
2108 : }
2109 0 : blob.length = blob_length;
2110 :
2111 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2112 0 : allow_remaining = true;
2113 : }
2114 :
2115 0 : if (allow_remaining) {
2116 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_sec_desc_buf);
2117 : } else {
2118 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);
2119 : }
2120 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2121 0 : PyErr_SetNdrError(err);
2122 0 : return NULL;
2123 : }
2124 :
2125 0 : Py_RETURN_NONE;
2126 : }
2127 :
2128 0 : static PyObject *py_sec_desc_buf_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2129 : {
2130 0 : struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
2131 : PyObject *ret;
2132 : char *retstr;
2133 :
2134 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);
2135 0 : ret = PyUnicode_FromString(retstr);
2136 0 : talloc_free(retstr);
2137 :
2138 0 : return ret;
2139 : }
2140 :
2141 : static PyMethodDef py_sec_desc_buf_methods[] = {
2142 : { "__ndr_pack__", (PyCFunction)py_sec_desc_buf_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2143 : { "__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" },
2144 : { "__ndr_print__", (PyCFunction)py_sec_desc_buf_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2145 : { NULL, NULL, 0, NULL }
2146 : };
2147 :
2148 :
2149 : static PyTypeObject sec_desc_buf_Type = {
2150 : PyVarObject_HEAD_INIT(NULL, 0)
2151 : .tp_name = "security.sec_desc_buf",
2152 : .tp_getset = py_sec_desc_buf_getsetters,
2153 : .tp_methods = py_sec_desc_buf_methods,
2154 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2155 : .tp_new = py_sec_desc_buf_new,
2156 : };
2157 :
2158 :
2159 0 : static PyObject *py_security_token_get_num_sids(PyObject *obj, void *closure)
2160 : {
2161 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
2162 : PyObject *py_num_sids;
2163 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
2164 0 : return py_num_sids;
2165 : }
2166 :
2167 0 : static int py_security_token_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
2168 : {
2169 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2170 0 : if (value == NULL) {
2171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
2172 0 : return -1;
2173 : }
2174 : {
2175 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
2176 0 : if (PyLong_Check(value)) {
2177 : unsigned long long test_var;
2178 0 : test_var = PyLong_AsUnsignedLongLong(value);
2179 0 : if (PyErr_Occurred() != NULL) {
2180 0 : return -1;
2181 : }
2182 0 : if (test_var > uint_max) {
2183 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2184 : PyLong_Type.tp_name, uint_max, test_var);
2185 0 : return -1;
2186 : }
2187 0 : object->num_sids = test_var;
2188 : } else {
2189 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2190 : PyLong_Type.tp_name);
2191 0 : return -1;
2192 : }
2193 : }
2194 0 : return 0;
2195 : }
2196 :
2197 24 : static PyObject *py_security_token_get_sids(PyObject *obj, void *closure)
2198 : {
2199 24 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
2200 : PyObject *py_sids;
2201 24 : py_sids = PyList_New(object->num_sids);
2202 24 : if (py_sids == NULL) {
2203 0 : return NULL;
2204 : }
2205 : {
2206 : int sids_cntr_0;
2207 353 : for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
2208 : PyObject *py_sids_0;
2209 329 : py_sids_0 = pytalloc_reference_ex(&dom_sid_Type, object->sids, &object->sids[sids_cntr_0]);
2210 329 : PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
2211 : }
2212 : }
2213 24 : return py_sids;
2214 : }
2215 :
2216 0 : static int py_security_token_set_sids(PyObject *py_obj, PyObject *value, void *closure)
2217 : {
2218 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2219 0 : if (value == NULL) {
2220 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
2221 0 : return -1;
2222 : }
2223 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2224 : {
2225 : int sids_cntr_0;
2226 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
2227 0 : if (!object->sids) { return -1;; }
2228 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
2229 0 : for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
2230 0 : if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
2231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_0]");
2232 0 : return -1;
2233 : }
2234 0 : PY_CHECK_TYPE(&dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
2235 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
2236 0 : PyErr_NoMemory();
2237 0 : return -1;
2238 : }
2239 0 : object->sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
2240 : }
2241 : }
2242 0 : return 0;
2243 : }
2244 :
2245 0 : static PyObject *py_security_token_get_privilege_mask(PyObject *obj, void *closure)
2246 : {
2247 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
2248 : PyObject *py_privilege_mask;
2249 0 : py_privilege_mask = PyLong_FromUnsignedLongLong(object->privilege_mask);
2250 0 : return py_privilege_mask;
2251 : }
2252 :
2253 0 : static int py_security_token_set_privilege_mask(PyObject *py_obj, PyObject *value, void *closure)
2254 : {
2255 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2256 0 : if (value == NULL) {
2257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_mask");
2258 0 : return -1;
2259 : }
2260 : {
2261 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_mask));
2262 0 : if (PyLong_Check(value)) {
2263 : unsigned long long test_var;
2264 0 : test_var = PyLong_AsUnsignedLongLong(value);
2265 0 : if (PyErr_Occurred() != NULL) {
2266 0 : return -1;
2267 : }
2268 0 : if (test_var > uint_max) {
2269 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2270 : PyLong_Type.tp_name, uint_max, test_var);
2271 0 : return -1;
2272 : }
2273 0 : object->privilege_mask = test_var;
2274 : } else {
2275 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2276 : PyLong_Type.tp_name);
2277 0 : return -1;
2278 : }
2279 : }
2280 0 : return 0;
2281 : }
2282 :
2283 0 : static PyObject *py_security_token_get_rights_mask(PyObject *obj, void *closure)
2284 : {
2285 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
2286 : PyObject *py_rights_mask;
2287 0 : py_rights_mask = PyLong_FromUnsignedLongLong((uint32_t)object->rights_mask);
2288 0 : return py_rights_mask;
2289 : }
2290 :
2291 0 : static int py_security_token_set_rights_mask(PyObject *py_obj, PyObject *value, void *closure)
2292 : {
2293 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2294 0 : if (value == NULL) {
2295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rights_mask");
2296 0 : return -1;
2297 : }
2298 : {
2299 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rights_mask));
2300 0 : if (PyLong_Check(value)) {
2301 : unsigned long long test_var;
2302 0 : test_var = PyLong_AsUnsignedLongLong(value);
2303 0 : if (PyErr_Occurred() != NULL) {
2304 0 : return -1;
2305 : }
2306 0 : if (test_var > uint_max) {
2307 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2308 : PyLong_Type.tp_name, uint_max, test_var);
2309 0 : return -1;
2310 : }
2311 0 : object->rights_mask = test_var;
2312 : } else {
2313 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2314 : PyLong_Type.tp_name);
2315 0 : return -1;
2316 : }
2317 : }
2318 0 : return 0;
2319 : }
2320 :
2321 : static PyGetSetDef py_security_token_getsetters[] = {
2322 : {
2323 : .name = discard_const_p(char, "num_sids"),
2324 : .get = py_security_token_get_num_sids,
2325 : .set = py_security_token_set_num_sids,
2326 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2327 : },
2328 : {
2329 : .name = discard_const_p(char, "sids"),
2330 : .get = py_security_token_get_sids,
2331 : .set = py_security_token_set_sids,
2332 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
2333 : },
2334 : {
2335 : .name = discard_const_p(char, "privilege_mask"),
2336 : .get = py_security_token_get_privilege_mask,
2337 : .set = py_security_token_set_privilege_mask,
2338 : .doc = discard_const_p(char, "PIDL-generated element of base type se_privilege")
2339 : },
2340 : {
2341 : .name = discard_const_p(char, "rights_mask"),
2342 : .get = py_security_token_get_rights_mask,
2343 : .set = py_security_token_set_rights_mask,
2344 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SystemAccessModeFlags")
2345 : },
2346 : { .name = NULL }
2347 : };
2348 :
2349 0 : static PyObject *py_security_token_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2350 : {
2351 0 : return pytalloc_new(struct security_token, type);
2352 : }
2353 :
2354 0 : static PyObject *py_security_token_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2355 : {
2356 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2357 0 : PyObject *ret = NULL;
2358 : DATA_BLOB blob;
2359 : enum ndr_err_code err;
2360 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2361 0 : if (tmp_ctx == NULL) {
2362 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2363 0 : return NULL;
2364 : }
2365 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_token);
2366 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2367 0 : TALLOC_FREE(tmp_ctx);
2368 0 : PyErr_SetNdrError(err);
2369 0 : return NULL;
2370 : }
2371 :
2372 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2373 0 : TALLOC_FREE(tmp_ctx);
2374 0 : return ret;
2375 : }
2376 :
2377 0 : static PyObject *py_security_token_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2378 : {
2379 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2380 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2381 0 : Py_ssize_t blob_length = 0;
2382 : enum ndr_err_code err;
2383 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2384 0 : PyObject *allow_remaining_obj = NULL;
2385 0 : bool allow_remaining = false;
2386 :
2387 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2388 : discard_const_p(char *, kwnames),
2389 : &blob.data, &blob_length,
2390 : &allow_remaining_obj)) {
2391 0 : return NULL;
2392 : }
2393 0 : blob.length = blob_length;
2394 :
2395 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2396 0 : allow_remaining = true;
2397 : }
2398 :
2399 0 : if (allow_remaining) {
2400 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token);
2401 : } else {
2402 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token);
2403 : }
2404 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2405 0 : PyErr_SetNdrError(err);
2406 0 : return NULL;
2407 : }
2408 :
2409 0 : Py_RETURN_NONE;
2410 : }
2411 :
2412 0 : static PyObject *py_security_token_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2413 : {
2414 0 : struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
2415 : PyObject *ret;
2416 : char *retstr;
2417 :
2418 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_token, "security_token", object);
2419 0 : ret = PyUnicode_FromString(retstr);
2420 0 : talloc_free(retstr);
2421 :
2422 0 : return ret;
2423 : }
2424 :
2425 : static PyMethodDef py_security_token_methods[] = {
2426 : { "__ndr_pack__", (PyCFunction)py_security_token_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2427 : { "__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" },
2428 : { "__ndr_print__", (PyCFunction)py_security_token_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2429 : { NULL, NULL, 0, NULL }
2430 : };
2431 :
2432 :
2433 : static PyTypeObject security_token_Type = {
2434 : PyVarObject_HEAD_INIT(NULL, 0)
2435 : .tp_name = "security.token",
2436 : .tp_getset = py_security_token_getsetters,
2437 : .tp_methods = py_security_token_methods,
2438 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2439 : .tp_new = py_security_token_new,
2440 : };
2441 :
2442 :
2443 0 : static PyObject *py_security_unix_token_get_uid(PyObject *obj, void *closure)
2444 : {
2445 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
2446 : PyObject *py_uid;
2447 0 : py_uid = PyLong_FromUnsignedLongLong(object->uid);
2448 0 : return py_uid;
2449 : }
2450 :
2451 0 : static int py_security_unix_token_set_uid(PyObject *py_obj, PyObject *value, void *closure)
2452 : {
2453 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2454 0 : if (value == NULL) {
2455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uid");
2456 0 : return -1;
2457 : }
2458 : {
2459 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
2460 0 : if (PyLong_Check(value)) {
2461 : unsigned long long test_var;
2462 0 : test_var = PyLong_AsUnsignedLongLong(value);
2463 0 : if (PyErr_Occurred() != NULL) {
2464 0 : return -1;
2465 : }
2466 0 : if (test_var > uint_max) {
2467 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2468 : PyLong_Type.tp_name, uint_max, test_var);
2469 0 : return -1;
2470 : }
2471 0 : object->uid = test_var;
2472 : } else {
2473 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2474 : PyLong_Type.tp_name);
2475 0 : return -1;
2476 : }
2477 : }
2478 0 : return 0;
2479 : }
2480 :
2481 0 : static PyObject *py_security_unix_token_get_gid(PyObject *obj, void *closure)
2482 : {
2483 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
2484 : PyObject *py_gid;
2485 0 : py_gid = PyLong_FromUnsignedLongLong(object->gid);
2486 0 : return py_gid;
2487 : }
2488 :
2489 0 : static int py_security_unix_token_set_gid(PyObject *py_obj, PyObject *value, void *closure)
2490 : {
2491 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2492 0 : if (value == NULL) {
2493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->gid");
2494 0 : return -1;
2495 : }
2496 : {
2497 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->gid));
2498 0 : if (PyLong_Check(value)) {
2499 : unsigned long long test_var;
2500 0 : test_var = PyLong_AsUnsignedLongLong(value);
2501 0 : if (PyErr_Occurred() != NULL) {
2502 0 : return -1;
2503 : }
2504 0 : if (test_var > uint_max) {
2505 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2506 : PyLong_Type.tp_name, uint_max, test_var);
2507 0 : return -1;
2508 : }
2509 0 : object->gid = test_var;
2510 : } else {
2511 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2512 : PyLong_Type.tp_name);
2513 0 : return -1;
2514 : }
2515 : }
2516 0 : return 0;
2517 : }
2518 :
2519 0 : static PyObject *py_security_unix_token_get_ngroups(PyObject *obj, void *closure)
2520 : {
2521 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
2522 : PyObject *py_ngroups;
2523 0 : py_ngroups = PyLong_FromUnsignedLongLong((uint32_t)object->ngroups);
2524 0 : return py_ngroups;
2525 : }
2526 :
2527 0 : static int py_security_unix_token_set_ngroups(PyObject *py_obj, PyObject *value, void *closure)
2528 : {
2529 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2530 0 : if (value == NULL) {
2531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ngroups");
2532 0 : return -1;
2533 : }
2534 : {
2535 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ngroups));
2536 0 : if (PyLong_Check(value)) {
2537 : unsigned long long test_var;
2538 0 : test_var = PyLong_AsUnsignedLongLong(value);
2539 0 : if (PyErr_Occurred() != NULL) {
2540 0 : return -1;
2541 : }
2542 0 : if (test_var > uint_max) {
2543 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2544 : PyLong_Type.tp_name, uint_max, test_var);
2545 0 : return -1;
2546 : }
2547 0 : object->ngroups = test_var;
2548 : } else {
2549 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2550 : PyLong_Type.tp_name);
2551 0 : return -1;
2552 : }
2553 : }
2554 0 : return 0;
2555 : }
2556 :
2557 0 : static PyObject *py_security_unix_token_get_groups(PyObject *obj, void *closure)
2558 : {
2559 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
2560 : PyObject *py_groups;
2561 0 : py_groups = PyList_New(object->ngroups);
2562 0 : if (py_groups == NULL) {
2563 0 : return NULL;
2564 : }
2565 : {
2566 : int groups_cntr_0;
2567 0 : for (groups_cntr_0 = 0; groups_cntr_0 < (object->ngroups); groups_cntr_0++) {
2568 : PyObject *py_groups_0;
2569 0 : py_groups_0 = PyLong_FromUnsignedLongLong(object->groups[groups_cntr_0]);
2570 0 : PyList_SetItem(py_groups, groups_cntr_0, py_groups_0);
2571 : }
2572 : }
2573 0 : return py_groups;
2574 : }
2575 :
2576 0 : static int py_security_unix_token_set_groups(PyObject *py_obj, PyObject *value, void *closure)
2577 : {
2578 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2579 0 : if (value == NULL) {
2580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups");
2581 0 : return -1;
2582 : }
2583 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2584 : {
2585 : int groups_cntr_0;
2586 0 : object->groups = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->groups, PyList_GET_SIZE(value));
2587 0 : if (!object->groups) { return -1;; }
2588 0 : talloc_set_name_const(object->groups, "ARRAY: object->groups");
2589 0 : for (groups_cntr_0 = 0; groups_cntr_0 < PyList_GET_SIZE(value); groups_cntr_0++) {
2590 0 : if (PyList_GET_ITEM(value, groups_cntr_0) == NULL) {
2591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups[groups_cntr_0]");
2592 0 : return -1;
2593 : }
2594 : {
2595 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->groups[groups_cntr_0]));
2596 0 : if (PyLong_Check(PyList_GET_ITEM(value, groups_cntr_0))) {
2597 : unsigned long long test_var;
2598 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, groups_cntr_0));
2599 0 : if (PyErr_Occurred() != NULL) {
2600 0 : return -1;
2601 : }
2602 0 : if (test_var > uint_max) {
2603 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2604 : PyLong_Type.tp_name, uint_max, test_var);
2605 0 : return -1;
2606 : }
2607 0 : object->groups[groups_cntr_0] = test_var;
2608 : } else {
2609 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2610 : PyLong_Type.tp_name);
2611 0 : return -1;
2612 : }
2613 : }
2614 : }
2615 : }
2616 0 : return 0;
2617 : }
2618 :
2619 : static PyGetSetDef py_security_unix_token_getsetters[] = {
2620 : {
2621 : .name = discard_const_p(char, "uid"),
2622 : .get = py_security_unix_token_get_uid,
2623 : .set = py_security_unix_token_set_uid,
2624 : .doc = discard_const_p(char, "PIDL-generated element of base type uid_t")
2625 : },
2626 : {
2627 : .name = discard_const_p(char, "gid"),
2628 : .get = py_security_unix_token_get_gid,
2629 : .set = py_security_unix_token_set_gid,
2630 : .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
2631 : },
2632 : {
2633 : .name = discard_const_p(char, "ngroups"),
2634 : .get = py_security_unix_token_get_ngroups,
2635 : .set = py_security_unix_token_set_ngroups,
2636 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2637 : },
2638 : {
2639 : .name = discard_const_p(char, "groups"),
2640 : .get = py_security_unix_token_get_groups,
2641 : .set = py_security_unix_token_set_groups,
2642 : .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
2643 : },
2644 : { .name = NULL }
2645 : };
2646 :
2647 0 : static PyObject *py_security_unix_token_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2648 : {
2649 0 : return pytalloc_new(struct security_unix_token, type);
2650 : }
2651 :
2652 0 : static PyObject *py_security_unix_token_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2653 : {
2654 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2655 0 : PyObject *ret = NULL;
2656 : DATA_BLOB blob;
2657 : enum ndr_err_code err;
2658 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2659 0 : if (tmp_ctx == NULL) {
2660 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2661 0 : return NULL;
2662 : }
2663 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_unix_token);
2664 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2665 0 : TALLOC_FREE(tmp_ctx);
2666 0 : PyErr_SetNdrError(err);
2667 0 : return NULL;
2668 : }
2669 :
2670 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2671 0 : TALLOC_FREE(tmp_ctx);
2672 0 : return ret;
2673 : }
2674 :
2675 0 : static PyObject *py_security_unix_token_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2676 : {
2677 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2678 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2679 0 : Py_ssize_t blob_length = 0;
2680 : enum ndr_err_code err;
2681 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2682 0 : PyObject *allow_remaining_obj = NULL;
2683 0 : bool allow_remaining = false;
2684 :
2685 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2686 : discard_const_p(char *, kwnames),
2687 : &blob.data, &blob_length,
2688 : &allow_remaining_obj)) {
2689 0 : return NULL;
2690 : }
2691 0 : blob.length = blob_length;
2692 :
2693 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2694 0 : allow_remaining = true;
2695 : }
2696 :
2697 0 : if (allow_remaining) {
2698 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_unix_token);
2699 : } else {
2700 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);
2701 : }
2702 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2703 0 : PyErr_SetNdrError(err);
2704 0 : return NULL;
2705 : }
2706 :
2707 0 : Py_RETURN_NONE;
2708 : }
2709 :
2710 0 : static PyObject *py_security_unix_token_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2711 : {
2712 0 : struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
2713 : PyObject *ret;
2714 : char *retstr;
2715 :
2716 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);
2717 0 : ret = PyUnicode_FromString(retstr);
2718 0 : talloc_free(retstr);
2719 :
2720 0 : return ret;
2721 : }
2722 :
2723 : static PyMethodDef py_security_unix_token_methods[] = {
2724 : { "__ndr_pack__", (PyCFunction)py_security_unix_token_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2725 : { "__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" },
2726 : { "__ndr_print__", (PyCFunction)py_security_unix_token_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2727 : { NULL, NULL, 0, NULL }
2728 : };
2729 :
2730 :
2731 : static PyTypeObject security_unix_token_Type = {
2732 : PyVarObject_HEAD_INIT(NULL, 0)
2733 : .tp_name = "security.unix_token",
2734 : .tp_getset = py_security_unix_token_getsetters,
2735 : .tp_methods = py_security_unix_token_methods,
2736 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2737 : .tp_new = py_security_unix_token_new,
2738 : };
2739 :
2740 :
2741 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_Flags(PyObject *obj, void *closure)
2742 : {
2743 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(obj);
2744 : PyObject *py_Flags;
2745 0 : py_Flags = PyLong_FromUnsignedLongLong((uint32_t)object->Flags);
2746 0 : return py_Flags;
2747 : }
2748 :
2749 0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
2750 : {
2751 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
2752 0 : if (value == NULL) {
2753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Flags");
2754 0 : return -1;
2755 : }
2756 : {
2757 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
2758 0 : if (PyLong_Check(value)) {
2759 : unsigned long long test_var;
2760 0 : test_var = PyLong_AsUnsignedLongLong(value);
2761 0 : if (PyErr_Occurred() != NULL) {
2762 0 : return -1;
2763 : }
2764 0 : if (test_var > uint_max) {
2765 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2766 : PyLong_Type.tp_name, uint_max, test_var);
2767 0 : return -1;
2768 : }
2769 0 : object->Flags = test_var;
2770 : } else {
2771 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2772 : PyLong_Type.tp_name);
2773 0 : return -1;
2774 : }
2775 : }
2776 0 : return 0;
2777 : }
2778 :
2779 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_TokenIL(PyObject *obj, void *closure)
2780 : {
2781 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(obj);
2782 : PyObject *py_TokenIL;
2783 0 : py_TokenIL = PyLong_FromUnsignedLongLong((uint32_t)object->TokenIL);
2784 0 : return py_TokenIL;
2785 : }
2786 :
2787 0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_TokenIL(PyObject *py_obj, PyObject *value, void *closure)
2788 : {
2789 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
2790 0 : if (value == NULL) {
2791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->TokenIL");
2792 0 : return -1;
2793 : }
2794 : {
2795 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->TokenIL));
2796 0 : if (PyLong_Check(value)) {
2797 : unsigned long long test_var;
2798 0 : test_var = PyLong_AsUnsignedLongLong(value);
2799 0 : if (PyErr_Occurred() != NULL) {
2800 0 : return -1;
2801 : }
2802 0 : if (test_var > uint_max) {
2803 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2804 : PyLong_Type.tp_name, uint_max, test_var);
2805 0 : return -1;
2806 : }
2807 0 : object->TokenIL = test_var;
2808 : } else {
2809 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2810 : PyLong_Type.tp_name);
2811 0 : return -1;
2812 : }
2813 : }
2814 0 : return 0;
2815 : }
2816 :
2817 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_MachineId(PyObject *obj, void *closure)
2818 : {
2819 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(obj);
2820 : PyObject *py_MachineId;
2821 0 : py_MachineId = PyList_New(32);
2822 0 : if (py_MachineId == NULL) {
2823 0 : return NULL;
2824 : }
2825 : {
2826 : int MachineId_cntr_0;
2827 0 : for (MachineId_cntr_0 = 0; MachineId_cntr_0 < (32); MachineId_cntr_0++) {
2828 : PyObject *py_MachineId_0;
2829 0 : py_MachineId_0 = PyLong_FromLong((uint16_t)object->MachineId[MachineId_cntr_0]);
2830 0 : PyList_SetItem(py_MachineId, MachineId_cntr_0, py_MachineId_0);
2831 : }
2832 : }
2833 0 : return py_MachineId;
2834 : }
2835 :
2836 0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_MachineId(PyObject *py_obj, PyObject *value, void *closure)
2837 : {
2838 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
2839 0 : if (value == NULL) {
2840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MachineId");
2841 0 : return -1;
2842 : }
2843 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2844 : {
2845 : int MachineId_cntr_0;
2846 0 : if (ARRAY_SIZE(object->MachineId) != PyList_GET_SIZE(value)) {
2847 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));
2848 0 : return -1;
2849 : }
2850 0 : for (MachineId_cntr_0 = 0; MachineId_cntr_0 < PyList_GET_SIZE(value); MachineId_cntr_0++) {
2851 0 : if (PyList_GET_ITEM(value, MachineId_cntr_0) == NULL) {
2852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MachineId[MachineId_cntr_0]");
2853 0 : return -1;
2854 : }
2855 : {
2856 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MachineId[MachineId_cntr_0]));
2857 0 : if (PyLong_Check(PyList_GET_ITEM(value, MachineId_cntr_0))) {
2858 : unsigned long long test_var;
2859 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, MachineId_cntr_0));
2860 0 : if (PyErr_Occurred() != NULL) {
2861 0 : return -1;
2862 : }
2863 0 : if (test_var > uint_max) {
2864 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2865 : PyLong_Type.tp_name, uint_max, test_var);
2866 0 : return -1;
2867 : }
2868 0 : object->MachineId[MachineId_cntr_0] = test_var;
2869 : } else {
2870 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2871 : PyLong_Type.tp_name);
2872 0 : return -1;
2873 : }
2874 : }
2875 : }
2876 : }
2877 0 : return 0;
2878 : }
2879 :
2880 : static PyGetSetDef py_LSAP_TOKEN_INFO_INTEGRITY_getsetters[] = {
2881 : {
2882 : .name = discard_const_p(char, "Flags"),
2883 : .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_Flags,
2884 : .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_Flags,
2885 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2886 : },
2887 : {
2888 : .name = discard_const_p(char, "TokenIL"),
2889 : .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_TokenIL,
2890 : .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_TokenIL,
2891 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2892 : },
2893 : {
2894 : .name = discard_const_p(char, "MachineId"),
2895 : .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_MachineId,
2896 : .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_MachineId,
2897 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2898 : },
2899 : { .name = NULL }
2900 : };
2901 :
2902 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2903 : {
2904 0 : return pytalloc_new(struct LSAP_TOKEN_INFO_INTEGRITY, type);
2905 : }
2906 :
2907 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2908 : {
2909 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
2910 0 : PyObject *ret = NULL;
2911 : DATA_BLOB blob;
2912 : enum ndr_err_code err;
2913 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2914 0 : if (tmp_ctx == NULL) {
2915 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2916 0 : return NULL;
2917 : }
2918 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_LSAP_TOKEN_INFO_INTEGRITY);
2919 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2920 0 : TALLOC_FREE(tmp_ctx);
2921 0 : PyErr_SetNdrError(err);
2922 0 : return NULL;
2923 : }
2924 :
2925 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2926 0 : TALLOC_FREE(tmp_ctx);
2927 0 : return ret;
2928 : }
2929 :
2930 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2931 : {
2932 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
2933 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2934 0 : Py_ssize_t blob_length = 0;
2935 : enum ndr_err_code err;
2936 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2937 0 : PyObject *allow_remaining_obj = NULL;
2938 0 : bool allow_remaining = false;
2939 :
2940 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2941 : discard_const_p(char *, kwnames),
2942 : &blob.data, &blob_length,
2943 : &allow_remaining_obj)) {
2944 0 : return NULL;
2945 : }
2946 0 : blob.length = blob_length;
2947 :
2948 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2949 0 : allow_remaining = true;
2950 : }
2951 :
2952 0 : if (allow_remaining) {
2953 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);
2954 : } else {
2955 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);
2956 : }
2957 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2958 0 : PyErr_SetNdrError(err);
2959 0 : return NULL;
2960 : }
2961 :
2962 0 : Py_RETURN_NONE;
2963 : }
2964 :
2965 0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2966 : {
2967 0 : struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
2968 : PyObject *ret;
2969 : char *retstr;
2970 :
2971 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);
2972 0 : ret = PyUnicode_FromString(retstr);
2973 0 : talloc_free(retstr);
2974 :
2975 0 : return ret;
2976 : }
2977 :
2978 : static PyMethodDef py_LSAP_TOKEN_INFO_INTEGRITY_methods[] = {
2979 : { "__ndr_pack__", (PyCFunction)py_LSAP_TOKEN_INFO_INTEGRITY_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2980 : { "__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" },
2981 : { "__ndr_print__", (PyCFunction)py_LSAP_TOKEN_INFO_INTEGRITY_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2982 : { NULL, NULL, 0, NULL }
2983 : };
2984 :
2985 :
2986 : static PyTypeObject LSAP_TOKEN_INFO_INTEGRITY_Type = {
2987 : PyVarObject_HEAD_INIT(NULL, 0)
2988 : .tp_name = "security.LSAP_TOKEN_INFO_INTEGRITY",
2989 : .tp_getset = py_LSAP_TOKEN_INFO_INTEGRITY_getsetters,
2990 : .tp_methods = py_LSAP_TOKEN_INFO_INTEGRITY_methods,
2991 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2992 : .tp_new = py_LSAP_TOKEN_INFO_INTEGRITY_new,
2993 : };
2994 :
2995 :
2996 0 : static PyObject *py_generic_mapping_get_generic_read(PyObject *obj, void *closure)
2997 : {
2998 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
2999 : PyObject *py_generic_read;
3000 0 : py_generic_read = PyLong_FromUnsignedLongLong((uint32_t)object->generic_read);
3001 0 : return py_generic_read;
3002 : }
3003 :
3004 0 : static int py_generic_mapping_set_generic_read(PyObject *py_obj, PyObject *value, void *closure)
3005 : {
3006 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
3007 0 : if (value == NULL) {
3008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_read");
3009 0 : return -1;
3010 : }
3011 : {
3012 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_read));
3013 0 : if (PyLong_Check(value)) {
3014 : unsigned long long test_var;
3015 0 : test_var = PyLong_AsUnsignedLongLong(value);
3016 0 : if (PyErr_Occurred() != NULL) {
3017 0 : return -1;
3018 : }
3019 0 : if (test_var > uint_max) {
3020 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3021 : PyLong_Type.tp_name, uint_max, test_var);
3022 0 : return -1;
3023 : }
3024 0 : object->generic_read = test_var;
3025 : } else {
3026 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3027 : PyLong_Type.tp_name);
3028 0 : return -1;
3029 : }
3030 : }
3031 0 : return 0;
3032 : }
3033 :
3034 0 : static PyObject *py_generic_mapping_get_generic_write(PyObject *obj, void *closure)
3035 : {
3036 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
3037 : PyObject *py_generic_write;
3038 0 : py_generic_write = PyLong_FromUnsignedLongLong((uint32_t)object->generic_write);
3039 0 : return py_generic_write;
3040 : }
3041 :
3042 0 : static int py_generic_mapping_set_generic_write(PyObject *py_obj, PyObject *value, void *closure)
3043 : {
3044 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
3045 0 : if (value == NULL) {
3046 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_write");
3047 0 : return -1;
3048 : }
3049 : {
3050 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_write));
3051 0 : if (PyLong_Check(value)) {
3052 : unsigned long long test_var;
3053 0 : test_var = PyLong_AsUnsignedLongLong(value);
3054 0 : if (PyErr_Occurred() != NULL) {
3055 0 : return -1;
3056 : }
3057 0 : if (test_var > uint_max) {
3058 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3059 : PyLong_Type.tp_name, uint_max, test_var);
3060 0 : return -1;
3061 : }
3062 0 : object->generic_write = test_var;
3063 : } else {
3064 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3065 : PyLong_Type.tp_name);
3066 0 : return -1;
3067 : }
3068 : }
3069 0 : return 0;
3070 : }
3071 :
3072 0 : static PyObject *py_generic_mapping_get_generic_execute(PyObject *obj, void *closure)
3073 : {
3074 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
3075 : PyObject *py_generic_execute;
3076 0 : py_generic_execute = PyLong_FromUnsignedLongLong((uint32_t)object->generic_execute);
3077 0 : return py_generic_execute;
3078 : }
3079 :
3080 0 : static int py_generic_mapping_set_generic_execute(PyObject *py_obj, PyObject *value, void *closure)
3081 : {
3082 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
3083 0 : if (value == NULL) {
3084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_execute");
3085 0 : return -1;
3086 : }
3087 : {
3088 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_execute));
3089 0 : if (PyLong_Check(value)) {
3090 : unsigned long long test_var;
3091 0 : test_var = PyLong_AsUnsignedLongLong(value);
3092 0 : if (PyErr_Occurred() != NULL) {
3093 0 : return -1;
3094 : }
3095 0 : if (test_var > uint_max) {
3096 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3097 : PyLong_Type.tp_name, uint_max, test_var);
3098 0 : return -1;
3099 : }
3100 0 : object->generic_execute = test_var;
3101 : } else {
3102 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3103 : PyLong_Type.tp_name);
3104 0 : return -1;
3105 : }
3106 : }
3107 0 : return 0;
3108 : }
3109 :
3110 0 : static PyObject *py_generic_mapping_get_generic_all(PyObject *obj, void *closure)
3111 : {
3112 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
3113 : PyObject *py_generic_all;
3114 0 : py_generic_all = PyLong_FromUnsignedLongLong((uint32_t)object->generic_all);
3115 0 : return py_generic_all;
3116 : }
3117 :
3118 0 : static int py_generic_mapping_set_generic_all(PyObject *py_obj, PyObject *value, void *closure)
3119 : {
3120 0 : struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
3121 0 : if (value == NULL) {
3122 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_all");
3123 0 : return -1;
3124 : }
3125 : {
3126 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_all));
3127 0 : if (PyLong_Check(value)) {
3128 : unsigned long long test_var;
3129 0 : test_var = PyLong_AsUnsignedLongLong(value);
3130 0 : if (PyErr_Occurred() != NULL) {
3131 0 : return -1;
3132 : }
3133 0 : if (test_var > uint_max) {
3134 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3135 : PyLong_Type.tp_name, uint_max, test_var);
3136 0 : return -1;
3137 : }
3138 0 : object->generic_all = test_var;
3139 : } else {
3140 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3141 : PyLong_Type.tp_name);
3142 0 : return -1;
3143 : }
3144 : }
3145 0 : return 0;
3146 : }
3147 :
3148 : static PyGetSetDef py_generic_mapping_getsetters[] = {
3149 : {
3150 : .name = discard_const_p(char, "generic_read"),
3151 : .get = py_generic_mapping_get_generic_read,
3152 : .set = py_generic_mapping_set_generic_read,
3153 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3154 : },
3155 : {
3156 : .name = discard_const_p(char, "generic_write"),
3157 : .get = py_generic_mapping_get_generic_write,
3158 : .set = py_generic_mapping_set_generic_write,
3159 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3160 : },
3161 : {
3162 : .name = discard_const_p(char, "generic_execute"),
3163 : .get = py_generic_mapping_get_generic_execute,
3164 : .set = py_generic_mapping_set_generic_execute,
3165 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3166 : },
3167 : {
3168 : .name = discard_const_p(char, "generic_all"),
3169 : .get = py_generic_mapping_get_generic_all,
3170 : .set = py_generic_mapping_set_generic_all,
3171 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3172 : },
3173 : { .name = NULL }
3174 : };
3175 :
3176 0 : static PyObject *py_generic_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3177 : {
3178 0 : return pytalloc_new(struct generic_mapping, type);
3179 : }
3180 :
3181 :
3182 : static PyTypeObject generic_mapping_Type = {
3183 : PyVarObject_HEAD_INIT(NULL, 0)
3184 : .tp_name = "security.generic_mapping",
3185 : .tp_getset = py_generic_mapping_getsetters,
3186 : .tp_methods = NULL,
3187 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3188 : .tp_new = py_generic_mapping_new,
3189 : };
3190 :
3191 :
3192 0 : static PyObject *py_standard_mapping_get_std_read(PyObject *obj, void *closure)
3193 : {
3194 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
3195 : PyObject *py_std_read;
3196 0 : py_std_read = PyLong_FromUnsignedLongLong((uint32_t)object->std_read);
3197 0 : return py_std_read;
3198 : }
3199 :
3200 0 : static int py_standard_mapping_set_std_read(PyObject *py_obj, PyObject *value, void *closure)
3201 : {
3202 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
3203 0 : if (value == NULL) {
3204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_read");
3205 0 : return -1;
3206 : }
3207 : {
3208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_read));
3209 0 : if (PyLong_Check(value)) {
3210 : unsigned long long test_var;
3211 0 : test_var = PyLong_AsUnsignedLongLong(value);
3212 0 : if (PyErr_Occurred() != NULL) {
3213 0 : return -1;
3214 : }
3215 0 : if (test_var > uint_max) {
3216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3217 : PyLong_Type.tp_name, uint_max, test_var);
3218 0 : return -1;
3219 : }
3220 0 : object->std_read = test_var;
3221 : } else {
3222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3223 : PyLong_Type.tp_name);
3224 0 : return -1;
3225 : }
3226 : }
3227 0 : return 0;
3228 : }
3229 :
3230 0 : static PyObject *py_standard_mapping_get_std_write(PyObject *obj, void *closure)
3231 : {
3232 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
3233 : PyObject *py_std_write;
3234 0 : py_std_write = PyLong_FromUnsignedLongLong((uint32_t)object->std_write);
3235 0 : return py_std_write;
3236 : }
3237 :
3238 0 : static int py_standard_mapping_set_std_write(PyObject *py_obj, PyObject *value, void *closure)
3239 : {
3240 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
3241 0 : if (value == NULL) {
3242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_write");
3243 0 : return -1;
3244 : }
3245 : {
3246 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_write));
3247 0 : if (PyLong_Check(value)) {
3248 : unsigned long long test_var;
3249 0 : test_var = PyLong_AsUnsignedLongLong(value);
3250 0 : if (PyErr_Occurred() != NULL) {
3251 0 : return -1;
3252 : }
3253 0 : if (test_var > uint_max) {
3254 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3255 : PyLong_Type.tp_name, uint_max, test_var);
3256 0 : return -1;
3257 : }
3258 0 : object->std_write = test_var;
3259 : } else {
3260 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3261 : PyLong_Type.tp_name);
3262 0 : return -1;
3263 : }
3264 : }
3265 0 : return 0;
3266 : }
3267 :
3268 0 : static PyObject *py_standard_mapping_get_std_execute(PyObject *obj, void *closure)
3269 : {
3270 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
3271 : PyObject *py_std_execute;
3272 0 : py_std_execute = PyLong_FromUnsignedLongLong((uint32_t)object->std_execute);
3273 0 : return py_std_execute;
3274 : }
3275 :
3276 0 : static int py_standard_mapping_set_std_execute(PyObject *py_obj, PyObject *value, void *closure)
3277 : {
3278 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
3279 0 : if (value == NULL) {
3280 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_execute");
3281 0 : return -1;
3282 : }
3283 : {
3284 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_execute));
3285 0 : if (PyLong_Check(value)) {
3286 : unsigned long long test_var;
3287 0 : test_var = PyLong_AsUnsignedLongLong(value);
3288 0 : if (PyErr_Occurred() != NULL) {
3289 0 : return -1;
3290 : }
3291 0 : if (test_var > uint_max) {
3292 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3293 : PyLong_Type.tp_name, uint_max, test_var);
3294 0 : return -1;
3295 : }
3296 0 : object->std_execute = test_var;
3297 : } else {
3298 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3299 : PyLong_Type.tp_name);
3300 0 : return -1;
3301 : }
3302 : }
3303 0 : return 0;
3304 : }
3305 :
3306 0 : static PyObject *py_standard_mapping_get_std_all(PyObject *obj, void *closure)
3307 : {
3308 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
3309 : PyObject *py_std_all;
3310 0 : py_std_all = PyLong_FromUnsignedLongLong((uint32_t)object->std_all);
3311 0 : return py_std_all;
3312 : }
3313 :
3314 0 : static int py_standard_mapping_set_std_all(PyObject *py_obj, PyObject *value, void *closure)
3315 : {
3316 0 : struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
3317 0 : if (value == NULL) {
3318 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_all");
3319 0 : return -1;
3320 : }
3321 : {
3322 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_all));
3323 0 : if (PyLong_Check(value)) {
3324 : unsigned long long test_var;
3325 0 : test_var = PyLong_AsUnsignedLongLong(value);
3326 0 : if (PyErr_Occurred() != NULL) {
3327 0 : return -1;
3328 : }
3329 0 : if (test_var > uint_max) {
3330 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3331 : PyLong_Type.tp_name, uint_max, test_var);
3332 0 : return -1;
3333 : }
3334 0 : object->std_all = test_var;
3335 : } else {
3336 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3337 : PyLong_Type.tp_name);
3338 0 : return -1;
3339 : }
3340 : }
3341 0 : return 0;
3342 : }
3343 :
3344 : static PyGetSetDef py_standard_mapping_getsetters[] = {
3345 : {
3346 : .name = discard_const_p(char, "std_read"),
3347 : .get = py_standard_mapping_get_std_read,
3348 : .set = py_standard_mapping_set_std_read,
3349 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3350 : },
3351 : {
3352 : .name = discard_const_p(char, "std_write"),
3353 : .get = py_standard_mapping_get_std_write,
3354 : .set = py_standard_mapping_set_std_write,
3355 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3356 : },
3357 : {
3358 : .name = discard_const_p(char, "std_execute"),
3359 : .get = py_standard_mapping_get_std_execute,
3360 : .set = py_standard_mapping_set_std_execute,
3361 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3362 : },
3363 : {
3364 : .name = discard_const_p(char, "std_all"),
3365 : .get = py_standard_mapping_get_std_all,
3366 : .set = py_standard_mapping_set_std_all,
3367 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3368 : },
3369 : { .name = NULL }
3370 : };
3371 :
3372 0 : static PyObject *py_standard_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3373 : {
3374 0 : return pytalloc_new(struct standard_mapping, type);
3375 : }
3376 :
3377 :
3378 : static PyTypeObject standard_mapping_Type = {
3379 : PyVarObject_HEAD_INIT(NULL, 0)
3380 : .tp_name = "security.standard_mapping",
3381 : .tp_getset = py_standard_mapping_getsetters,
3382 : .tp_methods = NULL,
3383 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3384 : .tp_new = py_standard_mapping_new,
3385 : };
3386 :
3387 :
3388 : const struct PyNdrRpcMethodDef py_ndr_security_methods[] = {
3389 : {0}
3390 : };
3391 :
3392 0 : static PyObject *interface_security_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3393 : {
3394 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_security);
3395 : }
3396 :
3397 : static PyTypeObject security_InterfaceType = {
3398 : PyVarObject_HEAD_INIT(NULL, 0)
3399 : .tp_name = "security.security",
3400 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
3401 : .tp_doc = "security(binding, lp_ctx=None, credentials=None) -> connection\n"
3402 : "\n"
3403 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
3404 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
3405 : "credentials should be a credentials.Credentials object.\n\n",
3406 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3407 : .tp_new = interface_security_new,
3408 : };
3409 :
3410 0 : static PyObject *syntax_security_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3411 : {
3412 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_security.syntax_id);
3413 : }
3414 :
3415 : static PyTypeObject security_SyntaxType = {
3416 : PyVarObject_HEAD_INIT(NULL, 0)
3417 : .tp_name = "security.security_abstract_syntax",
3418 : .tp_doc = "security_abstract_syntax()\n",
3419 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3420 : .tp_new = syntax_security_new,
3421 : };
3422 :
3423 : static PyMethodDef security_methods[] = {
3424 : { NULL, NULL, 0, NULL }
3425 : };
3426 :
3427 : static struct PyModuleDef moduledef = {
3428 : PyModuleDef_HEAD_INIT,
3429 : .m_name = "security",
3430 : .m_doc = "security DCE/RPC",
3431 : .m_size = -1,
3432 : .m_methods = security_methods,
3433 : };
3434 3562 : MODULE_INIT_FUNC(security)
3435 : {
3436 3562 : PyObject *m = NULL;
3437 3562 : PyObject *dep_samba_dcerpc_misc = NULL;
3438 3562 : PyObject *dep_talloc = NULL;
3439 3562 : PyObject *dep_samba_dcerpc_base = NULL;
3440 :
3441 3562 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
3442 3562 : if (dep_samba_dcerpc_misc == NULL)
3443 0 : goto out;
3444 :
3445 3562 : dep_talloc = PyImport_ImportModule("talloc");
3446 3562 : if (dep_talloc == NULL)
3447 0 : goto out;
3448 :
3449 3562 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
3450 3562 : if (dep_samba_dcerpc_base == NULL)
3451 0 : goto out;
3452 :
3453 3562 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
3454 3562 : if (BaseObject_Type == NULL)
3455 0 : goto out;
3456 :
3457 3562 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
3458 3562 : if (GUID_Type == NULL)
3459 0 : goto out;
3460 :
3461 3562 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
3462 3562 : if (ClientConnection_Type == NULL)
3463 0 : goto out;
3464 :
3465 3562 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
3466 3562 : if (ndr_syntax_id_Type == NULL)
3467 0 : goto out;
3468 :
3469 3562 : dom_sid_Type.tp_base = BaseObject_Type;
3470 3562 : dom_sid_Type.tp_basicsize = pytalloc_BaseObject_size();
3471 :
3472 3562 : security_ace_object_type_Type.tp_base = BaseObject_Type;
3473 3562 : security_ace_object_type_Type.tp_basicsize = pytalloc_BaseObject_size();
3474 :
3475 3562 : security_ace_object_inherited_type_Type.tp_base = BaseObject_Type;
3476 3562 : security_ace_object_inherited_type_Type.tp_basicsize = pytalloc_BaseObject_size();
3477 :
3478 3562 : security_ace_object_Type.tp_base = BaseObject_Type;
3479 3562 : security_ace_object_Type.tp_basicsize = pytalloc_BaseObject_size();
3480 :
3481 3562 : security_ace_object_ctr_Type.tp_base = BaseObject_Type;
3482 3562 : security_ace_object_ctr_Type.tp_basicsize = pytalloc_BaseObject_size();
3483 :
3484 3562 : security_ace_Type.tp_base = BaseObject_Type;
3485 3562 : security_ace_Type.tp_basicsize = pytalloc_BaseObject_size();
3486 :
3487 3562 : security_acl_Type.tp_base = BaseObject_Type;
3488 3562 : security_acl_Type.tp_basicsize = pytalloc_BaseObject_size();
3489 :
3490 3562 : security_descriptor_Type.tp_base = BaseObject_Type;
3491 3562 : security_descriptor_Type.tp_basicsize = pytalloc_BaseObject_size();
3492 :
3493 3562 : sec_desc_buf_Type.tp_base = BaseObject_Type;
3494 3562 : sec_desc_buf_Type.tp_basicsize = pytalloc_BaseObject_size();
3495 :
3496 3562 : security_token_Type.tp_base = BaseObject_Type;
3497 3562 : security_token_Type.tp_basicsize = pytalloc_BaseObject_size();
3498 :
3499 3562 : security_unix_token_Type.tp_base = BaseObject_Type;
3500 3562 : security_unix_token_Type.tp_basicsize = pytalloc_BaseObject_size();
3501 :
3502 3562 : LSAP_TOKEN_INFO_INTEGRITY_Type.tp_base = BaseObject_Type;
3503 3562 : LSAP_TOKEN_INFO_INTEGRITY_Type.tp_basicsize = pytalloc_BaseObject_size();
3504 :
3505 3562 : generic_mapping_Type.tp_base = BaseObject_Type;
3506 3562 : generic_mapping_Type.tp_basicsize = pytalloc_BaseObject_size();
3507 :
3508 3562 : standard_mapping_Type.tp_base = BaseObject_Type;
3509 3562 : standard_mapping_Type.tp_basicsize = pytalloc_BaseObject_size();
3510 :
3511 3562 : security_InterfaceType.tp_base = ClientConnection_Type;
3512 :
3513 3562 : security_SyntaxType.tp_base = ndr_syntax_id_Type;
3514 3562 : security_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
3515 :
3516 3562 : if (PyType_Ready(&dom_sid_Type) < 0)
3517 0 : goto out;
3518 3562 : if (PyType_Ready(&security_ace_object_type_Type) < 0)
3519 0 : goto out;
3520 3562 : if (PyType_Ready(&security_ace_object_inherited_type_Type) < 0)
3521 0 : goto out;
3522 3562 : if (PyType_Ready(&security_ace_object_Type) < 0)
3523 0 : goto out;
3524 3562 : if (PyType_Ready(&security_ace_object_ctr_Type) < 0)
3525 0 : goto out;
3526 3562 : if (PyType_Ready(&security_ace_Type) < 0)
3527 0 : goto out;
3528 3562 : if (PyType_Ready(&security_acl_Type) < 0)
3529 0 : goto out;
3530 3562 : if (PyType_Ready(&security_descriptor_Type) < 0)
3531 0 : goto out;
3532 3562 : if (PyType_Ready(&sec_desc_buf_Type) < 0)
3533 0 : goto out;
3534 3562 : if (PyType_Ready(&security_token_Type) < 0)
3535 0 : goto out;
3536 3562 : if (PyType_Ready(&security_unix_token_Type) < 0)
3537 0 : goto out;
3538 3562 : if (PyType_Ready(&LSAP_TOKEN_INFO_INTEGRITY_Type) < 0)
3539 0 : goto out;
3540 3562 : if (PyType_Ready(&generic_mapping_Type) < 0)
3541 0 : goto out;
3542 3562 : if (PyType_Ready(&standard_mapping_Type) < 0)
3543 0 : goto out;
3544 3562 : if (PyType_Ready(&security_InterfaceType) < 0)
3545 0 : goto out;
3546 3562 : if (PyType_Ready(&security_SyntaxType) < 0)
3547 0 : goto out;
3548 3562 : if (!PyInterface_AddNdrRpcMethods(&security_InterfaceType, py_ndr_security_methods))
3549 0 : return NULL;
3550 :
3551 : #ifdef PY_DOM_SID_PATCH
3552 3562 : PY_DOM_SID_PATCH(&dom_sid_Type);
3553 : #endif
3554 : #ifdef PY_ACE_OBJECT_TYPE_PATCH
3555 : PY_ACE_OBJECT_TYPE_PATCH(&security_ace_object_type_Type);
3556 : #endif
3557 : #ifdef PY_ACE_OBJECT_INHERITED_TYPE_PATCH
3558 : PY_ACE_OBJECT_INHERITED_TYPE_PATCH(&security_ace_object_inherited_type_Type);
3559 : #endif
3560 : #ifdef PY_ACE_OBJECT_PATCH
3561 : PY_ACE_OBJECT_PATCH(&security_ace_object_Type);
3562 : #endif
3563 : #ifdef PY_ACE_OBJECT_CTR_PATCH
3564 : PY_ACE_OBJECT_CTR_PATCH(&security_ace_object_ctr_Type);
3565 : #endif
3566 : #ifdef PY_ACE_PATCH
3567 : PY_ACE_PATCH(&security_ace_Type);
3568 : #endif
3569 : #ifdef PY_ACL_PATCH
3570 : PY_ACL_PATCH(&security_acl_Type);
3571 : #endif
3572 : #ifdef PY_DESCRIPTOR_PATCH
3573 3562 : PY_DESCRIPTOR_PATCH(&security_descriptor_Type);
3574 : #endif
3575 : #ifdef PY_SEC_DESC_BUF_PATCH
3576 : PY_SEC_DESC_BUF_PATCH(&sec_desc_buf_Type);
3577 : #endif
3578 : #ifdef PY_TOKEN_PATCH
3579 3562 : PY_TOKEN_PATCH(&security_token_Type);
3580 : #endif
3581 : #ifdef PY_UNIX_TOKEN_PATCH
3582 : PY_UNIX_TOKEN_PATCH(&security_unix_token_Type);
3583 : #endif
3584 : #ifdef PY_LSAP_TOKEN_INFO_INTEGRITY_PATCH
3585 : PY_LSAP_TOKEN_INFO_INTEGRITY_PATCH(&LSAP_TOKEN_INFO_INTEGRITY_Type);
3586 : #endif
3587 : #ifdef PY_GENERIC_MAPPING_PATCH
3588 : PY_GENERIC_MAPPING_PATCH(&generic_mapping_Type);
3589 : #endif
3590 : #ifdef PY_STANDARD_MAPPING_PATCH
3591 : PY_STANDARD_MAPPING_PATCH(&standard_mapping_Type);
3592 : #endif
3593 : #ifdef PY_SECURITY_PATCH
3594 : PY_SECURITY_PATCH(&security_InterfaceType);
3595 : #endif
3596 : #ifdef PY_SECURITY_ABSTRACT_SYNTAX_PATCH
3597 : PY_SECURITY_ABSTRACT_SYNTAX_PATCH(&security_SyntaxType);
3598 : #endif
3599 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
3600 : PY_ABSTRACT_SYNTAX_PATCH(&security_SyntaxType);
3601 : #endif
3602 :
3603 3562 : m = PyModule_Create(&moduledef);
3604 3562 : if (m == NULL)
3605 0 : goto out;
3606 :
3607 3562 : PyModule_AddObject(m, "SEC_MASK_GENERIC", PyLong_FromUnsignedLongLong(0xF0000000));
3608 3562 : PyModule_AddObject(m, "SEC_MASK_FLAGS", PyLong_FromUnsignedLongLong(0x0F000000));
3609 3562 : PyModule_AddObject(m, "SEC_MASK_STANDARD", PyLong_FromUnsignedLongLong(0x00FF0000));
3610 3562 : PyModule_AddObject(m, "SEC_MASK_SPECIFIC", PyLong_FromUnsignedLongLong(0x0000FFFF));
3611 3562 : PyModule_AddObject(m, "SEC_GENERIC_ALL", PyLong_FromUnsignedLongLong(0x10000000));
3612 3562 : PyModule_AddObject(m, "SEC_GENERIC_EXECUTE", PyLong_FromUnsignedLongLong(0x20000000));
3613 3562 : PyModule_AddObject(m, "SEC_GENERIC_WRITE", PyLong_FromUnsignedLongLong(0x40000000));
3614 3562 : PyModule_AddObject(m, "SEC_GENERIC_READ", PyLong_FromUnsignedLongLong(0x80000000));
3615 3562 : PyModule_AddObject(m, "SEC_FLAG_SYSTEM_SECURITY", PyLong_FromUnsignedLongLong(0x01000000));
3616 3562 : PyModule_AddObject(m, "SEC_FLAG_MAXIMUM_ALLOWED", PyLong_FromUnsignedLongLong(0x02000000));
3617 3562 : PyModule_AddObject(m, "SEC_STD_DELETE", PyLong_FromUnsignedLongLong(0x00010000));
3618 3562 : PyModule_AddObject(m, "SEC_STD_READ_CONTROL", PyLong_FromUnsignedLongLong(0x00020000));
3619 3562 : PyModule_AddObject(m, "SEC_STD_WRITE_DAC", PyLong_FromUnsignedLongLong(0x00040000));
3620 3562 : PyModule_AddObject(m, "SEC_STD_WRITE_OWNER", PyLong_FromUnsignedLongLong(0x00080000));
3621 3562 : PyModule_AddObject(m, "SEC_STD_SYNCHRONIZE", PyLong_FromUnsignedLongLong(0x00100000));
3622 3562 : PyModule_AddObject(m, "SEC_STD_REQUIRED", PyLong_FromUnsignedLongLong(0x000F0000));
3623 3562 : PyModule_AddObject(m, "SEC_STD_ALL", PyLong_FromUnsignedLongLong(0x001F0000));
3624 3562 : PyModule_AddObject(m, "SEC_FILE_READ_DATA", PyLong_FromUnsignedLongLong(0x00000001));
3625 3562 : PyModule_AddObject(m, "SEC_FILE_WRITE_DATA", PyLong_FromUnsignedLongLong(0x00000002));
3626 3562 : PyModule_AddObject(m, "SEC_FILE_APPEND_DATA", PyLong_FromUnsignedLongLong(0x00000004));
3627 3562 : PyModule_AddObject(m, "SEC_FILE_READ_EA", PyLong_FromUnsignedLongLong(0x00000008));
3628 3562 : PyModule_AddObject(m, "SEC_FILE_WRITE_EA", PyLong_FromUnsignedLongLong(0x00000010));
3629 3562 : PyModule_AddObject(m, "SEC_FILE_EXECUTE", PyLong_FromUnsignedLongLong(0x00000020));
3630 3562 : PyModule_AddObject(m, "SEC_FILE_READ_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000080));
3631 3562 : PyModule_AddObject(m, "SEC_FILE_WRITE_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000100));
3632 3562 : PyModule_AddObject(m, "SEC_FILE_ALL", PyLong_FromUnsignedLongLong(0x000001ff));
3633 3562 : PyModule_AddObject(m, "SEC_DIR_LIST", PyLong_FromUnsignedLongLong(0x00000001));
3634 3562 : PyModule_AddObject(m, "SEC_DIR_ADD_FILE", PyLong_FromUnsignedLongLong(0x00000002));
3635 3562 : PyModule_AddObject(m, "SEC_DIR_ADD_SUBDIR", PyLong_FromUnsignedLongLong(0x00000004));
3636 3562 : PyModule_AddObject(m, "SEC_DIR_READ_EA", PyLong_FromUnsignedLongLong(0x00000008));
3637 3562 : PyModule_AddObject(m, "SEC_DIR_WRITE_EA", PyLong_FromUnsignedLongLong(0x00000010));
3638 3562 : PyModule_AddObject(m, "SEC_DIR_TRAVERSE", PyLong_FromUnsignedLongLong(0x00000020));
3639 3562 : PyModule_AddObject(m, "SEC_DIR_DELETE_CHILD", PyLong_FromUnsignedLongLong(0x00000040));
3640 3562 : PyModule_AddObject(m, "SEC_DIR_READ_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000080));
3641 3562 : PyModule_AddObject(m, "SEC_DIR_WRITE_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000100));
3642 3562 : PyModule_AddObject(m, "SEC_REG_QUERY_VALUE", PyLong_FromUnsignedLongLong(0x00000001));
3643 3562 : PyModule_AddObject(m, "SEC_REG_SET_VALUE", PyLong_FromUnsignedLongLong(0x00000002));
3644 3562 : PyModule_AddObject(m, "SEC_REG_CREATE_SUBKEY", PyLong_FromUnsignedLongLong(0x00000004));
3645 3562 : PyModule_AddObject(m, "SEC_REG_ENUM_SUBKEYS", PyLong_FromUnsignedLongLong(0x00000008));
3646 3562 : PyModule_AddObject(m, "SEC_REG_NOTIFY", PyLong_FromUnsignedLongLong(0x00000010));
3647 3562 : PyModule_AddObject(m, "SEC_REG_CREATE_LINK", PyLong_FromUnsignedLongLong(0x00000020));
3648 3562 : PyModule_AddObject(m, "SEC_ADS_CREATE_CHILD", PyLong_FromUnsignedLongLong(0x00000001));
3649 3562 : PyModule_AddObject(m, "SEC_ADS_DELETE_CHILD", PyLong_FromUnsignedLongLong(0x00000002));
3650 3562 : PyModule_AddObject(m, "SEC_ADS_LIST", PyLong_FromUnsignedLongLong(0x00000004));
3651 3562 : PyModule_AddObject(m, "SEC_ADS_SELF_WRITE", PyLong_FromUnsignedLongLong(0x00000008));
3652 3562 : PyModule_AddObject(m, "SEC_ADS_READ_PROP", PyLong_FromUnsignedLongLong(0x00000010));
3653 3562 : PyModule_AddObject(m, "SEC_ADS_WRITE_PROP", PyLong_FromUnsignedLongLong(0x00000020));
3654 3562 : PyModule_AddObject(m, "SEC_ADS_DELETE_TREE", PyLong_FromUnsignedLongLong(0x00000040));
3655 3562 : PyModule_AddObject(m, "SEC_ADS_LIST_OBJECT", PyLong_FromUnsignedLongLong(0x00000080));
3656 3562 : PyModule_AddObject(m, "SEC_ADS_CONTROL_ACCESS", PyLong_FromUnsignedLongLong(0x00000100));
3657 3562 : PyModule_AddObject(m, "SEC_MASK_INVALID", PyLong_FromUnsignedLongLong(0x0ce0fe00));
3658 3562 : 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));
3659 3562 : 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));
3660 3562 : PyModule_AddObject(m, "SEC_RIGHTS_FILE_EXECUTE", PyLong_FromLong(SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE));
3661 3562 : PyModule_AddObject(m, "SEC_RIGHTS_FILE_ALL", PyLong_FromLong(SEC_STD_ALL|SEC_FILE_ALL));
3662 3562 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_READ", PyLong_FromLong(SEC_RIGHTS_FILE_READ));
3663 3562 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_WRITE", PyLong_FromLong(SEC_RIGHTS_FILE_WRITE));
3664 3562 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_EXECUTE", PyLong_FromLong(SEC_RIGHTS_FILE_EXECUTE));
3665 3562 : PyModule_AddObject(m, "SEC_RIGHTS_DIR_ALL", PyLong_FromLong(SEC_RIGHTS_FILE_ALL));
3666 3562 : PyModule_AddObject(m, "SEC_RIGHTS_PRIV_BACKUP", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_FLAG_SYSTEM_SECURITY|SEC_RIGHTS_FILE_READ|SEC_DIR_TRAVERSE));
3667 3562 : 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));
3668 3562 : PyModule_AddObject(m, "STANDARD_RIGHTS_ALL_ACCESS", PyLong_FromLong(SEC_STD_ALL));
3669 3562 : PyModule_AddObject(m, "STANDARD_RIGHTS_MODIFY_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
3670 3562 : PyModule_AddObject(m, "STANDARD_RIGHTS_EXECUTE_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
3671 3562 : PyModule_AddObject(m, "STANDARD_RIGHTS_READ_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
3672 3562 : PyModule_AddObject(m, "STANDARD_RIGHTS_WRITE_ACCESS", PyLong_FromLong((SEC_STD_WRITE_OWNER|SEC_STD_WRITE_DAC|SEC_STD_DELETE)));
3673 3562 : PyModule_AddObject(m, "STANDARD_RIGHTS_REQUIRED_ACCESS", PyLong_FromLong((SEC_STD_DELETE|SEC_STD_READ_CONTROL|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER)));
3674 3562 : 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)));
3675 3562 : PyModule_AddObject(m, "SEC_ADS_GENERIC_EXECUTE", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_ADS_LIST));
3676 3562 : PyModule_AddObject(m, "SEC_ADS_GENERIC_WRITE", PyLong_FromLong((SEC_STD_READ_CONTROL|SEC_ADS_SELF_WRITE|SEC_ADS_WRITE_PROP)));
3677 3562 : PyModule_AddObject(m, "SEC_ADS_GENERIC_READ", PyLong_FromLong((SEC_STD_READ_CONTROL|SEC_ADS_LIST|SEC_ADS_READ_PROP|SEC_ADS_LIST_OBJECT)));
3678 3562 : 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)));
3679 3562 : PyModule_AddObject(m, "SID_NULL", PyUnicode_FromString("S-1-0-0"));
3680 3562 : PyModule_AddObject(m, "NAME_WORLD", PyUnicode_FromString("WORLD"));
3681 3562 : PyModule_AddObject(m, "SID_WORLD_DOMAIN", PyUnicode_FromString("S-1-1"));
3682 3562 : PyModule_AddObject(m, "SID_WORLD", PyUnicode_FromString("S-1-1-0"));
3683 3562 : PyModule_AddObject(m, "SID_CREATOR_OWNER_DOMAIN", PyUnicode_FromString("S-1-3"));
3684 3562 : PyModule_AddObject(m, "SID_CREATOR_OWNER", PyUnicode_FromString("S-1-3-0"));
3685 3562 : PyModule_AddObject(m, "SID_CREATOR_GROUP", PyUnicode_FromString("S-1-3-1"));
3686 3562 : PyModule_AddObject(m, "SID_OWNER_RIGHTS", PyUnicode_FromString("S-1-3-4"));
3687 3562 : PyModule_AddObject(m, "NAME_NT_AUTHORITY", PyUnicode_FromString("NT AUTHORITY"));
3688 3562 : PyModule_AddObject(m, "SID_NT_AUTHORITY", PyUnicode_FromString("S-1-5"));
3689 3562 : PyModule_AddObject(m, "SID_NT_DIALUP", PyUnicode_FromString("S-1-5-1"));
3690 3562 : PyModule_AddObject(m, "SID_NT_NETWORK", PyUnicode_FromString("S-1-5-2"));
3691 3562 : PyModule_AddObject(m, "SID_NT_BATCH", PyUnicode_FromString("S-1-5-3"));
3692 3562 : PyModule_AddObject(m, "SID_NT_INTERACTIVE", PyUnicode_FromString("S-1-5-4"));
3693 3562 : PyModule_AddObject(m, "SID_NT_SERVICE", PyUnicode_FromString("S-1-5-6"));
3694 3562 : PyModule_AddObject(m, "SID_NT_ANONYMOUS", PyUnicode_FromString("S-1-5-7"));
3695 3562 : PyModule_AddObject(m, "SID_NT_PROXY", PyUnicode_FromString("S-1-5-8"));
3696 3562 : PyModule_AddObject(m, "SID_NT_ENTERPRISE_DCS", PyUnicode_FromString("S-1-5-9"));
3697 3562 : PyModule_AddObject(m, "SID_NT_SELF", PyUnicode_FromString("S-1-5-10"));
3698 3562 : PyModule_AddObject(m, "SID_NT_AUTHENTICATED_USERS", PyUnicode_FromString("S-1-5-11"));
3699 3562 : PyModule_AddObject(m, "SID_NT_RESTRICTED", PyUnicode_FromString("S-1-5-12"));
3700 3562 : PyModule_AddObject(m, "SID_NT_TERMINAL_SERVER_USERS", PyUnicode_FromString("S-1-5-13"));
3701 3562 : PyModule_AddObject(m, "SID_NT_REMOTE_INTERACTIVE", PyUnicode_FromString("S-1-5-14"));
3702 3562 : PyModule_AddObject(m, "SID_NT_THIS_ORGANISATION", PyUnicode_FromString("S-1-5-15"));
3703 3562 : PyModule_AddObject(m, "SID_NT_IUSR", PyUnicode_FromString("S-1-5-17"));
3704 3562 : PyModule_AddObject(m, "SID_NT_SYSTEM", PyUnicode_FromString("S-1-5-18"));
3705 3562 : PyModule_AddObject(m, "SID_NT_LOCAL_SERVICE", PyUnicode_FromString("S-1-5-19"));
3706 3562 : PyModule_AddObject(m, "SID_NT_NETWORK_SERVICE", PyUnicode_FromString("S-1-5-20"));
3707 3562 : PyModule_AddObject(m, "SID_NT_DIGEST_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-21"));
3708 3562 : PyModule_AddObject(m, "SID_NT_NTLM_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-10"));
3709 3562 : PyModule_AddObject(m, "SID_NT_SCHANNEL_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-14"));
3710 3562 : PyModule_AddObject(m, "SID_NT_OTHER_ORGANISATION", PyUnicode_FromString("S-1-5-1000"));
3711 3562 : PyModule_AddObject(m, "NAME_BUILTIN", PyUnicode_FromString("BUILTIN"));
3712 3562 : PyModule_AddObject(m, "SID_BUILTIN", PyUnicode_FromString("S-1-5-32"));
3713 3562 : PyModule_AddObject(m, "SID_BUILTIN_ADMINISTRATORS", PyUnicode_FromString("S-1-5-32-544"));
3714 3562 : PyModule_AddObject(m, "SID_BUILTIN_USERS", PyUnicode_FromString("S-1-5-32-545"));
3715 3562 : PyModule_AddObject(m, "SID_BUILTIN_GUESTS", PyUnicode_FromString("S-1-5-32-546"));
3716 3562 : PyModule_AddObject(m, "SID_BUILTIN_POWER_USERS", PyUnicode_FromString("S-1-5-32-547"));
3717 3562 : PyModule_AddObject(m, "SID_BUILTIN_ACCOUNT_OPERATORS", PyUnicode_FromString("S-1-5-32-548"));
3718 3562 : PyModule_AddObject(m, "SID_BUILTIN_SERVER_OPERATORS", PyUnicode_FromString("S-1-5-32-549"));
3719 3562 : PyModule_AddObject(m, "SID_BUILTIN_PRINT_OPERATORS", PyUnicode_FromString("S-1-5-32-550"));
3720 3562 : PyModule_AddObject(m, "SID_BUILTIN_BACKUP_OPERATORS", PyUnicode_FromString("S-1-5-32-551"));
3721 3562 : PyModule_AddObject(m, "SID_BUILTIN_REPLICATOR", PyUnicode_FromString("S-1-5-32-552"));
3722 3562 : PyModule_AddObject(m, "SID_BUILTIN_RAS_SERVERS", PyUnicode_FromString("S-1-5-32-553"));
3723 3562 : PyModule_AddObject(m, "SID_BUILTIN_PREW2K", PyUnicode_FromString("S-1-5-32-554"));
3724 3562 : PyModule_AddObject(m, "SID_BUILTIN_REMOTE_DESKTOP_USERS", PyUnicode_FromString("S-1-5-32-555"));
3725 3562 : PyModule_AddObject(m, "SID_BUILTIN_NETWORK_CONF_OPERATORS", PyUnicode_FromString("S-1-5-32-556"));
3726 3562 : PyModule_AddObject(m, "SID_BUILTIN_INCOMING_FOREST_TRUST", PyUnicode_FromString("S-1-5-32-557"));
3727 3562 : PyModule_AddObject(m, "SID_BUILTIN_PERFMON_USERS", PyUnicode_FromString("S-1-5-32-558"));
3728 3562 : PyModule_AddObject(m, "SID_BUILTIN_PERFLOG_USERS", PyUnicode_FromString("S-1-5-32-559"));
3729 3562 : PyModule_AddObject(m, "SID_BUILTIN_AUTH_ACCESS", PyUnicode_FromString("S-1-5-32-560"));
3730 3562 : PyModule_AddObject(m, "SID_BUILTIN_TS_LICENSE_SERVERS", PyUnicode_FromString("S-1-5-32-561"));
3731 3562 : PyModule_AddObject(m, "SID_BUILTIN_DISTRIBUTED_COM_USERS", PyUnicode_FromString("S-1-5-32-562"));
3732 3562 : PyModule_AddObject(m, "SID_BUILTIN_IUSERS", PyUnicode_FromString("S-1-5-32-568"));
3733 3562 : PyModule_AddObject(m, "SID_BUILTIN_CRYPTO_OPERATORS", PyUnicode_FromString("S-1-5-32-569"));
3734 3562 : PyModule_AddObject(m, "SID_BUILTIN_EVENT_LOG_READERS", PyUnicode_FromString("S-1-5-32-573"));
3735 3562 : PyModule_AddObject(m, "SID_BUILTIN_CERT_SERV_DCOM_ACCESS", PyUnicode_FromString("S-1-5-32-574"));
3736 3562 : PyModule_AddObject(m, "SID_BUILTIN_RDS_REMOTE_ACCESS_SERVERS", PyUnicode_FromString("S-1-5-32-575"));
3737 3562 : PyModule_AddObject(m, "SID_BUILTIN_RDS_ENDPOINT_SERVERS", PyUnicode_FromString("S-1-5-32-576"));
3738 3562 : PyModule_AddObject(m, "SID_BUILTIN_RDS_MANAGEMENT_SERVERS", PyUnicode_FromString("S-1-5-32-577"));
3739 3562 : PyModule_AddObject(m, "SID_BUILTIN_HYPER_V_ADMINS", PyUnicode_FromString("S-1-5-32-578"));
3740 3562 : PyModule_AddObject(m, "SID_BUILTIN_ACCESS_CONTROL_ASSISTANCE_OPS", PyUnicode_FromString("S-1-5-32-579"));
3741 3562 : PyModule_AddObject(m, "SID_BUILTIN_REMOTE_MANAGEMENT_USERS", PyUnicode_FromString("S-1-5-32-580"));
3742 3562 : PyModule_AddObject(m, "SID_BUILTIN_SYSTEM_MANAGED_ACCOUNTS_GRP", PyUnicode_FromString("S-1-5-32-581"));
3743 3562 : PyModule_AddObject(m, "SID_BUILTIN_STORAGE_REPLICA_ADMINISTRATORS", PyUnicode_FromString("S-1-5-32-582"));
3744 3562 : PyModule_AddObject(m, "SID_SECURITY_RESTRICTED_CODE", PyUnicode_FromString("S-1-5-33"));
3745 3562 : PyModule_AddObject(m, "SID_SAMBA_UNIX_USER_OWNER", PyUnicode_FromString("S-1-22-1"));
3746 3562 : PyModule_AddObject(m, "SID_SAMBA_UNIX_GROUP_OWNER", PyUnicode_FromString("S-1-22-2"));
3747 3562 : PyModule_AddObject(m, "NAME_NT_SERVICE", PyUnicode_FromString("NT SERVICE"));
3748 3562 : PyModule_AddObject(m, "SID_NT_NT_SERVICE", PyUnicode_FromString("S-1-5-80"));
3749 3562 : PyModule_AddObject(m, "SID_NT_TRUSTED_INSTALLER", PyUnicode_FromString("S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464"));
3750 3562 : PyModule_AddObject(m, "SID_AUTHENTICATION_AUTHORITY_ASSERTED_IDENTITY", PyUnicode_FromString("S-1-18-1"));
3751 3562 : PyModule_AddObject(m, "SID_SERVICE_ASSERTED_IDENTITY", PyUnicode_FromString("S-1-18-2"));
3752 3562 : PyModule_AddObject(m, "SID_COMPOUNDED_AUTHENTICATION", PyUnicode_FromString("S-1-5-21-0-0-0-496"));
3753 3562 : PyModule_AddObject(m, "SID_CLAIMS_VALID", PyUnicode_FromString("S-1-5-21-0-0-0-497"));
3754 3562 : PyModule_AddObject(m, "SID_USER_MODE_DRIVERS", PyUnicode_FromString("S-1-5-84-0-0-0-0-0"));
3755 3562 : PyModule_AddObject(m, "SID_SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE", PyUnicode_FromString("S-1-15-2-1"));
3756 3562 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_LOW", PyUnicode_FromString("S-1-16-4096"));
3757 3562 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_MEDIUM", PyUnicode_FromString("S-1-16-8192"));
3758 3562 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_MEDIUM_PLUS", PyUnicode_FromString("S-1-16-8448"));
3759 3562 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_HIGH", PyUnicode_FromString("S-1-16-12288"));
3760 3562 : PyModule_AddObject(m, "SID_SECURITY_MANDATORY_SYSTEM", PyUnicode_FromString("S-1-16-16384"));
3761 3562 : PyModule_AddObject(m, "SID_NT_NFS_SUBSYSTEM", PyUnicode_FromString("S-1-5-88"));
3762 3562 : PyModule_AddObject(m, "SID_NT_NFS_USER", PyUnicode_FromString("S-1-5-88-1"));
3763 3562 : PyModule_AddObject(m, "SID_NT_NFS_GROUP", PyUnicode_FromString("S-1-5-88-2"));
3764 3562 : PyModule_AddObject(m, "SID_NT_NFS_MASK", PyUnicode_FromString("S-1-5-88-3"));
3765 3562 : PyModule_AddObject(m, "SID_NT_NFS_OTHERS", PyUnicode_FromString("S-1-5-88-4"));
3766 3562 : PyModule_AddObject(m, "DOMAIN_RID_LOGON", PyLong_FromUnsignedLongLong(9));
3767 3562 : PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_READONLY_DCS", PyLong_FromUnsignedLongLong(498));
3768 3562 : PyModule_AddObject(m, "DOMAIN_RID_ADMINISTRATOR", PyLong_FromUnsignedLongLong(500));
3769 3562 : PyModule_AddObject(m, "DOMAIN_RID_GUEST", PyLong_FromUnsignedLongLong(501));
3770 3562 : PyModule_AddObject(m, "DOMAIN_RID_KRBTGT", PyLong_FromUnsignedLongLong(502));
3771 3562 : PyModule_AddObject(m, "DOMAIN_RID_ADMINS", PyLong_FromUnsignedLongLong(512));
3772 3562 : PyModule_AddObject(m, "DOMAIN_RID_USERS", PyLong_FromUnsignedLongLong(513));
3773 3562 : PyModule_AddObject(m, "DOMAIN_RID_GUESTS", PyLong_FromUnsignedLongLong(514));
3774 3562 : PyModule_AddObject(m, "DOMAIN_RID_DOMAIN_MEMBERS", PyLong_FromUnsignedLongLong(515));
3775 3562 : PyModule_AddObject(m, "DOMAIN_RID_DCS", PyLong_FromUnsignedLongLong(516));
3776 3562 : PyModule_AddObject(m, "DOMAIN_RID_CERT_ADMINS", PyLong_FromUnsignedLongLong(517));
3777 3562 : PyModule_AddObject(m, "DOMAIN_RID_SCHEMA_ADMINS", PyLong_FromUnsignedLongLong(518));
3778 3562 : PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_ADMINS", PyLong_FromUnsignedLongLong(519));
3779 3562 : PyModule_AddObject(m, "DOMAIN_RID_POLICY_ADMINS", PyLong_FromUnsignedLongLong(520));
3780 3562 : PyModule_AddObject(m, "DOMAIN_RID_READONLY_DCS", PyLong_FromUnsignedLongLong(521));
3781 3562 : PyModule_AddObject(m, "DOMAIN_RID_CLONEABLE_CONTROLLERS", PyLong_FromUnsignedLongLong(522));
3782 3562 : PyModule_AddObject(m, "DOMAIN_RID_PROTECTED_USERS", PyLong_FromUnsignedLongLong(525));
3783 3562 : PyModule_AddObject(m, "DOMAIN_RID_KEY_ADMINS", PyLong_FromUnsignedLongLong(526));
3784 3562 : PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_KEY_ADMINS", PyLong_FromUnsignedLongLong(527));
3785 3562 : PyModule_AddObject(m, "DOMAIN_RID_RAS_SERVERS", PyLong_FromUnsignedLongLong(553));
3786 3562 : PyModule_AddObject(m, "DOMAIN_RID_RODC_ALLOW", PyLong_FromUnsignedLongLong(571));
3787 3562 : PyModule_AddObject(m, "DOMAIN_RID_RODC_DENY", PyLong_FromUnsignedLongLong(572));
3788 3562 : PyModule_AddObject(m, "BUILTIN_RID_ADMINISTRATORS", PyLong_FromUnsignedLongLong(544));
3789 3562 : PyModule_AddObject(m, "BUILTIN_RID_USERS", PyLong_FromUnsignedLongLong(545));
3790 3562 : PyModule_AddObject(m, "BUILTIN_RID_GUESTS", PyLong_FromUnsignedLongLong(546));
3791 3562 : PyModule_AddObject(m, "BUILTIN_RID_POWER_USERS", PyLong_FromUnsignedLongLong(547));
3792 3562 : PyModule_AddObject(m, "BUILTIN_RID_ACCOUNT_OPERATORS", PyLong_FromUnsignedLongLong(548));
3793 3562 : PyModule_AddObject(m, "BUILTIN_RID_SERVER_OPERATORS", PyLong_FromUnsignedLongLong(549));
3794 3562 : PyModule_AddObject(m, "BUILTIN_RID_PRINT_OPERATORS", PyLong_FromUnsignedLongLong(550));
3795 3562 : PyModule_AddObject(m, "BUILTIN_RID_BACKUP_OPERATORS", PyLong_FromUnsignedLongLong(551));
3796 3562 : PyModule_AddObject(m, "BUILTIN_RID_REPLICATOR", PyLong_FromUnsignedLongLong(552));
3797 3562 : PyModule_AddObject(m, "BUILTIN_RID_RAS_SERVERS", PyLong_FromUnsignedLongLong(553));
3798 3562 : PyModule_AddObject(m, "BUILTIN_RID_PRE_2K_ACCESS", PyLong_FromUnsignedLongLong(554));
3799 3562 : PyModule_AddObject(m, "BUILTIN_RID_REMOTE_DESKTOP_USERS", PyLong_FromUnsignedLongLong(555));
3800 3562 : PyModule_AddObject(m, "BUILTIN_RID_NETWORK_CONF_OPERATORS", PyLong_FromUnsignedLongLong(556));
3801 3562 : PyModule_AddObject(m, "BUILTIN_RID_INCOMING_FOREST_TRUST", PyLong_FromUnsignedLongLong(557));
3802 3562 : PyModule_AddObject(m, "BUILTIN_RID_PERFMON_USERS", PyLong_FromUnsignedLongLong(558));
3803 3562 : PyModule_AddObject(m, "BUILTIN_RID_PERFLOG_USERS", PyLong_FromUnsignedLongLong(559));
3804 3562 : PyModule_AddObject(m, "BUILTIN_RID_AUTH_ACCESS", PyLong_FromUnsignedLongLong(560));
3805 3562 : PyModule_AddObject(m, "BUILTIN_RID_TS_LICENSE_SERVERS", PyLong_FromUnsignedLongLong(561));
3806 3562 : PyModule_AddObject(m, "BUILTIN_RID_DISTRIBUTED_COM_USERS", PyLong_FromUnsignedLongLong(562));
3807 3562 : PyModule_AddObject(m, "BUILTIN_RID_IUSERS", PyLong_FromUnsignedLongLong(568));
3808 3562 : PyModule_AddObject(m, "BUILTIN_RID_CRYPTO_OPERATORS", PyLong_FromUnsignedLongLong(569));
3809 3562 : PyModule_AddObject(m, "BUILTIN_RID_EVENT_LOG_READERS", PyLong_FromUnsignedLongLong(573));
3810 3562 : PyModule_AddObject(m, "BUILTIN_RID_CERT_SERV_DCOM_ACCESS", PyLong_FromUnsignedLongLong(574));
3811 3562 : PyModule_AddObject(m, "BUILTIN_RID_RDS_REMOTE_ACCESS_SERVERS", PyLong_FromUnsignedLongLong(575));
3812 3562 : PyModule_AddObject(m, "BUILTIN_RID_RDS_ENDPOINT_SERVERS", PyLong_FromUnsignedLongLong(576));
3813 3562 : PyModule_AddObject(m, "BUILTIN_RID_RDS_MANAGEMENT_SERVERS", PyLong_FromUnsignedLongLong(577));
3814 3562 : PyModule_AddObject(m, "BUILTIN_RID_HYPER_V_ADMINS", PyLong_FromUnsignedLongLong(578));
3815 3562 : PyModule_AddObject(m, "BUILTIN_RID_ACCESS_CONTROL_ASSISTANCE_OPS", PyLong_FromUnsignedLongLong(579));
3816 3562 : PyModule_AddObject(m, "BUILTIN_RID_REMOTE_MANAGEMENT_USERS", PyLong_FromUnsignedLongLong(580));
3817 3562 : PyModule_AddObject(m, "NT4_ACL_REVISION", PyLong_FromUnsignedLongLong((uint32_t)SECURITY_ACL_REVISION_NT4));
3818 3562 : PyModule_AddObject(m, "SD_REVISION", PyLong_FromLong(SECURITY_DESCRIPTOR_REVISION_1));
3819 3562 : 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)));
3820 3562 : PyModule_AddObject(m, "GUID_DRS_ALLOCATE_RIDS", PyUnicode_FromString("1abd7cf8-0a99-11d1-adbb-00c04fd8d5cd"));
3821 3562 : PyModule_AddObject(m, "GUID_DRS_CHANGE_DOMAIN_MASTER", PyUnicode_FromString("014bf69c-7b3b-11d1-85f6-08002be74fab"));
3822 3562 : PyModule_AddObject(m, "GUID_DRS_CHANGE_INFR_MASTER", PyUnicode_FromString("cc17b1fb-33d9-11d2-97d4-00c04fd8d5cd"));
3823 3562 : PyModule_AddObject(m, "GUID_DRS_CHANGE_PDC", PyUnicode_FromString("bae50096-4752-11d1-9052-00c04fc2d4cf"));
3824 3562 : PyModule_AddObject(m, "GUID_DRS_CHANGE_RID_MASTER", PyUnicode_FromString("d58d5f36-0a98-11d1-adbb-00c04fd8d5cd"));
3825 3562 : PyModule_AddObject(m, "GUID_DRS_CHANGE_SCHEMA_MASTER", PyUnicode_FromString("e12b56b6-0a95-11d1-adbb-00c04fd8d5cd"));
3826 3562 : PyModule_AddObject(m, "GUID_DRS_GET_CHANGES", PyUnicode_FromString("1131f6aa-9c07-11d1-f79f-00c04fc2dcd2"));
3827 3562 : PyModule_AddObject(m, "GUID_DRS_REPL_SYNCRONIZE", PyUnicode_FromString("1131f6ab-9c07-11d1-f79f-00c04fc2dcd2"));
3828 3562 : PyModule_AddObject(m, "GUID_DRS_MANAGE_TOPOLOGY", PyUnicode_FromString("1131f6ac-9c07-11d1-f79f-00c04fc2dcd2"));
3829 3562 : PyModule_AddObject(m, "GUID_DRS_GET_ALL_CHANGES", PyUnicode_FromString("1131f6ad-9c07-11d1-f79f-00c04fc2dcd2"));
3830 3562 : PyModule_AddObject(m, "GUID_DRS_RO_REPL_SECRET_SYNC", PyUnicode_FromString("1131f6ae-9c07-11d1-f79f-00c04fc2dcd2"));
3831 3562 : PyModule_AddObject(m, "GUID_DRS_GET_FILTERED_ATTRIBUTES", PyUnicode_FromString("89e95b76-444d-4c62-991a-0facbeda640c"));
3832 3562 : PyModule_AddObject(m, "GUID_DRS_MONITOR_TOPOLOGY", PyUnicode_FromString("f98340fb-7c5b-4cdb-a00b-2ebdfa115a96"));
3833 3562 : PyModule_AddObject(m, "GUID_DRS_USER_CHANGE_PASSWORD", PyUnicode_FromString("ab721a53-1e2f-11d0-9819-00aa0040529b"));
3834 3562 : PyModule_AddObject(m, "GUID_DRS_FORCE_CHANGE_PASSWORD", PyUnicode_FromString("00299570-246d-11d0-a768-00aa006e0529"));
3835 3562 : PyModule_AddObject(m, "GUID_DRS_UPDATE_PASSWORD_NOT_REQUIRED_BIT", PyUnicode_FromString("280f369c-67c7-438e-ae98-1d46f3c6f541"));
3836 3562 : PyModule_AddObject(m, "GUID_DRS_UNEXPIRE_PASSWORD", PyUnicode_FromString("ccc2dc7d-a6ad-4a7a-8846-c04e3cc53501"));
3837 3562 : PyModule_AddObject(m, "GUID_DRS_ENABLE_PER_USER_REVERSIBLY_ENCRYPTED_PASSWORD", PyUnicode_FromString("05c74c5e-4deb-43b4-bd9f-86664c2a7fd5"));
3838 3562 : PyModule_AddObject(m, "GUID_DRS_DS_INSTALL_REPLICA", PyUnicode_FromString("9923a32a-3607-11d2-b9be-0000f87a36b2"));
3839 3562 : PyModule_AddObject(m, "GUID_DRS_REANIMATE_TOMBSTONE", PyUnicode_FromString("45ec5156-db7e-47bb-b53f-dbeb2d03c40f"));
3840 3562 : PyModule_AddObject(m, "GUID_DRS_ALLOWED_TO_AUTHENTICATE", PyUnicode_FromString("68b1d179-0d15-4D4F-ab71-46152e79a7bc"));
3841 3562 : PyModule_AddObject(m, "GUID_DRS_VALIDATE_SPN", PyUnicode_FromString("f3a64788-5306-11d1-a9c5-0000f80367c1"));
3842 3562 : PyModule_AddObject(m, "GUID_DRS_SELF_MEMBERSHIP", PyUnicode_FromString("bf9679c0-0de6-11d0-a285-00aa003049e2"));
3843 3562 : PyModule_AddObject(m, "GUID_DRS_DNS_HOST_NAME", PyUnicode_FromString("72e39547-7b18-11d1-adef-00c04fd8d5cd"));
3844 3562 : PyModule_AddObject(m, "GUID_DRS_ADD_DNS_HOST_NAME", PyUnicode_FromString("80863791-dbe9-4eb8-837e-7f0ab55d9ac7"));
3845 3562 : PyModule_AddObject(m, "GUID_DRS_BEHAVIOR_VERSION", PyUnicode_FromString("d31a8757-2447-4545-8081-3bb610cacbf2"));
3846 3562 : PyModule_AddObject(m, "SEC_PRIV_INVALID", PyLong_FromLong((uint16_t)SEC_PRIV_INVALID));
3847 3562 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_QUOTA", PyLong_FromLong((uint16_t)SEC_PRIV_INCREASE_QUOTA));
3848 3562 : PyModule_AddObject(m, "SEC_PRIV_MACHINE_ACCOUNT", PyLong_FromLong((uint16_t)SEC_PRIV_MACHINE_ACCOUNT));
3849 3562 : PyModule_AddObject(m, "SEC_PRIV_SECURITY", PyLong_FromLong((uint16_t)SEC_PRIV_SECURITY));
3850 3562 : PyModule_AddObject(m, "SEC_PRIV_TAKE_OWNERSHIP", PyLong_FromLong((uint16_t)SEC_PRIV_TAKE_OWNERSHIP));
3851 3562 : PyModule_AddObject(m, "SEC_PRIV_LOAD_DRIVER", PyLong_FromLong((uint16_t)SEC_PRIV_LOAD_DRIVER));
3852 3562 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_PROFILE", PyLong_FromLong((uint16_t)SEC_PRIV_SYSTEM_PROFILE));
3853 3562 : PyModule_AddObject(m, "SEC_PRIV_SYSTEMTIME", PyLong_FromLong((uint16_t)SEC_PRIV_SYSTEMTIME));
3854 3562 : PyModule_AddObject(m, "SEC_PRIV_PROFILE_SINGLE_PROCESS", PyLong_FromLong((uint16_t)SEC_PRIV_PROFILE_SINGLE_PROCESS));
3855 3562 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_BASE_PRIORITY", PyLong_FromLong((uint16_t)SEC_PRIV_INCREASE_BASE_PRIORITY));
3856 3562 : PyModule_AddObject(m, "SEC_PRIV_CREATE_PAGEFILE", PyLong_FromLong((uint16_t)SEC_PRIV_CREATE_PAGEFILE));
3857 3562 : PyModule_AddObject(m, "SEC_PRIV_BACKUP", PyLong_FromLong((uint16_t)SEC_PRIV_BACKUP));
3858 3562 : PyModule_AddObject(m, "SEC_PRIV_RESTORE", PyLong_FromLong((uint16_t)SEC_PRIV_RESTORE));
3859 3562 : PyModule_AddObject(m, "SEC_PRIV_SHUTDOWN", PyLong_FromLong((uint16_t)SEC_PRIV_SHUTDOWN));
3860 3562 : PyModule_AddObject(m, "SEC_PRIV_DEBUG", PyLong_FromLong((uint16_t)SEC_PRIV_DEBUG));
3861 3562 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_ENVIRONMENT", PyLong_FromLong((uint16_t)SEC_PRIV_SYSTEM_ENVIRONMENT));
3862 3562 : PyModule_AddObject(m, "SEC_PRIV_CHANGE_NOTIFY", PyLong_FromLong((uint16_t)SEC_PRIV_CHANGE_NOTIFY));
3863 3562 : PyModule_AddObject(m, "SEC_PRIV_REMOTE_SHUTDOWN", PyLong_FromLong((uint16_t)SEC_PRIV_REMOTE_SHUTDOWN));
3864 3562 : PyModule_AddObject(m, "SEC_PRIV_UNDOCK", PyLong_FromLong((uint16_t)SEC_PRIV_UNDOCK));
3865 3562 : PyModule_AddObject(m, "SEC_PRIV_ENABLE_DELEGATION", PyLong_FromLong((uint16_t)SEC_PRIV_ENABLE_DELEGATION));
3866 3562 : PyModule_AddObject(m, "SEC_PRIV_MANAGE_VOLUME", PyLong_FromLong((uint16_t)SEC_PRIV_MANAGE_VOLUME));
3867 3562 : PyModule_AddObject(m, "SEC_PRIV_IMPERSONATE", PyLong_FromLong((uint16_t)SEC_PRIV_IMPERSONATE));
3868 3562 : PyModule_AddObject(m, "SEC_PRIV_CREATE_GLOBAL", PyLong_FromLong((uint16_t)SEC_PRIV_CREATE_GLOBAL));
3869 3562 : PyModule_AddObject(m, "SEC_PRIV_PRINT_OPERATOR", PyLong_FromLong((uint16_t)SEC_PRIV_PRINT_OPERATOR));
3870 3562 : PyModule_AddObject(m, "SEC_PRIV_ADD_USERS", PyLong_FromLong((uint16_t)SEC_PRIV_ADD_USERS));
3871 3562 : PyModule_AddObject(m, "SEC_PRIV_DISK_OPERATOR", PyLong_FromLong((uint16_t)SEC_PRIV_DISK_OPERATOR));
3872 3562 : PyModule_AddObject(m, "SEC_PRIV_MACHINE_ACCOUNT_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_MACHINE_ACCOUNT_BIT));
3873 3562 : PyModule_AddObject(m, "SEC_PRIV_PRINT_OPERATOR_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_PRINT_OPERATOR_BIT));
3874 3562 : PyModule_AddObject(m, "SEC_PRIV_ADD_USERS_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_ADD_USERS_BIT));
3875 3562 : PyModule_AddObject(m, "SEC_PRIV_DISK_OPERATOR_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_DISK_OPERATOR_BIT));
3876 3562 : PyModule_AddObject(m, "SEC_PRIV_REMOTE_SHUTDOWN_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_REMOTE_SHUTDOWN_BIT));
3877 3562 : PyModule_AddObject(m, "SEC_PRIV_BACKUP_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_BACKUP_BIT));
3878 3562 : PyModule_AddObject(m, "SEC_PRIV_RESTORE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_RESTORE_BIT));
3879 3562 : PyModule_AddObject(m, "SEC_PRIV_TAKE_OWNERSHIP_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_TAKE_OWNERSHIP_BIT));
3880 3562 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_QUOTA_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_INCREASE_QUOTA_BIT));
3881 3562 : PyModule_AddObject(m, "SEC_PRIV_SECURITY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SECURITY_BIT));
3882 3562 : PyModule_AddObject(m, "SEC_PRIV_LOAD_DRIVER_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_LOAD_DRIVER_BIT));
3883 3562 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_PROFILE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEM_PROFILE_BIT));
3884 3562 : PyModule_AddObject(m, "SEC_PRIV_SYSTEMTIME_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEMTIME_BIT));
3885 3562 : PyModule_AddObject(m, "SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT));
3886 3562 : PyModule_AddObject(m, "SEC_PRIV_INCREASE_BASE_PRIORITY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_INCREASE_BASE_PRIORITY_BIT));
3887 3562 : PyModule_AddObject(m, "SEC_PRIV_CREATE_PAGEFILE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CREATE_PAGEFILE_BIT));
3888 3562 : PyModule_AddObject(m, "SEC_PRIV_SHUTDOWN_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SHUTDOWN_BIT));
3889 3562 : PyModule_AddObject(m, "SEC_PRIV_DEBUG_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_DEBUG_BIT));
3890 3562 : PyModule_AddObject(m, "SEC_PRIV_SYSTEM_ENVIRONMENT_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEM_ENVIRONMENT_BIT));
3891 3562 : PyModule_AddObject(m, "SEC_PRIV_CHANGE_NOTIFY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CHANGE_NOTIFY_BIT));
3892 3562 : PyModule_AddObject(m, "SEC_PRIV_UNDOCK_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_UNDOCK_BIT));
3893 3562 : PyModule_AddObject(m, "SEC_PRIV_ENABLE_DELEGATION_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_ENABLE_DELEGATION_BIT));
3894 3562 : PyModule_AddObject(m, "SEC_PRIV_MANAGE_VOLUME_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_MANAGE_VOLUME_BIT));
3895 3562 : PyModule_AddObject(m, "SEC_PRIV_IMPERSONATE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_IMPERSONATE_BIT));
3896 3562 : PyModule_AddObject(m, "SEC_PRIV_CREATE_GLOBAL_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CREATE_GLOBAL_BIT));
3897 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_INTERACTIVE));
3898 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_NETWORK));
3899 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_BATCH", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_BATCH));
3900 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_SERVICE));
3901 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_PROXY", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_PROXY));
3902 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_INTERACTIVE));
3903 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_NETWORK));
3904 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_BATCH", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_BATCH));
3905 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_SERVICE));
3906 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_REMOTE_INTERACTIVE));
3907 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE));
3908 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_ALL", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_ALL));
3909 3562 : PyModule_AddObject(m, "LSA_POLICY_MODE_ALL_NT4", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_ALL_NT4));
3910 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_OBJECT_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_OBJECT_INHERIT));
3911 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_CONTAINER_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_CONTAINER_INHERIT));
3912 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_NO_PROPAGATE_INHERIT));
3913 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_INHERIT_ONLY", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_INHERIT_ONLY));
3914 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_INHERITED_ACE", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_INHERITED_ACE));
3915 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_VALID_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_VALID_INHERIT));
3916 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_SUCCESSFUL_ACCESS));
3917 3562 : PyModule_AddObject(m, "SEC_ACE_FLAG_FAILED_ACCESS", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_FAILED_ACCESS));
3918 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_ALLOWED));
3919 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_DENIED));
3920 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_AUDIT));
3921 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_ALARM));
3922 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_ALLOWED_COMPOUND", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ALLOWED_COMPOUND));
3923 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT));
3924 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_DENIED_OBJECT));
3925 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT));
3926 3562 : PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT));
3927 3562 : PyModule_AddObject(m, "SEC_ACE_OBJECT_TYPE_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_ACE_OBJECT_TYPE_PRESENT));
3928 3562 : PyModule_AddObject(m, "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT));
3929 3562 : PyModule_AddObject(m, "SECURITY_ACL_REVISION_NT4", PyLong_FromLong((uint16_t)SECURITY_ACL_REVISION_NT4));
3930 3562 : PyModule_AddObject(m, "SECURITY_ACL_REVISION_ADS", PyLong_FromLong((uint16_t)SECURITY_ACL_REVISION_ADS));
3931 3562 : PyModule_AddObject(m, "SECURITY_DESCRIPTOR_REVISION_1", PyLong_FromLong((uint16_t)SECURITY_DESCRIPTOR_REVISION_1));
3932 3562 : PyModule_AddObject(m, "SEC_DESC_OWNER_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_OWNER_DEFAULTED));
3933 3562 : PyModule_AddObject(m, "SEC_DESC_GROUP_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_GROUP_DEFAULTED));
3934 3562 : PyModule_AddObject(m, "SEC_DESC_DACL_PRESENT", PyLong_FromLong((uint16_t)SEC_DESC_DACL_PRESENT));
3935 3562 : PyModule_AddObject(m, "SEC_DESC_DACL_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_DEFAULTED));
3936 3562 : PyModule_AddObject(m, "SEC_DESC_SACL_PRESENT", PyLong_FromLong((uint16_t)SEC_DESC_SACL_PRESENT));
3937 3562 : PyModule_AddObject(m, "SEC_DESC_SACL_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_SACL_DEFAULTED));
3938 3562 : PyModule_AddObject(m, "SEC_DESC_DACL_TRUSTED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_TRUSTED));
3939 3562 : PyModule_AddObject(m, "SEC_DESC_SERVER_SECURITY", PyLong_FromLong((uint16_t)SEC_DESC_SERVER_SECURITY));
3940 3562 : PyModule_AddObject(m, "SEC_DESC_DACL_AUTO_INHERIT_REQ", PyLong_FromLong((uint16_t)SEC_DESC_DACL_AUTO_INHERIT_REQ));
3941 3562 : PyModule_AddObject(m, "SEC_DESC_SACL_AUTO_INHERIT_REQ", PyLong_FromLong((uint16_t)SEC_DESC_SACL_AUTO_INHERIT_REQ));
3942 3562 : PyModule_AddObject(m, "SEC_DESC_DACL_AUTO_INHERITED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_AUTO_INHERITED));
3943 3562 : PyModule_AddObject(m, "SEC_DESC_SACL_AUTO_INHERITED", PyLong_FromLong((uint16_t)SEC_DESC_SACL_AUTO_INHERITED));
3944 3562 : PyModule_AddObject(m, "SEC_DESC_DACL_PROTECTED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_PROTECTED));
3945 3562 : PyModule_AddObject(m, "SEC_DESC_SACL_PROTECTED", PyLong_FromLong((uint16_t)SEC_DESC_SACL_PROTECTED));
3946 3562 : PyModule_AddObject(m, "SEC_DESC_RM_CONTROL_VALID", PyLong_FromLong((uint16_t)SEC_DESC_RM_CONTROL_VALID));
3947 3562 : PyModule_AddObject(m, "SEC_DESC_SELF_RELATIVE", PyLong_FromLong((uint16_t)SEC_DESC_SELF_RELATIVE));
3948 3562 : PyModule_AddObject(m, "SE_GROUP_MANDATORY", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_MANDATORY));
3949 3562 : PyModule_AddObject(m, "SE_GROUP_ENABLED_BY_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_ENABLED_BY_DEFAULT));
3950 3562 : PyModule_AddObject(m, "SE_GROUP_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_ENABLED));
3951 3562 : PyModule_AddObject(m, "SE_GROUP_OWNER", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_OWNER));
3952 3562 : PyModule_AddObject(m, "SE_GROUP_USE_FOR_DENY_ONLY", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_USE_FOR_DENY_ONLY));
3953 3562 : PyModule_AddObject(m, "SE_GROUP_INTEGRITY", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_INTEGRITY));
3954 3562 : PyModule_AddObject(m, "SE_GROUP_INTEGRITY_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_INTEGRITY_ENABLED));
3955 3562 : PyModule_AddObject(m, "SE_GROUP_RESOURCE", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_RESOURCE));
3956 3562 : PyModule_AddObject(m, "SE_GROUP_LOGON_ID", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_LOGON_ID));
3957 3562 : PyModule_AddObject(m, "SECINFO_OWNER", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_OWNER));
3958 3562 : PyModule_AddObject(m, "SECINFO_GROUP", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_GROUP));
3959 3562 : PyModule_AddObject(m, "SECINFO_DACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_DACL));
3960 3562 : PyModule_AddObject(m, "SECINFO_SACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_SACL));
3961 3562 : PyModule_AddObject(m, "SECINFO_LABEL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_LABEL));
3962 3562 : PyModule_AddObject(m, "SECINFO_ATTRIBUTE", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_ATTRIBUTE));
3963 3562 : PyModule_AddObject(m, "SECINFO_SCOPE", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_SCOPE));
3964 3562 : PyModule_AddObject(m, "SECINFO_BACKUP", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_BACKUP));
3965 3562 : PyModule_AddObject(m, "SECINFO_UNPROTECTED_SACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_UNPROTECTED_SACL));
3966 3562 : PyModule_AddObject(m, "SECINFO_UNPROTECTED_DACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_UNPROTECTED_DACL));
3967 3562 : PyModule_AddObject(m, "SECINFO_PROTECTED_SACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_PROTECTED_SACL));
3968 3562 : PyModule_AddObject(m, "SECINFO_PROTECTED_DACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_PROTECTED_DACL));
3969 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_DES_CBC_CRC", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_DES_CBC_CRC));
3970 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_DES_CBC_MD5", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_DES_CBC_MD5));
3971 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_RC4_HMAC_MD5", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_RC4_HMAC_MD5));
3972 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96));
3973 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96));
3974 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK));
3975 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_FAST_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_FAST_SUPPORTED));
3976 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED));
3977 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_CLAIMS_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_CLAIMS_SUPPORTED));
3978 3562 : PyModule_AddObject(m, "KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED));
3979 3562 : PyModule_AddObject(m, "SEC_DACL_AUTO_INHERIT", PyLong_FromUnsignedLongLong((uint32_t)SEC_DACL_AUTO_INHERIT));
3980 3562 : PyModule_AddObject(m, "SEC_SACL_AUTO_INHERIT", PyLong_FromUnsignedLongLong((uint32_t)SEC_SACL_AUTO_INHERIT));
3981 3562 : PyModule_AddObject(m, "SEC_DEFAULT_DESCRIPTOR", PyLong_FromUnsignedLongLong((uint32_t)SEC_DEFAULT_DESCRIPTOR));
3982 3562 : PyModule_AddObject(m, "SEC_OWNER_FROM_PARENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_OWNER_FROM_PARENT));
3983 3562 : PyModule_AddObject(m, "SEC_GROUP_FROM_PARENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_GROUP_FROM_PARENT));
3984 3562 : Py_INCREF((PyObject *)(void *)&dom_sid_Type);
3985 3562 : PyModule_AddObject(m, "dom_sid", (PyObject *)(void *)&dom_sid_Type);
3986 3562 : Py_INCREF((PyObject *)(void *)&security_ace_object_type_Type);
3987 3562 : PyModule_AddObject(m, "ace_object_type", (PyObject *)(void *)&security_ace_object_type_Type);
3988 3562 : Py_INCREF((PyObject *)(void *)&security_ace_object_inherited_type_Type);
3989 3562 : PyModule_AddObject(m, "ace_object_inherited_type", (PyObject *)(void *)&security_ace_object_inherited_type_Type);
3990 3562 : Py_INCREF((PyObject *)(void *)&security_ace_object_Type);
3991 3562 : PyModule_AddObject(m, "ace_object", (PyObject *)(void *)&security_ace_object_Type);
3992 3562 : Py_INCREF((PyObject *)(void *)&security_ace_object_ctr_Type);
3993 3562 : PyModule_AddObject(m, "ace_object_ctr", (PyObject *)(void *)&security_ace_object_ctr_Type);
3994 3562 : Py_INCREF((PyObject *)(void *)&security_ace_Type);
3995 3562 : PyModule_AddObject(m, "ace", (PyObject *)(void *)&security_ace_Type);
3996 3562 : Py_INCREF((PyObject *)(void *)&security_acl_Type);
3997 3562 : PyModule_AddObject(m, "acl", (PyObject *)(void *)&security_acl_Type);
3998 3562 : Py_INCREF((PyObject *)(void *)&security_descriptor_Type);
3999 3562 : PyModule_AddObject(m, "descriptor", (PyObject *)(void *)&security_descriptor_Type);
4000 3562 : Py_INCREF((PyObject *)(void *)&sec_desc_buf_Type);
4001 3562 : PyModule_AddObject(m, "sec_desc_buf", (PyObject *)(void *)&sec_desc_buf_Type);
4002 3562 : Py_INCREF((PyObject *)(void *)&security_token_Type);
4003 3562 : PyModule_AddObject(m, "token", (PyObject *)(void *)&security_token_Type);
4004 3562 : Py_INCREF((PyObject *)(void *)&security_unix_token_Type);
4005 3562 : PyModule_AddObject(m, "unix_token", (PyObject *)(void *)&security_unix_token_Type);
4006 3562 : Py_INCREF((PyObject *)(void *)&LSAP_TOKEN_INFO_INTEGRITY_Type);
4007 3562 : PyModule_AddObject(m, "LSAP_TOKEN_INFO_INTEGRITY", (PyObject *)(void *)&LSAP_TOKEN_INFO_INTEGRITY_Type);
4008 3562 : Py_INCREF((PyObject *)(void *)&generic_mapping_Type);
4009 3562 : PyModule_AddObject(m, "generic_mapping", (PyObject *)(void *)&generic_mapping_Type);
4010 3562 : Py_INCREF((PyObject *)(void *)&standard_mapping_Type);
4011 3562 : PyModule_AddObject(m, "standard_mapping", (PyObject *)(void *)&standard_mapping_Type);
4012 3562 : Py_INCREF((PyObject *)(void *)&security_InterfaceType);
4013 3562 : PyModule_AddObject(m, "security", (PyObject *)(void *)&security_InterfaceType);
4014 3562 : Py_INCREF((PyObject *)(void *)&security_SyntaxType);
4015 3562 : PyModule_AddObject(m, "security_abstract_syntax", (PyObject *)(void *)&security_SyntaxType);
4016 3562 : Py_INCREF((PyObject *)(void *)&security_SyntaxType);
4017 3562 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&security_SyntaxType);
4018 : #ifdef PY_MOD_SECURITY_PATCH
4019 3562 : PY_MOD_SECURITY_PATCH(m);
4020 : #endif
4021 3562 : out:
4022 3562 : Py_XDECREF(dep_samba_dcerpc_misc);
4023 3562 : Py_XDECREF(dep_talloc);
4024 3562 : Py_XDECREF(dep_samba_dcerpc_base);
4025 3562 : return m;
4026 :
4027 : }
|