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_auth.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 0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 0 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 0 : case 4:
38 0 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 0 : case 1:
42 0 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 : switch (var_size) {
51 : case 8:
52 : return INT64_MAX;
53 : case 4:
54 : return INT32_MAX;
55 : case 2:
56 : return INT16_MAX;
57 : case 1:
58 : return INT8_MAX;
59 : }
60 :
61 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : #include "librpc/gen_ndr/security.h"
66 : #include "librpc/gen_ndr/lsa.h"
67 : #include "librpc/gen_ndr/krb5pac.h"
68 : static PyTypeObject auth_user_info_Type;
69 : static PyTypeObject auth_user_info_torture_Type;
70 : static PyTypeObject auth_user_info_unix_Type;
71 : static PyTypeObject auth_SidAttr_Type;
72 : static PyTypeObject auth_user_info_dc_Type;
73 : static PyTypeObject auth_session_info_Type;
74 : static PyTypeObject auth_session_info_transport_Type;
75 :
76 : static PyTypeObject *BaseObject_Type;
77 : static PyTypeObject *dom_sid_Type;
78 : static PyTypeObject *security_token_Type;
79 : static PyTypeObject *security_unix_token_Type;
80 : static PyTypeObject *GUID_Type;
81 : #include "librpc/ndr/py_auth.c"
82 :
83 :
84 2 : static PyObject *py_auth_user_info_get_account_name(PyObject *obj, void *closure)
85 : {
86 2 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
87 0 : PyObject *py_account_name;
88 2 : if (object->account_name == NULL) {
89 0 : Py_RETURN_NONE;
90 : }
91 2 : if (object->account_name == NULL) {
92 0 : py_account_name = Py_None;
93 0 : Py_INCREF(py_account_name);
94 : } else {
95 2 : if (object->account_name == NULL) {
96 0 : py_account_name = Py_None;
97 0 : Py_INCREF(py_account_name);
98 : } else {
99 2 : py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore");
100 : }
101 : }
102 2 : return py_account_name;
103 : }
104 :
105 0 : static int py_auth_user_info_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
106 : {
107 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
108 0 : if (value == NULL) {
109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
110 0 : return -1;
111 : }
112 0 : if (value == Py_None) {
113 0 : object->account_name = NULL;
114 : } else {
115 0 : object->account_name = NULL;
116 : {
117 0 : const char *test_str;
118 0 : const char *talloc_str;
119 0 : PyObject *unicode = NULL;
120 0 : if (PyUnicode_Check(value)) {
121 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
122 0 : if (unicode == NULL) {
123 0 : PyErr_NoMemory();
124 0 : return -1;
125 : }
126 0 : test_str = PyBytes_AS_STRING(unicode);
127 0 : } else if (PyBytes_Check(value)) {
128 0 : test_str = PyBytes_AS_STRING(value);
129 : } else {
130 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
131 0 : return -1;
132 : }
133 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
134 0 : if (unicode != NULL) {
135 0 : Py_DECREF(unicode);
136 : }
137 0 : if (talloc_str == NULL) {
138 0 : PyErr_NoMemory();
139 0 : return -1;
140 : }
141 0 : object->account_name = talloc_str;
142 : }
143 : }
144 0 : return 0;
145 : }
146 :
147 0 : static PyObject *py_auth_user_info_get_user_principal_name(PyObject *obj, void *closure)
148 : {
149 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
150 0 : PyObject *py_user_principal_name;
151 0 : if (object->user_principal_name == NULL) {
152 0 : Py_RETURN_NONE;
153 : }
154 0 : if (object->user_principal_name == NULL) {
155 0 : py_user_principal_name = Py_None;
156 0 : Py_INCREF(py_user_principal_name);
157 : } else {
158 0 : if (object->user_principal_name == NULL) {
159 0 : py_user_principal_name = Py_None;
160 0 : Py_INCREF(py_user_principal_name);
161 : } else {
162 0 : py_user_principal_name = PyUnicode_Decode(object->user_principal_name, strlen(object->user_principal_name), "utf-8", "ignore");
163 : }
164 : }
165 0 : return py_user_principal_name;
166 : }
167 :
168 0 : static int py_auth_user_info_set_user_principal_name(PyObject *py_obj, PyObject *value, void *closure)
169 : {
170 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
171 0 : if (value == NULL) {
172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_principal_name");
173 0 : return -1;
174 : }
175 0 : if (value == Py_None) {
176 0 : object->user_principal_name = NULL;
177 : } else {
178 0 : object->user_principal_name = NULL;
179 : {
180 0 : const char *test_str;
181 0 : const char *talloc_str;
182 0 : PyObject *unicode = NULL;
183 0 : if (PyUnicode_Check(value)) {
184 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
185 0 : if (unicode == NULL) {
186 0 : PyErr_NoMemory();
187 0 : return -1;
188 : }
189 0 : test_str = PyBytes_AS_STRING(unicode);
190 0 : } else if (PyBytes_Check(value)) {
191 0 : test_str = PyBytes_AS_STRING(value);
192 : } else {
193 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
194 0 : return -1;
195 : }
196 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
197 0 : if (unicode != NULL) {
198 0 : Py_DECREF(unicode);
199 : }
200 0 : if (talloc_str == NULL) {
201 0 : PyErr_NoMemory();
202 0 : return -1;
203 : }
204 0 : object->user_principal_name = talloc_str;
205 : }
206 : }
207 0 : return 0;
208 : }
209 :
210 0 : static PyObject *py_auth_user_info_get_user_principal_constructed(PyObject *obj, void *closure)
211 : {
212 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
213 0 : PyObject *py_user_principal_constructed;
214 0 : py_user_principal_constructed = PyLong_FromLong((uint16_t)object->user_principal_constructed);
215 0 : return py_user_principal_constructed;
216 : }
217 :
218 0 : static int py_auth_user_info_set_user_principal_constructed(PyObject *py_obj, PyObject *value, void *closure)
219 : {
220 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
221 0 : if (value == NULL) {
222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_principal_constructed");
223 0 : return -1;
224 : }
225 : {
226 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_principal_constructed));
227 0 : if (PyLong_Check(value)) {
228 0 : unsigned long long test_var;
229 0 : test_var = PyLong_AsUnsignedLongLong(value);
230 0 : if (PyErr_Occurred() != NULL) {
231 0 : return -1;
232 : }
233 0 : if (test_var > uint_max) {
234 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
235 : PyLong_Type.tp_name, uint_max, test_var);
236 0 : return -1;
237 : }
238 0 : object->user_principal_constructed = test_var;
239 : } else {
240 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
241 : PyLong_Type.tp_name);
242 0 : return -1;
243 : }
244 : }
245 0 : return 0;
246 : }
247 :
248 2 : static PyObject *py_auth_user_info_get_domain_name(PyObject *obj, void *closure)
249 : {
250 2 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
251 0 : PyObject *py_domain_name;
252 2 : if (object->domain_name == NULL) {
253 0 : Py_RETURN_NONE;
254 : }
255 2 : if (object->domain_name == NULL) {
256 0 : py_domain_name = Py_None;
257 0 : Py_INCREF(py_domain_name);
258 : } else {
259 2 : if (object->domain_name == NULL) {
260 0 : py_domain_name = Py_None;
261 0 : Py_INCREF(py_domain_name);
262 : } else {
263 2 : py_domain_name = PyUnicode_Decode(object->domain_name, strlen(object->domain_name), "utf-8", "ignore");
264 : }
265 : }
266 2 : return py_domain_name;
267 : }
268 :
269 0 : static int py_auth_user_info_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
270 : {
271 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
272 0 : if (value == NULL) {
273 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
274 0 : return -1;
275 : }
276 0 : if (value == Py_None) {
277 0 : object->domain_name = NULL;
278 : } else {
279 0 : object->domain_name = NULL;
280 : {
281 0 : const char *test_str;
282 0 : const char *talloc_str;
283 0 : PyObject *unicode = NULL;
284 0 : if (PyUnicode_Check(value)) {
285 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
286 0 : if (unicode == NULL) {
287 0 : PyErr_NoMemory();
288 0 : return -1;
289 : }
290 0 : test_str = PyBytes_AS_STRING(unicode);
291 0 : } else if (PyBytes_Check(value)) {
292 0 : test_str = PyBytes_AS_STRING(value);
293 : } else {
294 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
295 0 : return -1;
296 : }
297 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
298 0 : if (unicode != NULL) {
299 0 : Py_DECREF(unicode);
300 : }
301 0 : if (talloc_str == NULL) {
302 0 : PyErr_NoMemory();
303 0 : return -1;
304 : }
305 0 : object->domain_name = talloc_str;
306 : }
307 : }
308 0 : return 0;
309 : }
310 :
311 0 : static PyObject *py_auth_user_info_get_dns_domain_name(PyObject *obj, void *closure)
312 : {
313 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
314 0 : PyObject *py_dns_domain_name;
315 0 : if (object->dns_domain_name == NULL) {
316 0 : Py_RETURN_NONE;
317 : }
318 0 : if (object->dns_domain_name == NULL) {
319 0 : py_dns_domain_name = Py_None;
320 0 : Py_INCREF(py_dns_domain_name);
321 : } else {
322 0 : if (object->dns_domain_name == NULL) {
323 0 : py_dns_domain_name = Py_None;
324 0 : Py_INCREF(py_dns_domain_name);
325 : } else {
326 0 : py_dns_domain_name = PyUnicode_Decode(object->dns_domain_name, strlen(object->dns_domain_name), "utf-8", "ignore");
327 : }
328 : }
329 0 : return py_dns_domain_name;
330 : }
331 :
332 0 : static int py_auth_user_info_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
333 : {
334 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
335 0 : if (value == NULL) {
336 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name");
337 0 : return -1;
338 : }
339 0 : if (value == Py_None) {
340 0 : object->dns_domain_name = NULL;
341 : } else {
342 0 : object->dns_domain_name = NULL;
343 : {
344 0 : const char *test_str;
345 0 : const char *talloc_str;
346 0 : PyObject *unicode = NULL;
347 0 : if (PyUnicode_Check(value)) {
348 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
349 0 : if (unicode == NULL) {
350 0 : PyErr_NoMemory();
351 0 : return -1;
352 : }
353 0 : test_str = PyBytes_AS_STRING(unicode);
354 0 : } else if (PyBytes_Check(value)) {
355 0 : test_str = PyBytes_AS_STRING(value);
356 : } else {
357 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
358 0 : return -1;
359 : }
360 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
361 0 : if (unicode != NULL) {
362 0 : Py_DECREF(unicode);
363 : }
364 0 : if (talloc_str == NULL) {
365 0 : PyErr_NoMemory();
366 0 : return -1;
367 : }
368 0 : object->dns_domain_name = talloc_str;
369 : }
370 : }
371 0 : return 0;
372 : }
373 :
374 2 : static PyObject *py_auth_user_info_get_full_name(PyObject *obj, void *closure)
375 : {
376 2 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
377 0 : PyObject *py_full_name;
378 2 : if (object->full_name == NULL) {
379 0 : Py_RETURN_NONE;
380 : }
381 2 : if (object->full_name == NULL) {
382 0 : py_full_name = Py_None;
383 0 : Py_INCREF(py_full_name);
384 : } else {
385 2 : if (object->full_name == NULL) {
386 0 : py_full_name = Py_None;
387 0 : Py_INCREF(py_full_name);
388 : } else {
389 2 : py_full_name = PyUnicode_Decode(object->full_name, strlen(object->full_name), "utf-8", "ignore");
390 : }
391 : }
392 2 : return py_full_name;
393 : }
394 :
395 0 : static int py_auth_user_info_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
396 : {
397 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
398 0 : if (value == NULL) {
399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
400 0 : return -1;
401 : }
402 0 : if (value == Py_None) {
403 0 : object->full_name = NULL;
404 : } else {
405 0 : object->full_name = NULL;
406 : {
407 0 : const char *test_str;
408 0 : const char *talloc_str;
409 0 : PyObject *unicode = NULL;
410 0 : if (PyUnicode_Check(value)) {
411 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
412 0 : if (unicode == NULL) {
413 0 : PyErr_NoMemory();
414 0 : return -1;
415 : }
416 0 : test_str = PyBytes_AS_STRING(unicode);
417 0 : } else if (PyBytes_Check(value)) {
418 0 : test_str = PyBytes_AS_STRING(value);
419 : } else {
420 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
421 0 : return -1;
422 : }
423 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
424 0 : if (unicode != NULL) {
425 0 : Py_DECREF(unicode);
426 : }
427 0 : if (talloc_str == NULL) {
428 0 : PyErr_NoMemory();
429 0 : return -1;
430 : }
431 0 : object->full_name = talloc_str;
432 : }
433 : }
434 0 : return 0;
435 : }
436 :
437 0 : static PyObject *py_auth_user_info_get_logon_script(PyObject *obj, void *closure)
438 : {
439 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
440 0 : PyObject *py_logon_script;
441 0 : if (object->logon_script == NULL) {
442 0 : Py_RETURN_NONE;
443 : }
444 0 : if (object->logon_script == NULL) {
445 0 : py_logon_script = Py_None;
446 0 : Py_INCREF(py_logon_script);
447 : } else {
448 0 : if (object->logon_script == NULL) {
449 0 : py_logon_script = Py_None;
450 0 : Py_INCREF(py_logon_script);
451 : } else {
452 0 : py_logon_script = PyUnicode_Decode(object->logon_script, strlen(object->logon_script), "utf-8", "ignore");
453 : }
454 : }
455 0 : return py_logon_script;
456 : }
457 :
458 0 : static int py_auth_user_info_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
459 : {
460 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
461 0 : if (value == NULL) {
462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
463 0 : return -1;
464 : }
465 0 : if (value == Py_None) {
466 0 : object->logon_script = NULL;
467 : } else {
468 0 : object->logon_script = NULL;
469 : {
470 0 : const char *test_str;
471 0 : const char *talloc_str;
472 0 : PyObject *unicode = NULL;
473 0 : if (PyUnicode_Check(value)) {
474 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
475 0 : if (unicode == NULL) {
476 0 : PyErr_NoMemory();
477 0 : return -1;
478 : }
479 0 : test_str = PyBytes_AS_STRING(unicode);
480 0 : } else if (PyBytes_Check(value)) {
481 0 : test_str = PyBytes_AS_STRING(value);
482 : } else {
483 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
484 0 : return -1;
485 : }
486 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
487 0 : if (unicode != NULL) {
488 0 : Py_DECREF(unicode);
489 : }
490 0 : if (talloc_str == NULL) {
491 0 : PyErr_NoMemory();
492 0 : return -1;
493 : }
494 0 : object->logon_script = talloc_str;
495 : }
496 : }
497 0 : return 0;
498 : }
499 :
500 0 : static PyObject *py_auth_user_info_get_profile_path(PyObject *obj, void *closure)
501 : {
502 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
503 0 : PyObject *py_profile_path;
504 0 : if (object->profile_path == NULL) {
505 0 : Py_RETURN_NONE;
506 : }
507 0 : if (object->profile_path == NULL) {
508 0 : py_profile_path = Py_None;
509 0 : Py_INCREF(py_profile_path);
510 : } else {
511 0 : if (object->profile_path == NULL) {
512 0 : py_profile_path = Py_None;
513 0 : Py_INCREF(py_profile_path);
514 : } else {
515 0 : py_profile_path = PyUnicode_Decode(object->profile_path, strlen(object->profile_path), "utf-8", "ignore");
516 : }
517 : }
518 0 : return py_profile_path;
519 : }
520 :
521 0 : static int py_auth_user_info_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
522 : {
523 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
524 0 : if (value == NULL) {
525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
526 0 : return -1;
527 : }
528 0 : if (value == Py_None) {
529 0 : object->profile_path = NULL;
530 : } else {
531 0 : object->profile_path = NULL;
532 : {
533 0 : const char *test_str;
534 0 : const char *talloc_str;
535 0 : PyObject *unicode = NULL;
536 0 : if (PyUnicode_Check(value)) {
537 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
538 0 : if (unicode == NULL) {
539 0 : PyErr_NoMemory();
540 0 : return -1;
541 : }
542 0 : test_str = PyBytes_AS_STRING(unicode);
543 0 : } else if (PyBytes_Check(value)) {
544 0 : test_str = PyBytes_AS_STRING(value);
545 : } else {
546 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
547 0 : return -1;
548 : }
549 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
550 0 : if (unicode != NULL) {
551 0 : Py_DECREF(unicode);
552 : }
553 0 : if (talloc_str == NULL) {
554 0 : PyErr_NoMemory();
555 0 : return -1;
556 : }
557 0 : object->profile_path = talloc_str;
558 : }
559 : }
560 0 : return 0;
561 : }
562 :
563 0 : static PyObject *py_auth_user_info_get_home_directory(PyObject *obj, void *closure)
564 : {
565 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
566 0 : PyObject *py_home_directory;
567 0 : if (object->home_directory == NULL) {
568 0 : Py_RETURN_NONE;
569 : }
570 0 : if (object->home_directory == NULL) {
571 0 : py_home_directory = Py_None;
572 0 : Py_INCREF(py_home_directory);
573 : } else {
574 0 : if (object->home_directory == NULL) {
575 0 : py_home_directory = Py_None;
576 0 : Py_INCREF(py_home_directory);
577 : } else {
578 0 : py_home_directory = PyUnicode_Decode(object->home_directory, strlen(object->home_directory), "utf-8", "ignore");
579 : }
580 : }
581 0 : return py_home_directory;
582 : }
583 :
584 0 : static int py_auth_user_info_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
585 : {
586 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
587 0 : if (value == NULL) {
588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
589 0 : return -1;
590 : }
591 0 : if (value == Py_None) {
592 0 : object->home_directory = NULL;
593 : } else {
594 0 : object->home_directory = NULL;
595 : {
596 0 : const char *test_str;
597 0 : const char *talloc_str;
598 0 : PyObject *unicode = NULL;
599 0 : if (PyUnicode_Check(value)) {
600 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
601 0 : if (unicode == NULL) {
602 0 : PyErr_NoMemory();
603 0 : return -1;
604 : }
605 0 : test_str = PyBytes_AS_STRING(unicode);
606 0 : } else if (PyBytes_Check(value)) {
607 0 : test_str = PyBytes_AS_STRING(value);
608 : } else {
609 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
610 0 : return -1;
611 : }
612 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
613 0 : if (unicode != NULL) {
614 0 : Py_DECREF(unicode);
615 : }
616 0 : if (talloc_str == NULL) {
617 0 : PyErr_NoMemory();
618 0 : return -1;
619 : }
620 0 : object->home_directory = talloc_str;
621 : }
622 : }
623 0 : return 0;
624 : }
625 :
626 0 : static PyObject *py_auth_user_info_get_home_drive(PyObject *obj, void *closure)
627 : {
628 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
629 0 : PyObject *py_home_drive;
630 0 : if (object->home_drive == NULL) {
631 0 : Py_RETURN_NONE;
632 : }
633 0 : if (object->home_drive == NULL) {
634 0 : py_home_drive = Py_None;
635 0 : Py_INCREF(py_home_drive);
636 : } else {
637 0 : if (object->home_drive == NULL) {
638 0 : py_home_drive = Py_None;
639 0 : Py_INCREF(py_home_drive);
640 : } else {
641 0 : py_home_drive = PyUnicode_Decode(object->home_drive, strlen(object->home_drive), "utf-8", "ignore");
642 : }
643 : }
644 0 : return py_home_drive;
645 : }
646 :
647 0 : static int py_auth_user_info_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
648 : {
649 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
650 0 : if (value == NULL) {
651 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
652 0 : return -1;
653 : }
654 0 : if (value == Py_None) {
655 0 : object->home_drive = NULL;
656 : } else {
657 0 : object->home_drive = NULL;
658 : {
659 0 : const char *test_str;
660 0 : const char *talloc_str;
661 0 : PyObject *unicode = NULL;
662 0 : if (PyUnicode_Check(value)) {
663 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
664 0 : if (unicode == NULL) {
665 0 : PyErr_NoMemory();
666 0 : return -1;
667 : }
668 0 : test_str = PyBytes_AS_STRING(unicode);
669 0 : } else if (PyBytes_Check(value)) {
670 0 : test_str = PyBytes_AS_STRING(value);
671 : } else {
672 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
673 0 : return -1;
674 : }
675 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
676 0 : if (unicode != NULL) {
677 0 : Py_DECREF(unicode);
678 : }
679 0 : if (talloc_str == NULL) {
680 0 : PyErr_NoMemory();
681 0 : return -1;
682 : }
683 0 : object->home_drive = talloc_str;
684 : }
685 : }
686 0 : return 0;
687 : }
688 :
689 0 : static PyObject *py_auth_user_info_get_logon_server(PyObject *obj, void *closure)
690 : {
691 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
692 0 : PyObject *py_logon_server;
693 0 : if (object->logon_server == NULL) {
694 0 : Py_RETURN_NONE;
695 : }
696 0 : if (object->logon_server == NULL) {
697 0 : py_logon_server = Py_None;
698 0 : Py_INCREF(py_logon_server);
699 : } else {
700 0 : if (object->logon_server == NULL) {
701 0 : py_logon_server = Py_None;
702 0 : Py_INCREF(py_logon_server);
703 : } else {
704 0 : py_logon_server = PyUnicode_Decode(object->logon_server, strlen(object->logon_server), "utf-8", "ignore");
705 : }
706 : }
707 0 : return py_logon_server;
708 : }
709 :
710 0 : static int py_auth_user_info_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
711 : {
712 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
713 0 : if (value == NULL) {
714 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_server");
715 0 : return -1;
716 : }
717 0 : if (value == Py_None) {
718 0 : object->logon_server = NULL;
719 : } else {
720 0 : object->logon_server = NULL;
721 : {
722 0 : const char *test_str;
723 0 : const char *talloc_str;
724 0 : PyObject *unicode = NULL;
725 0 : if (PyUnicode_Check(value)) {
726 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
727 0 : if (unicode == NULL) {
728 0 : PyErr_NoMemory();
729 0 : return -1;
730 : }
731 0 : test_str = PyBytes_AS_STRING(unicode);
732 0 : } else if (PyBytes_Check(value)) {
733 0 : test_str = PyBytes_AS_STRING(value);
734 : } else {
735 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
736 0 : return -1;
737 : }
738 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
739 0 : if (unicode != NULL) {
740 0 : Py_DECREF(unicode);
741 : }
742 0 : if (talloc_str == NULL) {
743 0 : PyErr_NoMemory();
744 0 : return -1;
745 : }
746 0 : object->logon_server = talloc_str;
747 : }
748 : }
749 0 : return 0;
750 : }
751 :
752 0 : static PyObject *py_auth_user_info_get_last_logon(PyObject *obj, void *closure)
753 : {
754 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
755 0 : PyObject *py_last_logon;
756 0 : py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon);
757 0 : return py_last_logon;
758 : }
759 :
760 0 : static int py_auth_user_info_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
761 : {
762 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
763 0 : if (value == NULL) {
764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon");
765 0 : return -1;
766 : }
767 : {
768 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon));
769 0 : if (PyLong_Check(value)) {
770 0 : unsigned long long test_var;
771 0 : test_var = PyLong_AsUnsignedLongLong(value);
772 0 : if (PyErr_Occurred() != NULL) {
773 0 : return -1;
774 : }
775 0 : if (test_var > uint_max) {
776 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
777 : PyLong_Type.tp_name, uint_max, test_var);
778 0 : return -1;
779 : }
780 0 : object->last_logon = test_var;
781 : } else {
782 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
783 : PyLong_Type.tp_name);
784 0 : return -1;
785 : }
786 : }
787 0 : return 0;
788 : }
789 :
790 0 : static PyObject *py_auth_user_info_get_last_logoff(PyObject *obj, void *closure)
791 : {
792 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
793 0 : PyObject *py_last_logoff;
794 0 : py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff);
795 0 : return py_last_logoff;
796 : }
797 :
798 0 : static int py_auth_user_info_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
799 : {
800 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
801 0 : if (value == NULL) {
802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff");
803 0 : return -1;
804 : }
805 : {
806 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff));
807 0 : if (PyLong_Check(value)) {
808 0 : unsigned long long test_var;
809 0 : test_var = PyLong_AsUnsignedLongLong(value);
810 0 : if (PyErr_Occurred() != NULL) {
811 0 : return -1;
812 : }
813 0 : if (test_var > uint_max) {
814 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
815 : PyLong_Type.tp_name, uint_max, test_var);
816 0 : return -1;
817 : }
818 0 : object->last_logoff = test_var;
819 : } else {
820 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
821 : PyLong_Type.tp_name);
822 0 : return -1;
823 : }
824 : }
825 0 : return 0;
826 : }
827 :
828 0 : static PyObject *py_auth_user_info_get_acct_expiry(PyObject *obj, void *closure)
829 : {
830 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
831 0 : PyObject *py_acct_expiry;
832 0 : py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry);
833 0 : return py_acct_expiry;
834 : }
835 :
836 0 : static int py_auth_user_info_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
837 : {
838 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
839 0 : if (value == NULL) {
840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry");
841 0 : return -1;
842 : }
843 : {
844 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry));
845 0 : if (PyLong_Check(value)) {
846 0 : unsigned long long test_var;
847 0 : test_var = PyLong_AsUnsignedLongLong(value);
848 0 : if (PyErr_Occurred() != NULL) {
849 0 : return -1;
850 : }
851 0 : if (test_var > uint_max) {
852 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
853 : PyLong_Type.tp_name, uint_max, test_var);
854 0 : return -1;
855 : }
856 0 : object->acct_expiry = test_var;
857 : } else {
858 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
859 : PyLong_Type.tp_name);
860 0 : return -1;
861 : }
862 : }
863 0 : return 0;
864 : }
865 :
866 0 : static PyObject *py_auth_user_info_get_last_password_change(PyObject *obj, void *closure)
867 : {
868 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
869 0 : PyObject *py_last_password_change;
870 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
871 0 : return py_last_password_change;
872 : }
873 :
874 0 : static int py_auth_user_info_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
875 : {
876 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
877 0 : if (value == NULL) {
878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
879 0 : return -1;
880 : }
881 : {
882 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
883 0 : if (PyLong_Check(value)) {
884 0 : unsigned long long test_var;
885 0 : test_var = PyLong_AsUnsignedLongLong(value);
886 0 : if (PyErr_Occurred() != NULL) {
887 0 : return -1;
888 : }
889 0 : if (test_var > uint_max) {
890 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
891 : PyLong_Type.tp_name, uint_max, test_var);
892 0 : return -1;
893 : }
894 0 : object->last_password_change = test_var;
895 : } else {
896 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
897 : PyLong_Type.tp_name);
898 0 : return -1;
899 : }
900 : }
901 0 : return 0;
902 : }
903 :
904 0 : static PyObject *py_auth_user_info_get_allow_password_change(PyObject *obj, void *closure)
905 : {
906 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
907 0 : PyObject *py_allow_password_change;
908 0 : py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change);
909 0 : return py_allow_password_change;
910 : }
911 :
912 0 : static int py_auth_user_info_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
913 : {
914 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
915 0 : if (value == NULL) {
916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change");
917 0 : return -1;
918 : }
919 : {
920 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change));
921 0 : if (PyLong_Check(value)) {
922 0 : unsigned long long test_var;
923 0 : test_var = PyLong_AsUnsignedLongLong(value);
924 0 : if (PyErr_Occurred() != NULL) {
925 0 : return -1;
926 : }
927 0 : if (test_var > uint_max) {
928 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
929 : PyLong_Type.tp_name, uint_max, test_var);
930 0 : return -1;
931 : }
932 0 : object->allow_password_change = test_var;
933 : } else {
934 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
935 : PyLong_Type.tp_name);
936 0 : return -1;
937 : }
938 : }
939 0 : return 0;
940 : }
941 :
942 0 : static PyObject *py_auth_user_info_get_force_password_change(PyObject *obj, void *closure)
943 : {
944 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
945 0 : PyObject *py_force_password_change;
946 0 : py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change);
947 0 : return py_force_password_change;
948 : }
949 :
950 0 : static int py_auth_user_info_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
951 : {
952 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
953 0 : if (value == NULL) {
954 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change");
955 0 : return -1;
956 : }
957 : {
958 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change));
959 0 : if (PyLong_Check(value)) {
960 0 : unsigned long long test_var;
961 0 : test_var = PyLong_AsUnsignedLongLong(value);
962 0 : if (PyErr_Occurred() != NULL) {
963 0 : return -1;
964 : }
965 0 : if (test_var > uint_max) {
966 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
967 : PyLong_Type.tp_name, uint_max, test_var);
968 0 : return -1;
969 : }
970 0 : object->force_password_change = test_var;
971 : } else {
972 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
973 : PyLong_Type.tp_name);
974 0 : return -1;
975 : }
976 : }
977 0 : return 0;
978 : }
979 :
980 0 : static PyObject *py_auth_user_info_get_logon_count(PyObject *obj, void *closure)
981 : {
982 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
983 0 : PyObject *py_logon_count;
984 0 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
985 0 : return py_logon_count;
986 : }
987 :
988 0 : static int py_auth_user_info_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
989 : {
990 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
991 0 : if (value == NULL) {
992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
993 0 : return -1;
994 : }
995 : {
996 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
997 0 : if (PyLong_Check(value)) {
998 0 : unsigned long long test_var;
999 0 : test_var = PyLong_AsUnsignedLongLong(value);
1000 0 : if (PyErr_Occurred() != NULL) {
1001 0 : return -1;
1002 : }
1003 0 : if (test_var > uint_max) {
1004 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1005 : PyLong_Type.tp_name, uint_max, test_var);
1006 0 : return -1;
1007 : }
1008 0 : object->logon_count = test_var;
1009 : } else {
1010 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1011 : PyLong_Type.tp_name);
1012 0 : return -1;
1013 : }
1014 : }
1015 0 : return 0;
1016 : }
1017 :
1018 0 : static PyObject *py_auth_user_info_get_bad_password_count(PyObject *obj, void *closure)
1019 : {
1020 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
1021 0 : PyObject *py_bad_password_count;
1022 0 : py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count);
1023 0 : return py_bad_password_count;
1024 : }
1025 :
1026 0 : static int py_auth_user_info_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
1027 : {
1028 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
1029 0 : if (value == NULL) {
1030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count");
1031 0 : return -1;
1032 : }
1033 : {
1034 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count));
1035 0 : if (PyLong_Check(value)) {
1036 0 : unsigned long long test_var;
1037 0 : test_var = PyLong_AsUnsignedLongLong(value);
1038 0 : if (PyErr_Occurred() != NULL) {
1039 0 : return -1;
1040 : }
1041 0 : if (test_var > uint_max) {
1042 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1043 : PyLong_Type.tp_name, uint_max, test_var);
1044 0 : return -1;
1045 : }
1046 0 : object->bad_password_count = test_var;
1047 : } else {
1048 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1049 : PyLong_Type.tp_name);
1050 0 : return -1;
1051 : }
1052 : }
1053 0 : return 0;
1054 : }
1055 :
1056 0 : static PyObject *py_auth_user_info_get_acct_flags(PyObject *obj, void *closure)
1057 : {
1058 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
1059 0 : PyObject *py_acct_flags;
1060 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
1061 0 : return py_acct_flags;
1062 : }
1063 :
1064 0 : static int py_auth_user_info_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
1065 : {
1066 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
1067 0 : if (value == NULL) {
1068 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
1069 0 : return -1;
1070 : }
1071 : {
1072 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
1073 0 : if (PyLong_Check(value)) {
1074 0 : unsigned long long test_var;
1075 0 : test_var = PyLong_AsUnsignedLongLong(value);
1076 0 : if (PyErr_Occurred() != NULL) {
1077 0 : return -1;
1078 : }
1079 0 : if (test_var > uint_max) {
1080 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1081 : PyLong_Type.tp_name, uint_max, test_var);
1082 0 : return -1;
1083 : }
1084 0 : object->acct_flags = test_var;
1085 : } else {
1086 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1087 : PyLong_Type.tp_name);
1088 0 : return -1;
1089 : }
1090 : }
1091 0 : return 0;
1092 : }
1093 :
1094 0 : static PyObject *py_auth_user_info_get_user_flags(PyObject *obj, void *closure)
1095 : {
1096 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(obj);
1097 0 : PyObject *py_user_flags;
1098 0 : py_user_flags = PyLong_FromUnsignedLongLong((uint32_t)object->user_flags);
1099 0 : return py_user_flags;
1100 : }
1101 :
1102 0 : static int py_auth_user_info_set_user_flags(PyObject *py_obj, PyObject *value, void *closure)
1103 : {
1104 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
1105 0 : if (value == NULL) {
1106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_flags");
1107 0 : return -1;
1108 : }
1109 : {
1110 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags));
1111 0 : if (PyLong_Check(value)) {
1112 0 : unsigned long long test_var;
1113 0 : test_var = PyLong_AsUnsignedLongLong(value);
1114 0 : if (PyErr_Occurred() != NULL) {
1115 0 : return -1;
1116 : }
1117 0 : if (test_var > uint_max) {
1118 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1119 : PyLong_Type.tp_name, uint_max, test_var);
1120 0 : return -1;
1121 : }
1122 0 : object->user_flags = test_var;
1123 : } else {
1124 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1125 : PyLong_Type.tp_name);
1126 0 : return -1;
1127 : }
1128 : }
1129 0 : return 0;
1130 : }
1131 :
1132 : static PyGetSetDef py_auth_user_info_getsetters[] = {
1133 : {
1134 : .name = discard_const_p(char, "account_name"),
1135 : .get = py_auth_user_info_get_account_name,
1136 : .set = py_auth_user_info_set_account_name,
1137 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1138 : },
1139 : {
1140 : .name = discard_const_p(char, "user_principal_name"),
1141 : .get = py_auth_user_info_get_user_principal_name,
1142 : .set = py_auth_user_info_set_user_principal_name,
1143 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1144 : },
1145 : {
1146 : .name = discard_const_p(char, "user_principal_constructed"),
1147 : .get = py_auth_user_info_get_user_principal_constructed,
1148 : .set = py_auth_user_info_set_user_principal_constructed,
1149 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1150 : },
1151 : {
1152 : .name = discard_const_p(char, "domain_name"),
1153 : .get = py_auth_user_info_get_domain_name,
1154 : .set = py_auth_user_info_set_domain_name,
1155 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1156 : },
1157 : {
1158 : .name = discard_const_p(char, "dns_domain_name"),
1159 : .get = py_auth_user_info_get_dns_domain_name,
1160 : .set = py_auth_user_info_set_dns_domain_name,
1161 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1162 : },
1163 : {
1164 : .name = discard_const_p(char, "full_name"),
1165 : .get = py_auth_user_info_get_full_name,
1166 : .set = py_auth_user_info_set_full_name,
1167 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1168 : },
1169 : {
1170 : .name = discard_const_p(char, "logon_script"),
1171 : .get = py_auth_user_info_get_logon_script,
1172 : .set = py_auth_user_info_set_logon_script,
1173 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1174 : },
1175 : {
1176 : .name = discard_const_p(char, "profile_path"),
1177 : .get = py_auth_user_info_get_profile_path,
1178 : .set = py_auth_user_info_set_profile_path,
1179 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1180 : },
1181 : {
1182 : .name = discard_const_p(char, "home_directory"),
1183 : .get = py_auth_user_info_get_home_directory,
1184 : .set = py_auth_user_info_set_home_directory,
1185 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1186 : },
1187 : {
1188 : .name = discard_const_p(char, "home_drive"),
1189 : .get = py_auth_user_info_get_home_drive,
1190 : .set = py_auth_user_info_set_home_drive,
1191 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1192 : },
1193 : {
1194 : .name = discard_const_p(char, "logon_server"),
1195 : .get = py_auth_user_info_get_logon_server,
1196 : .set = py_auth_user_info_set_logon_server,
1197 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1198 : },
1199 : {
1200 : .name = discard_const_p(char, "last_logon"),
1201 : .get = py_auth_user_info_get_last_logon,
1202 : .set = py_auth_user_info_set_last_logon,
1203 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1204 : },
1205 : {
1206 : .name = discard_const_p(char, "last_logoff"),
1207 : .get = py_auth_user_info_get_last_logoff,
1208 : .set = py_auth_user_info_set_last_logoff,
1209 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1210 : },
1211 : {
1212 : .name = discard_const_p(char, "acct_expiry"),
1213 : .get = py_auth_user_info_get_acct_expiry,
1214 : .set = py_auth_user_info_set_acct_expiry,
1215 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1216 : },
1217 : {
1218 : .name = discard_const_p(char, "last_password_change"),
1219 : .get = py_auth_user_info_get_last_password_change,
1220 : .set = py_auth_user_info_set_last_password_change,
1221 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1222 : },
1223 : {
1224 : .name = discard_const_p(char, "allow_password_change"),
1225 : .get = py_auth_user_info_get_allow_password_change,
1226 : .set = py_auth_user_info_set_allow_password_change,
1227 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1228 : },
1229 : {
1230 : .name = discard_const_p(char, "force_password_change"),
1231 : .get = py_auth_user_info_get_force_password_change,
1232 : .set = py_auth_user_info_set_force_password_change,
1233 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1234 : },
1235 : {
1236 : .name = discard_const_p(char, "logon_count"),
1237 : .get = py_auth_user_info_get_logon_count,
1238 : .set = py_auth_user_info_set_logon_count,
1239 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1240 : },
1241 : {
1242 : .name = discard_const_p(char, "bad_password_count"),
1243 : .get = py_auth_user_info_get_bad_password_count,
1244 : .set = py_auth_user_info_set_bad_password_count,
1245 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1246 : },
1247 : {
1248 : .name = discard_const_p(char, "acct_flags"),
1249 : .get = py_auth_user_info_get_acct_flags,
1250 : .set = py_auth_user_info_set_acct_flags,
1251 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1252 : },
1253 : {
1254 : .name = discard_const_p(char, "user_flags"),
1255 : .get = py_auth_user_info_get_user_flags,
1256 : .set = py_auth_user_info_set_user_flags,
1257 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1258 : },
1259 : { .name = NULL }
1260 : };
1261 :
1262 0 : static PyObject *py_auth_user_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1263 : {
1264 0 : return pytalloc_new(struct auth_user_info, type);
1265 : }
1266 :
1267 0 : static PyObject *py_auth_user_info_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1268 : {
1269 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
1270 0 : PyObject *ret = NULL;
1271 0 : DATA_BLOB blob;
1272 0 : enum ndr_err_code err;
1273 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1274 0 : if (tmp_ctx == NULL) {
1275 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1276 0 : return NULL;
1277 : }
1278 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_user_info);
1279 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1280 0 : TALLOC_FREE(tmp_ctx);
1281 0 : PyErr_SetNdrError(err);
1282 0 : return NULL;
1283 : }
1284 :
1285 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1286 0 : TALLOC_FREE(tmp_ctx);
1287 0 : return ret;
1288 : }
1289 :
1290 0 : static PyObject *py_auth_user_info_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1291 : {
1292 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
1293 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1294 0 : Py_ssize_t blob_length = 0;
1295 0 : enum ndr_err_code err;
1296 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1297 0 : PyObject *allow_remaining_obj = NULL;
1298 0 : bool allow_remaining = false;
1299 :
1300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1301 : discard_const_p(char *, kwnames),
1302 : &blob.data, &blob_length,
1303 : &allow_remaining_obj)) {
1304 0 : return NULL;
1305 : }
1306 0 : blob.length = blob_length;
1307 :
1308 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1309 0 : allow_remaining = true;
1310 : }
1311 :
1312 0 : if (allow_remaining) {
1313 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info);
1314 : } else {
1315 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info);
1316 : }
1317 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1318 0 : PyErr_SetNdrError(err);
1319 0 : return NULL;
1320 : }
1321 :
1322 0 : Py_RETURN_NONE;
1323 : }
1324 :
1325 0 : static PyObject *py_auth_user_info_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1326 : {
1327 0 : struct auth_user_info *object = (struct auth_user_info *)pytalloc_get_ptr(py_obj);
1328 0 : PyObject *ret;
1329 0 : char *retstr;
1330 :
1331 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_user_info, "auth_user_info", object);
1332 0 : ret = PyUnicode_FromString(retstr);
1333 0 : talloc_free(retstr);
1334 :
1335 0 : return ret;
1336 : }
1337 :
1338 : static PyMethodDef py_auth_user_info_methods[] = {
1339 : { "__ndr_pack__", (PyCFunction)py_auth_user_info_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1340 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_user_info_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1341 : { "__ndr_print__", (PyCFunction)py_auth_user_info_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1342 : { NULL, NULL, 0, NULL }
1343 : };
1344 :
1345 :
1346 : static PyTypeObject auth_user_info_Type = {
1347 : PyVarObject_HEAD_INIT(NULL, 0)
1348 : .tp_name = "auth.user_info",
1349 : .tp_getset = py_auth_user_info_getsetters,
1350 : .tp_methods = py_auth_user_info_methods,
1351 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1352 : .tp_new = py_auth_user_info_new,
1353 : };
1354 :
1355 :
1356 0 : static PyObject *py_auth_user_info_torture_get_num_dc_sids(PyObject *obj, void *closure)
1357 : {
1358 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(obj);
1359 0 : PyObject *py_num_dc_sids;
1360 0 : py_num_dc_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_dc_sids);
1361 0 : return py_num_dc_sids;
1362 : }
1363 :
1364 0 : static int py_auth_user_info_torture_set_num_dc_sids(PyObject *py_obj, PyObject *value, void *closure)
1365 : {
1366 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(py_obj);
1367 0 : if (value == NULL) {
1368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_dc_sids");
1369 0 : return -1;
1370 : }
1371 : {
1372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_dc_sids));
1373 0 : if (PyLong_Check(value)) {
1374 0 : unsigned long long test_var;
1375 0 : test_var = PyLong_AsUnsignedLongLong(value);
1376 0 : if (PyErr_Occurred() != NULL) {
1377 0 : return -1;
1378 : }
1379 0 : if (test_var > uint_max) {
1380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1381 : PyLong_Type.tp_name, uint_max, test_var);
1382 0 : return -1;
1383 : }
1384 0 : object->num_dc_sids = test_var;
1385 : } else {
1386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1387 : PyLong_Type.tp_name);
1388 0 : return -1;
1389 : }
1390 : }
1391 0 : return 0;
1392 : }
1393 :
1394 0 : static PyObject *py_auth_user_info_torture_get_dc_sids(PyObject *obj, void *closure)
1395 : {
1396 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(obj);
1397 0 : PyObject *py_dc_sids;
1398 0 : py_dc_sids = PyList_New(object->num_dc_sids);
1399 0 : if (py_dc_sids == NULL) {
1400 0 : return NULL;
1401 : }
1402 : {
1403 : int dc_sids_cntr_0;
1404 0 : for (dc_sids_cntr_0 = 0; dc_sids_cntr_0 < (object->num_dc_sids); dc_sids_cntr_0++) {
1405 0 : PyObject *py_dc_sids_0;
1406 0 : py_dc_sids_0 = pytalloc_reference_ex(&auth_SidAttr_Type, object->dc_sids, &object->dc_sids[dc_sids_cntr_0]);
1407 0 : PyList_SetItem(py_dc_sids, dc_sids_cntr_0, py_dc_sids_0);
1408 : }
1409 : }
1410 0 : return py_dc_sids;
1411 : }
1412 :
1413 0 : static int py_auth_user_info_torture_set_dc_sids(PyObject *py_obj, PyObject *value, void *closure)
1414 : {
1415 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(py_obj);
1416 0 : if (value == NULL) {
1417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_sids");
1418 0 : return -1;
1419 : }
1420 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1421 : {
1422 0 : int dc_sids_cntr_0;
1423 0 : object->dc_sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->dc_sids, PyList_GET_SIZE(value));
1424 0 : if (!object->dc_sids) { return -1; }
1425 0 : talloc_set_name_const(object->dc_sids, "ARRAY: object->dc_sids");
1426 0 : for (dc_sids_cntr_0 = 0; dc_sids_cntr_0 < PyList_GET_SIZE(value); dc_sids_cntr_0++) {
1427 0 : if (PyList_GET_ITEM(value, dc_sids_cntr_0) == NULL) {
1428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_sids[dc_sids_cntr_0]");
1429 0 : return -1;
1430 : }
1431 0 : PY_CHECK_TYPE(&auth_SidAttr_Type, PyList_GET_ITEM(value, dc_sids_cntr_0), return -1;);
1432 0 : if (talloc_reference(object->dc_sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, dc_sids_cntr_0))) == NULL) {
1433 0 : PyErr_NoMemory();
1434 0 : return -1;
1435 : }
1436 0 : object->dc_sids[dc_sids_cntr_0] = *(struct auth_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, dc_sids_cntr_0));
1437 : }
1438 : }
1439 0 : return 0;
1440 : }
1441 :
1442 : static PyGetSetDef py_auth_user_info_torture_getsetters[] = {
1443 : {
1444 : .name = discard_const_p(char, "num_dc_sids"),
1445 : .get = py_auth_user_info_torture_get_num_dc_sids,
1446 : .set = py_auth_user_info_torture_set_num_dc_sids,
1447 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1448 : },
1449 : {
1450 : .name = discard_const_p(char, "dc_sids"),
1451 : .get = py_auth_user_info_torture_get_dc_sids,
1452 : .set = py_auth_user_info_torture_set_dc_sids,
1453 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_SidAttr")
1454 : },
1455 : { .name = NULL }
1456 : };
1457 :
1458 0 : static PyObject *py_auth_user_info_torture_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1459 : {
1460 0 : return pytalloc_new(struct auth_user_info_torture, type);
1461 : }
1462 :
1463 0 : static PyObject *py_auth_user_info_torture_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1464 : {
1465 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(py_obj);
1466 0 : PyObject *ret = NULL;
1467 0 : DATA_BLOB blob;
1468 0 : enum ndr_err_code err;
1469 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1470 0 : if (tmp_ctx == NULL) {
1471 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1472 0 : return NULL;
1473 : }
1474 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_user_info_torture);
1475 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1476 0 : TALLOC_FREE(tmp_ctx);
1477 0 : PyErr_SetNdrError(err);
1478 0 : return NULL;
1479 : }
1480 :
1481 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1482 0 : TALLOC_FREE(tmp_ctx);
1483 0 : return ret;
1484 : }
1485 :
1486 0 : static PyObject *py_auth_user_info_torture_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1487 : {
1488 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(py_obj);
1489 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1490 0 : Py_ssize_t blob_length = 0;
1491 0 : enum ndr_err_code err;
1492 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1493 0 : PyObject *allow_remaining_obj = NULL;
1494 0 : bool allow_remaining = false;
1495 :
1496 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1497 : discard_const_p(char *, kwnames),
1498 : &blob.data, &blob_length,
1499 : &allow_remaining_obj)) {
1500 0 : return NULL;
1501 : }
1502 0 : blob.length = blob_length;
1503 :
1504 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1505 0 : allow_remaining = true;
1506 : }
1507 :
1508 0 : if (allow_remaining) {
1509 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info_torture);
1510 : } else {
1511 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info_torture);
1512 : }
1513 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1514 0 : PyErr_SetNdrError(err);
1515 0 : return NULL;
1516 : }
1517 :
1518 0 : Py_RETURN_NONE;
1519 : }
1520 :
1521 0 : static PyObject *py_auth_user_info_torture_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1522 : {
1523 0 : struct auth_user_info_torture *object = (struct auth_user_info_torture *)pytalloc_get_ptr(py_obj);
1524 0 : PyObject *ret;
1525 0 : char *retstr;
1526 :
1527 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_user_info_torture, "auth_user_info_torture", object);
1528 0 : ret = PyUnicode_FromString(retstr);
1529 0 : talloc_free(retstr);
1530 :
1531 0 : return ret;
1532 : }
1533 :
1534 : static PyMethodDef py_auth_user_info_torture_methods[] = {
1535 : { "__ndr_pack__", (PyCFunction)py_auth_user_info_torture_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1536 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_user_info_torture_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1537 : { "__ndr_print__", (PyCFunction)py_auth_user_info_torture_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1538 : { NULL, NULL, 0, NULL }
1539 : };
1540 :
1541 :
1542 : static PyTypeObject auth_user_info_torture_Type = {
1543 : PyVarObject_HEAD_INIT(NULL, 0)
1544 : .tp_name = "auth.user_info_torture",
1545 : .tp_getset = py_auth_user_info_torture_getsetters,
1546 : .tp_methods = py_auth_user_info_torture_methods,
1547 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1548 : .tp_new = py_auth_user_info_torture_new,
1549 : };
1550 :
1551 :
1552 1 : static PyObject *py_auth_user_info_unix_get_unix_name(PyObject *obj, void *closure)
1553 : {
1554 1 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(obj);
1555 0 : PyObject *py_unix_name;
1556 1 : if (object->unix_name == NULL) {
1557 0 : Py_RETURN_NONE;
1558 : }
1559 1 : if (object->unix_name == NULL) {
1560 0 : py_unix_name = Py_None;
1561 0 : Py_INCREF(py_unix_name);
1562 : } else {
1563 1 : if (object->unix_name == NULL) {
1564 0 : py_unix_name = Py_None;
1565 0 : Py_INCREF(py_unix_name);
1566 : } else {
1567 1 : py_unix_name = PyUnicode_Decode(object->unix_name, strlen(object->unix_name), "utf-8", "ignore");
1568 : }
1569 : }
1570 1 : return py_unix_name;
1571 : }
1572 :
1573 0 : static int py_auth_user_info_unix_set_unix_name(PyObject *py_obj, PyObject *value, void *closure)
1574 : {
1575 0 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(py_obj);
1576 0 : if (value == NULL) {
1577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unix_name");
1578 0 : return -1;
1579 : }
1580 0 : if (value == Py_None) {
1581 0 : object->unix_name = NULL;
1582 : } else {
1583 0 : object->unix_name = NULL;
1584 : {
1585 0 : const char *test_str;
1586 0 : const char *talloc_str;
1587 0 : PyObject *unicode = NULL;
1588 0 : if (PyUnicode_Check(value)) {
1589 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1590 0 : if (unicode == NULL) {
1591 0 : PyErr_NoMemory();
1592 0 : return -1;
1593 : }
1594 0 : test_str = PyBytes_AS_STRING(unicode);
1595 0 : } else if (PyBytes_Check(value)) {
1596 0 : test_str = PyBytes_AS_STRING(value);
1597 : } else {
1598 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1599 0 : return -1;
1600 : }
1601 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1602 0 : if (unicode != NULL) {
1603 0 : Py_DECREF(unicode);
1604 : }
1605 0 : if (talloc_str == NULL) {
1606 0 : PyErr_NoMemory();
1607 0 : return -1;
1608 : }
1609 0 : object->unix_name = talloc_str;
1610 : }
1611 : }
1612 0 : return 0;
1613 : }
1614 :
1615 1 : static PyObject *py_auth_user_info_unix_get_sanitized_username(PyObject *obj, void *closure)
1616 : {
1617 1 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(obj);
1618 0 : PyObject *py_sanitized_username;
1619 1 : if (object->sanitized_username == NULL) {
1620 0 : Py_RETURN_NONE;
1621 : }
1622 1 : if (object->sanitized_username == NULL) {
1623 0 : py_sanitized_username = Py_None;
1624 0 : Py_INCREF(py_sanitized_username);
1625 : } else {
1626 1 : if (object->sanitized_username == NULL) {
1627 0 : py_sanitized_username = Py_None;
1628 0 : Py_INCREF(py_sanitized_username);
1629 : } else {
1630 1 : py_sanitized_username = PyUnicode_Decode(object->sanitized_username, strlen(object->sanitized_username), "utf-8", "ignore");
1631 : }
1632 : }
1633 1 : return py_sanitized_username;
1634 : }
1635 :
1636 0 : static int py_auth_user_info_unix_set_sanitized_username(PyObject *py_obj, PyObject *value, void *closure)
1637 : {
1638 0 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(py_obj);
1639 0 : if (value == NULL) {
1640 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sanitized_username");
1641 0 : return -1;
1642 : }
1643 0 : if (value == Py_None) {
1644 0 : object->sanitized_username = NULL;
1645 : } else {
1646 0 : object->sanitized_username = NULL;
1647 : {
1648 0 : const char *test_str;
1649 0 : const char *talloc_str;
1650 0 : PyObject *unicode = NULL;
1651 0 : if (PyUnicode_Check(value)) {
1652 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1653 0 : if (unicode == NULL) {
1654 0 : PyErr_NoMemory();
1655 0 : return -1;
1656 : }
1657 0 : test_str = PyBytes_AS_STRING(unicode);
1658 0 : } else if (PyBytes_Check(value)) {
1659 0 : test_str = PyBytes_AS_STRING(value);
1660 : } else {
1661 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1662 0 : return -1;
1663 : }
1664 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1665 0 : if (unicode != NULL) {
1666 0 : Py_DECREF(unicode);
1667 : }
1668 0 : if (talloc_str == NULL) {
1669 0 : PyErr_NoMemory();
1670 0 : return -1;
1671 : }
1672 0 : object->sanitized_username = talloc_str;
1673 : }
1674 : }
1675 0 : return 0;
1676 : }
1677 :
1678 : static PyGetSetDef py_auth_user_info_unix_getsetters[] = {
1679 : {
1680 : .name = discard_const_p(char, "unix_name"),
1681 : .get = py_auth_user_info_unix_get_unix_name,
1682 : .set = py_auth_user_info_unix_set_unix_name,
1683 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1684 : },
1685 : {
1686 : .name = discard_const_p(char, "sanitized_username"),
1687 : .get = py_auth_user_info_unix_get_sanitized_username,
1688 : .set = py_auth_user_info_unix_set_sanitized_username,
1689 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1690 : },
1691 : { .name = NULL }
1692 : };
1693 :
1694 0 : static PyObject *py_auth_user_info_unix_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1695 : {
1696 0 : return pytalloc_new(struct auth_user_info_unix, type);
1697 : }
1698 :
1699 0 : static PyObject *py_auth_user_info_unix_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1700 : {
1701 0 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(py_obj);
1702 0 : PyObject *ret = NULL;
1703 0 : DATA_BLOB blob;
1704 0 : enum ndr_err_code err;
1705 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1706 0 : if (tmp_ctx == NULL) {
1707 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1708 0 : return NULL;
1709 : }
1710 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_user_info_unix);
1711 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1712 0 : TALLOC_FREE(tmp_ctx);
1713 0 : PyErr_SetNdrError(err);
1714 0 : return NULL;
1715 : }
1716 :
1717 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1718 0 : TALLOC_FREE(tmp_ctx);
1719 0 : return ret;
1720 : }
1721 :
1722 0 : static PyObject *py_auth_user_info_unix_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1723 : {
1724 0 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(py_obj);
1725 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1726 0 : Py_ssize_t blob_length = 0;
1727 0 : enum ndr_err_code err;
1728 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1729 0 : PyObject *allow_remaining_obj = NULL;
1730 0 : bool allow_remaining = false;
1731 :
1732 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1733 : discard_const_p(char *, kwnames),
1734 : &blob.data, &blob_length,
1735 : &allow_remaining_obj)) {
1736 0 : return NULL;
1737 : }
1738 0 : blob.length = blob_length;
1739 :
1740 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1741 0 : allow_remaining = true;
1742 : }
1743 :
1744 0 : if (allow_remaining) {
1745 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info_unix);
1746 : } else {
1747 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info_unix);
1748 : }
1749 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1750 0 : PyErr_SetNdrError(err);
1751 0 : return NULL;
1752 : }
1753 :
1754 0 : Py_RETURN_NONE;
1755 : }
1756 :
1757 0 : static PyObject *py_auth_user_info_unix_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1758 : {
1759 0 : struct auth_user_info_unix *object = (struct auth_user_info_unix *)pytalloc_get_ptr(py_obj);
1760 0 : PyObject *ret;
1761 0 : char *retstr;
1762 :
1763 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_user_info_unix, "auth_user_info_unix", object);
1764 0 : ret = PyUnicode_FromString(retstr);
1765 0 : talloc_free(retstr);
1766 :
1767 0 : return ret;
1768 : }
1769 :
1770 : static PyMethodDef py_auth_user_info_unix_methods[] = {
1771 : { "__ndr_pack__", (PyCFunction)py_auth_user_info_unix_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1772 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_user_info_unix_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1773 : { "__ndr_print__", (PyCFunction)py_auth_user_info_unix_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1774 : { NULL, NULL, 0, NULL }
1775 : };
1776 :
1777 :
1778 : static PyTypeObject auth_user_info_unix_Type = {
1779 : PyVarObject_HEAD_INIT(NULL, 0)
1780 : .tp_name = "auth.user_info_unix",
1781 : .tp_getset = py_auth_user_info_unix_getsetters,
1782 : .tp_methods = py_auth_user_info_unix_methods,
1783 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1784 : .tp_new = py_auth_user_info_unix_new,
1785 : };
1786 :
1787 :
1788 0 : static PyObject *py_auth_SidAttr_get_sid(PyObject *obj, void *closure)
1789 : {
1790 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(obj);
1791 0 : PyObject *py_sid;
1792 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
1793 0 : return py_sid;
1794 : }
1795 :
1796 0 : static int py_auth_SidAttr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
1797 : {
1798 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(py_obj);
1799 0 : if (value == NULL) {
1800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
1801 0 : return -1;
1802 : }
1803 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
1804 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1805 0 : PyErr_NoMemory();
1806 0 : return -1;
1807 : }
1808 0 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
1809 0 : return 0;
1810 : }
1811 :
1812 0 : static PyObject *py_auth_SidAttr_get_attrs(PyObject *obj, void *closure)
1813 : {
1814 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(obj);
1815 0 : PyObject *py_attrs;
1816 0 : py_attrs = PyLong_FromUnsignedLongLong((uint32_t)object->attrs);
1817 0 : return py_attrs;
1818 : }
1819 :
1820 0 : static int py_auth_SidAttr_set_attrs(PyObject *py_obj, PyObject *value, void *closure)
1821 : {
1822 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(py_obj);
1823 0 : if (value == NULL) {
1824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrs");
1825 0 : return -1;
1826 : }
1827 : {
1828 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrs));
1829 0 : if (PyLong_Check(value)) {
1830 0 : unsigned long long test_var;
1831 0 : test_var = PyLong_AsUnsignedLongLong(value);
1832 0 : if (PyErr_Occurred() != NULL) {
1833 0 : return -1;
1834 : }
1835 0 : if (test_var > uint_max) {
1836 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1837 : PyLong_Type.tp_name, uint_max, test_var);
1838 0 : return -1;
1839 : }
1840 0 : object->attrs = test_var;
1841 : } else {
1842 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1843 : PyLong_Type.tp_name);
1844 0 : return -1;
1845 : }
1846 : }
1847 0 : return 0;
1848 : }
1849 :
1850 : static PyGetSetDef py_auth_SidAttr_getsetters[] = {
1851 : {
1852 : .name = discard_const_p(char, "sid"),
1853 : .get = py_auth_SidAttr_get_sid,
1854 : .set = py_auth_SidAttr_set_sid,
1855 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1856 : },
1857 : {
1858 : .name = discard_const_p(char, "attrs"),
1859 : .get = py_auth_SidAttr_get_attrs,
1860 : .set = py_auth_SidAttr_set_attrs,
1861 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
1862 : },
1863 : { .name = NULL }
1864 : };
1865 :
1866 0 : static PyObject *py_auth_SidAttr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1867 : {
1868 0 : return pytalloc_new(struct auth_SidAttr, type);
1869 : }
1870 :
1871 0 : static PyObject *py_auth_SidAttr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1872 : {
1873 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(py_obj);
1874 0 : PyObject *ret = NULL;
1875 0 : DATA_BLOB blob;
1876 0 : enum ndr_err_code err;
1877 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1878 0 : if (tmp_ctx == NULL) {
1879 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1880 0 : return NULL;
1881 : }
1882 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_SidAttr);
1883 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1884 0 : TALLOC_FREE(tmp_ctx);
1885 0 : PyErr_SetNdrError(err);
1886 0 : return NULL;
1887 : }
1888 :
1889 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1890 0 : TALLOC_FREE(tmp_ctx);
1891 0 : return ret;
1892 : }
1893 :
1894 0 : static PyObject *py_auth_SidAttr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1895 : {
1896 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(py_obj);
1897 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1898 0 : Py_ssize_t blob_length = 0;
1899 0 : enum ndr_err_code err;
1900 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1901 0 : PyObject *allow_remaining_obj = NULL;
1902 0 : bool allow_remaining = false;
1903 :
1904 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1905 : discard_const_p(char *, kwnames),
1906 : &blob.data, &blob_length,
1907 : &allow_remaining_obj)) {
1908 0 : return NULL;
1909 : }
1910 0 : blob.length = blob_length;
1911 :
1912 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1913 0 : allow_remaining = true;
1914 : }
1915 :
1916 0 : if (allow_remaining) {
1917 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_SidAttr);
1918 : } else {
1919 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_SidAttr);
1920 : }
1921 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1922 0 : PyErr_SetNdrError(err);
1923 0 : return NULL;
1924 : }
1925 :
1926 0 : Py_RETURN_NONE;
1927 : }
1928 :
1929 0 : static PyObject *py_auth_SidAttr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1930 : {
1931 0 : struct auth_SidAttr *object = (struct auth_SidAttr *)pytalloc_get_ptr(py_obj);
1932 0 : PyObject *ret;
1933 0 : char *retstr;
1934 :
1935 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_SidAttr, "auth_SidAttr", object);
1936 0 : ret = PyUnicode_FromString(retstr);
1937 0 : talloc_free(retstr);
1938 :
1939 0 : return ret;
1940 : }
1941 :
1942 : static PyMethodDef py_auth_SidAttr_methods[] = {
1943 : { "__ndr_pack__", (PyCFunction)py_auth_SidAttr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1944 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_SidAttr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1945 : { "__ndr_print__", (PyCFunction)py_auth_SidAttr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1946 : { NULL, NULL, 0, NULL }
1947 : };
1948 :
1949 :
1950 : static PyTypeObject auth_SidAttr_Type = {
1951 : PyVarObject_HEAD_INIT(NULL, 0)
1952 : .tp_name = "auth.SidAttr",
1953 : .tp_getset = py_auth_SidAttr_getsetters,
1954 : .tp_methods = py_auth_SidAttr_methods,
1955 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1956 : .tp_new = py_auth_SidAttr_new,
1957 : };
1958 :
1959 :
1960 0 : static PyObject *py_auth_user_info_dc_get_num_sids(PyObject *obj, void *closure)
1961 : {
1962 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(obj);
1963 0 : PyObject *py_num_sids;
1964 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
1965 0 : return py_num_sids;
1966 : }
1967 :
1968 0 : static int py_auth_user_info_dc_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
1969 : {
1970 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
1971 0 : if (value == NULL) {
1972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
1973 0 : return -1;
1974 : }
1975 : {
1976 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
1977 0 : if (PyLong_Check(value)) {
1978 0 : unsigned long long test_var;
1979 0 : test_var = PyLong_AsUnsignedLongLong(value);
1980 0 : if (PyErr_Occurred() != NULL) {
1981 0 : return -1;
1982 : }
1983 0 : if (test_var > uint_max) {
1984 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1985 : PyLong_Type.tp_name, uint_max, test_var);
1986 0 : return -1;
1987 : }
1988 0 : object->num_sids = test_var;
1989 : } else {
1990 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1991 : PyLong_Type.tp_name);
1992 0 : return -1;
1993 : }
1994 : }
1995 0 : return 0;
1996 : }
1997 :
1998 0 : static PyObject *py_auth_user_info_dc_get_sids(PyObject *obj, void *closure)
1999 : {
2000 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(obj);
2001 0 : PyObject *py_sids;
2002 0 : py_sids = PyList_New(object->num_sids);
2003 0 : if (py_sids == NULL) {
2004 0 : return NULL;
2005 : }
2006 : {
2007 : int sids_cntr_0;
2008 0 : for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
2009 0 : PyObject *py_sids_0;
2010 0 : py_sids_0 = pytalloc_reference_ex(&auth_SidAttr_Type, object->sids, &object->sids[sids_cntr_0]);
2011 0 : PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
2012 : }
2013 : }
2014 0 : return py_sids;
2015 : }
2016 :
2017 0 : static int py_auth_user_info_dc_set_sids(PyObject *py_obj, PyObject *value, void *closure)
2018 : {
2019 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2020 0 : if (value == NULL) {
2021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
2022 0 : return -1;
2023 : }
2024 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2025 : {
2026 0 : int sids_cntr_0;
2027 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
2028 0 : if (!object->sids) { return -1; }
2029 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
2030 0 : for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
2031 0 : if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
2032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_0]");
2033 0 : return -1;
2034 : }
2035 0 : PY_CHECK_TYPE(&auth_SidAttr_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
2036 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
2037 0 : PyErr_NoMemory();
2038 0 : return -1;
2039 : }
2040 0 : object->sids[sids_cntr_0] = *(struct auth_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
2041 : }
2042 : }
2043 0 : return 0;
2044 : }
2045 :
2046 0 : static PyObject *py_auth_user_info_dc_get_info(PyObject *obj, void *closure)
2047 : {
2048 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(obj);
2049 0 : PyObject *py_info;
2050 0 : if (object->info == NULL) {
2051 0 : Py_RETURN_NONE;
2052 : }
2053 0 : if (object->info == NULL) {
2054 0 : py_info = Py_None;
2055 0 : Py_INCREF(py_info);
2056 : } else {
2057 0 : py_info = pytalloc_reference_ex(&auth_user_info_Type, object->info, object->info);
2058 : }
2059 0 : return py_info;
2060 : }
2061 :
2062 0 : static int py_auth_user_info_dc_set_info(PyObject *py_obj, PyObject *value, void *closure)
2063 : {
2064 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2065 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
2066 0 : if (value == NULL) {
2067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
2068 0 : return -1;
2069 : }
2070 0 : if (value == Py_None) {
2071 0 : object->info = NULL;
2072 : } else {
2073 0 : object->info = NULL;
2074 0 : PY_CHECK_TYPE(&auth_user_info_Type, value, return -1;);
2075 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2076 0 : PyErr_NoMemory();
2077 0 : return -1;
2078 : }
2079 0 : object->info = (struct auth_user_info *)pytalloc_get_ptr(value);
2080 : }
2081 0 : return 0;
2082 : }
2083 :
2084 0 : static PyObject *py_auth_user_info_dc_get_user_session_key(PyObject *obj, void *closure)
2085 : {
2086 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(obj);
2087 0 : PyObject *py_user_session_key;
2088 0 : py_user_session_key = PyBytes_FromStringAndSize((char *)(object->user_session_key).data, (object->user_session_key).length);
2089 0 : return py_user_session_key;
2090 : }
2091 :
2092 0 : static int py_auth_user_info_dc_set_user_session_key(PyObject *py_obj, PyObject *value, void *closure)
2093 : {
2094 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2095 0 : if (value == NULL) {
2096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_session_key");
2097 0 : return -1;
2098 : }
2099 0 : object->user_session_key = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2100 0 : return 0;
2101 : }
2102 :
2103 0 : static PyObject *py_auth_user_info_dc_get_lm_session_key(PyObject *obj, void *closure)
2104 : {
2105 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(obj);
2106 0 : PyObject *py_lm_session_key;
2107 0 : py_lm_session_key = PyBytes_FromStringAndSize((char *)(object->lm_session_key).data, (object->lm_session_key).length);
2108 0 : return py_lm_session_key;
2109 : }
2110 :
2111 0 : static int py_auth_user_info_dc_set_lm_session_key(PyObject *py_obj, PyObject *value, void *closure)
2112 : {
2113 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2114 0 : if (value == NULL) {
2115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_session_key");
2116 0 : return -1;
2117 : }
2118 0 : object->lm_session_key = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2119 0 : return 0;
2120 : }
2121 :
2122 0 : static PyObject *py_auth_user_info_dc_get_ticket_type(PyObject *obj, void *closure)
2123 : {
2124 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(obj);
2125 0 : PyObject *py_ticket_type;
2126 0 : py_ticket_type = PyLong_FromLong((uint16_t)object->ticket_type);
2127 0 : return py_ticket_type;
2128 : }
2129 :
2130 0 : static int py_auth_user_info_dc_set_ticket_type(PyObject *py_obj, PyObject *value, void *closure)
2131 : {
2132 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2133 0 : if (value == NULL) {
2134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ticket_type");
2135 0 : return -1;
2136 : }
2137 : {
2138 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ticket_type));
2139 0 : if (PyLong_Check(value)) {
2140 0 : unsigned long long test_var;
2141 0 : test_var = PyLong_AsUnsignedLongLong(value);
2142 0 : if (PyErr_Occurred() != NULL) {
2143 0 : return -1;
2144 : }
2145 0 : if (test_var > uint_max) {
2146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2147 : PyLong_Type.tp_name, uint_max, test_var);
2148 0 : return -1;
2149 : }
2150 0 : object->ticket_type = test_var;
2151 : } else {
2152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2153 : PyLong_Type.tp_name);
2154 0 : return -1;
2155 : }
2156 : }
2157 0 : return 0;
2158 : }
2159 :
2160 : static PyGetSetDef py_auth_user_info_dc_getsetters[] = {
2161 : {
2162 : .name = discard_const_p(char, "num_sids"),
2163 : .get = py_auth_user_info_dc_get_num_sids,
2164 : .set = py_auth_user_info_dc_set_num_sids,
2165 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2166 : },
2167 : {
2168 : .name = discard_const_p(char, "sids"),
2169 : .get = py_auth_user_info_dc_get_sids,
2170 : .set = py_auth_user_info_dc_set_sids,
2171 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_SidAttr")
2172 : },
2173 : {
2174 : .name = discard_const_p(char, "info"),
2175 : .get = py_auth_user_info_dc_get_info,
2176 : .set = py_auth_user_info_dc_set_info,
2177 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_user_info")
2178 : },
2179 : {
2180 : .name = discard_const_p(char, "user_session_key"),
2181 : .get = py_auth_user_info_dc_get_user_session_key,
2182 : .set = py_auth_user_info_dc_set_user_session_key,
2183 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2184 : },
2185 : {
2186 : .name = discard_const_p(char, "lm_session_key"),
2187 : .get = py_auth_user_info_dc_get_lm_session_key,
2188 : .set = py_auth_user_info_dc_set_lm_session_key,
2189 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2190 : },
2191 : {
2192 : .name = discard_const_p(char, "ticket_type"),
2193 : .get = py_auth_user_info_dc_get_ticket_type,
2194 : .set = py_auth_user_info_dc_set_ticket_type,
2195 : .doc = discard_const_p(char, "PIDL-generated element of base type ticket_type")
2196 : },
2197 : { .name = NULL }
2198 : };
2199 :
2200 0 : static PyObject *py_auth_user_info_dc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2201 : {
2202 0 : return pytalloc_new(struct auth_user_info_dc, type);
2203 : }
2204 :
2205 0 : static PyObject *py_auth_user_info_dc_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2206 : {
2207 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2208 0 : PyObject *ret = NULL;
2209 0 : DATA_BLOB blob;
2210 0 : enum ndr_err_code err;
2211 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2212 0 : if (tmp_ctx == NULL) {
2213 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2214 0 : return NULL;
2215 : }
2216 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_user_info_dc);
2217 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2218 0 : TALLOC_FREE(tmp_ctx);
2219 0 : PyErr_SetNdrError(err);
2220 0 : return NULL;
2221 : }
2222 :
2223 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2224 0 : TALLOC_FREE(tmp_ctx);
2225 0 : return ret;
2226 : }
2227 :
2228 0 : static PyObject *py_auth_user_info_dc_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2229 : {
2230 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2231 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2232 0 : Py_ssize_t blob_length = 0;
2233 0 : enum ndr_err_code err;
2234 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2235 0 : PyObject *allow_remaining_obj = NULL;
2236 0 : bool allow_remaining = false;
2237 :
2238 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2239 : discard_const_p(char *, kwnames),
2240 : &blob.data, &blob_length,
2241 : &allow_remaining_obj)) {
2242 0 : return NULL;
2243 : }
2244 0 : blob.length = blob_length;
2245 :
2246 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2247 0 : allow_remaining = true;
2248 : }
2249 :
2250 0 : if (allow_remaining) {
2251 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info_dc);
2252 : } else {
2253 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_user_info_dc);
2254 : }
2255 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2256 0 : PyErr_SetNdrError(err);
2257 0 : return NULL;
2258 : }
2259 :
2260 0 : Py_RETURN_NONE;
2261 : }
2262 :
2263 0 : static PyObject *py_auth_user_info_dc_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2264 : {
2265 0 : struct auth_user_info_dc *object = (struct auth_user_info_dc *)pytalloc_get_ptr(py_obj);
2266 0 : PyObject *ret;
2267 0 : char *retstr;
2268 :
2269 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_user_info_dc, "auth_user_info_dc", object);
2270 0 : ret = PyUnicode_FromString(retstr);
2271 0 : talloc_free(retstr);
2272 :
2273 0 : return ret;
2274 : }
2275 :
2276 : static PyMethodDef py_auth_user_info_dc_methods[] = {
2277 : { "__ndr_pack__", (PyCFunction)py_auth_user_info_dc_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2278 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_user_info_dc_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2279 : { "__ndr_print__", (PyCFunction)py_auth_user_info_dc_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2280 : { NULL, NULL, 0, NULL }
2281 : };
2282 :
2283 :
2284 : static PyTypeObject auth_user_info_dc_Type = {
2285 : PyVarObject_HEAD_INIT(NULL, 0)
2286 : .tp_name = "auth.user_info_dc",
2287 : .tp_getset = py_auth_user_info_dc_getsetters,
2288 : .tp_methods = py_auth_user_info_dc_methods,
2289 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2290 : .tp_new = py_auth_user_info_dc_new,
2291 : };
2292 :
2293 :
2294 351 : static PyObject *py_auth_session_info_get_security_token(PyObject *obj, void *closure)
2295 : {
2296 351 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2297 0 : PyObject *py_security_token;
2298 351 : if (object->security_token == NULL) {
2299 0 : Py_RETURN_NONE;
2300 : }
2301 351 : if (object->security_token == NULL) {
2302 0 : py_security_token = Py_None;
2303 0 : Py_INCREF(py_security_token);
2304 : } else {
2305 351 : py_security_token = pytalloc_reference_ex(security_token_Type, object->security_token, object->security_token);
2306 : }
2307 351 : return py_security_token;
2308 : }
2309 :
2310 0 : static int py_auth_session_info_set_security_token(PyObject *py_obj, PyObject *value, void *closure)
2311 : {
2312 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2313 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->security_token));
2314 0 : if (value == NULL) {
2315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->security_token");
2316 0 : return -1;
2317 : }
2318 0 : if (value == Py_None) {
2319 0 : object->security_token = NULL;
2320 : } else {
2321 0 : object->security_token = NULL;
2322 0 : PY_CHECK_TYPE(security_token_Type, value, return -1;);
2323 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2324 0 : PyErr_NoMemory();
2325 0 : return -1;
2326 : }
2327 0 : object->security_token = (struct security_token *)pytalloc_get_ptr(value);
2328 : }
2329 0 : return 0;
2330 : }
2331 :
2332 1 : static PyObject *py_auth_session_info_get_unix_token(PyObject *obj, void *closure)
2333 : {
2334 1 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2335 0 : PyObject *py_unix_token;
2336 1 : if (object->unix_token == NULL) {
2337 0 : Py_RETURN_NONE;
2338 : }
2339 1 : if (object->unix_token == NULL) {
2340 0 : py_unix_token = Py_None;
2341 0 : Py_INCREF(py_unix_token);
2342 : } else {
2343 1 : py_unix_token = pytalloc_reference_ex(security_unix_token_Type, object->unix_token, object->unix_token);
2344 : }
2345 1 : return py_unix_token;
2346 : }
2347 :
2348 0 : static int py_auth_session_info_set_unix_token(PyObject *py_obj, PyObject *value, void *closure)
2349 : {
2350 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2351 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->unix_token));
2352 0 : if (value == NULL) {
2353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unix_token");
2354 0 : return -1;
2355 : }
2356 0 : if (value == Py_None) {
2357 0 : object->unix_token = NULL;
2358 : } else {
2359 0 : object->unix_token = NULL;
2360 0 : PY_CHECK_TYPE(security_unix_token_Type, value, return -1;);
2361 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2362 0 : PyErr_NoMemory();
2363 0 : return -1;
2364 : }
2365 0 : object->unix_token = (struct security_unix_token *)pytalloc_get_ptr(value);
2366 : }
2367 0 : return 0;
2368 : }
2369 :
2370 8 : static PyObject *py_auth_session_info_get_info(PyObject *obj, void *closure)
2371 : {
2372 8 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2373 0 : PyObject *py_info;
2374 8 : if (object->info == NULL) {
2375 0 : Py_RETURN_NONE;
2376 : }
2377 8 : if (object->info == NULL) {
2378 0 : py_info = Py_None;
2379 0 : Py_INCREF(py_info);
2380 : } else {
2381 8 : py_info = pytalloc_reference_ex(&auth_user_info_Type, object->info, object->info);
2382 : }
2383 8 : return py_info;
2384 : }
2385 :
2386 0 : static int py_auth_session_info_set_info(PyObject *py_obj, PyObject *value, void *closure)
2387 : {
2388 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2389 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
2390 0 : if (value == NULL) {
2391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
2392 0 : return -1;
2393 : }
2394 0 : if (value == Py_None) {
2395 0 : object->info = NULL;
2396 : } else {
2397 0 : object->info = NULL;
2398 0 : PY_CHECK_TYPE(&auth_user_info_Type, value, return -1;);
2399 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2400 0 : PyErr_NoMemory();
2401 0 : return -1;
2402 : }
2403 0 : object->info = (struct auth_user_info *)pytalloc_get_ptr(value);
2404 : }
2405 0 : return 0;
2406 : }
2407 :
2408 2 : static PyObject *py_auth_session_info_get_unix_info(PyObject *obj, void *closure)
2409 : {
2410 2 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2411 0 : PyObject *py_unix_info;
2412 2 : if (object->unix_info == NULL) {
2413 0 : Py_RETURN_NONE;
2414 : }
2415 2 : if (object->unix_info == NULL) {
2416 0 : py_unix_info = Py_None;
2417 0 : Py_INCREF(py_unix_info);
2418 : } else {
2419 2 : py_unix_info = pytalloc_reference_ex(&auth_user_info_unix_Type, object->unix_info, object->unix_info);
2420 : }
2421 2 : return py_unix_info;
2422 : }
2423 :
2424 0 : static int py_auth_session_info_set_unix_info(PyObject *py_obj, PyObject *value, void *closure)
2425 : {
2426 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2427 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->unix_info));
2428 0 : if (value == NULL) {
2429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unix_info");
2430 0 : return -1;
2431 : }
2432 0 : if (value == Py_None) {
2433 0 : object->unix_info = NULL;
2434 : } else {
2435 0 : object->unix_info = NULL;
2436 0 : PY_CHECK_TYPE(&auth_user_info_unix_Type, value, return -1;);
2437 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2438 0 : PyErr_NoMemory();
2439 0 : return -1;
2440 : }
2441 0 : object->unix_info = (struct auth_user_info_unix *)pytalloc_get_ptr(value);
2442 : }
2443 0 : return 0;
2444 : }
2445 :
2446 2 : static PyObject *py_auth_session_info_get_torture(PyObject *obj, void *closure)
2447 : {
2448 2 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2449 0 : PyObject *py_torture;
2450 2 : if (object->torture == NULL) {
2451 0 : Py_RETURN_NONE;
2452 : }
2453 2 : if (object->torture == NULL) {
2454 0 : py_torture = Py_None;
2455 0 : Py_INCREF(py_torture);
2456 : } else {
2457 2 : py_torture = pytalloc_reference_ex(&auth_user_info_torture_Type, object->torture, object->torture);
2458 : }
2459 2 : return py_torture;
2460 : }
2461 :
2462 0 : static int py_auth_session_info_set_torture(PyObject *py_obj, PyObject *value, void *closure)
2463 : {
2464 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2465 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->torture));
2466 0 : if (value == NULL) {
2467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->torture");
2468 0 : return -1;
2469 : }
2470 0 : if (value == Py_None) {
2471 0 : object->torture = NULL;
2472 : } else {
2473 0 : object->torture = NULL;
2474 0 : PY_CHECK_TYPE(&auth_user_info_torture_Type, value, return -1;);
2475 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2476 0 : PyErr_NoMemory();
2477 0 : return -1;
2478 : }
2479 0 : object->torture = (struct auth_user_info_torture *)pytalloc_get_ptr(value);
2480 : }
2481 0 : return 0;
2482 : }
2483 :
2484 3 : static PyObject *py_auth_session_info_get_session_key(PyObject *obj, void *closure)
2485 : {
2486 3 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2487 0 : PyObject *py_session_key;
2488 3 : py_session_key = PyBytes_FromStringAndSize((char *)(object->session_key).data, (object->session_key).length);
2489 3 : return py_session_key;
2490 : }
2491 :
2492 0 : static int py_auth_session_info_set_session_key(PyObject *py_obj, PyObject *value, void *closure)
2493 : {
2494 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2495 0 : if (value == NULL) {
2496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->session_key");
2497 0 : return -1;
2498 : }
2499 0 : object->session_key = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2500 0 : return 0;
2501 : }
2502 :
2503 0 : static PyObject *py_auth_session_info_get_credentials(PyObject *obj, void *closure)
2504 : {
2505 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2506 0 : PyObject *py_credentials;
2507 0 : if (object->credentials == NULL) {
2508 0 : Py_RETURN_NONE;
2509 : }
2510 0 : if (object->credentials == NULL) {
2511 0 : py_credentials = Py_None;
2512 0 : Py_INCREF(py_credentials);
2513 : } else {
2514 0 : py_credentials = NULL;
2515 : }
2516 0 : return py_credentials;
2517 : }
2518 :
2519 0 : static int py_auth_session_info_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
2520 : {
2521 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2522 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->credentials));
2523 0 : if (value == NULL) {
2524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credentials");
2525 0 : return -1;
2526 : }
2527 0 : if (value == Py_None) {
2528 0 : object->credentials = NULL;
2529 : } else {
2530 0 : object->credentials = NULL;
2531 0 : PyErr_SetString(PyExc_TypeError, "Can not convert C Type struct cli_credentials from Python");
2532 : }
2533 0 : return 0;
2534 : }
2535 :
2536 0 : static PyObject *py_auth_session_info_get_unique_session_token(PyObject *obj, void *closure)
2537 : {
2538 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2539 0 : PyObject *py_unique_session_token;
2540 0 : py_unique_session_token = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->unique_session_token);
2541 0 : return py_unique_session_token;
2542 : }
2543 :
2544 0 : static int py_auth_session_info_set_unique_session_token(PyObject *py_obj, PyObject *value, void *closure)
2545 : {
2546 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2547 0 : if (value == NULL) {
2548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unique_session_token");
2549 0 : return -1;
2550 : }
2551 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
2552 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2553 0 : PyErr_NoMemory();
2554 0 : return -1;
2555 : }
2556 0 : object->unique_session_token = *(struct GUID *)pytalloc_get_ptr(value);
2557 0 : return 0;
2558 : }
2559 :
2560 0 : static PyObject *py_auth_session_info_get_ticket_type(PyObject *obj, void *closure)
2561 : {
2562 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(obj);
2563 0 : PyObject *py_ticket_type;
2564 0 : py_ticket_type = PyLong_FromLong((uint16_t)object->ticket_type);
2565 0 : return py_ticket_type;
2566 : }
2567 :
2568 0 : static int py_auth_session_info_set_ticket_type(PyObject *py_obj, PyObject *value, void *closure)
2569 : {
2570 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2571 0 : if (value == NULL) {
2572 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ticket_type");
2573 0 : return -1;
2574 : }
2575 : {
2576 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ticket_type));
2577 0 : if (PyLong_Check(value)) {
2578 0 : unsigned long long test_var;
2579 0 : test_var = PyLong_AsUnsignedLongLong(value);
2580 0 : if (PyErr_Occurred() != NULL) {
2581 0 : return -1;
2582 : }
2583 0 : if (test_var > uint_max) {
2584 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2585 : PyLong_Type.tp_name, uint_max, test_var);
2586 0 : return -1;
2587 : }
2588 0 : object->ticket_type = test_var;
2589 : } else {
2590 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2591 : PyLong_Type.tp_name);
2592 0 : return -1;
2593 : }
2594 : }
2595 0 : return 0;
2596 : }
2597 :
2598 : static PyGetSetDef py_auth_session_info_getsetters[] = {
2599 : {
2600 : .name = discard_const_p(char, "security_token"),
2601 : .get = py_auth_session_info_get_security_token,
2602 : .set = py_auth_session_info_set_security_token,
2603 : .doc = discard_const_p(char, "PIDL-generated element of base type security_token")
2604 : },
2605 : {
2606 : .name = discard_const_p(char, "unix_token"),
2607 : .get = py_auth_session_info_get_unix_token,
2608 : .set = py_auth_session_info_set_unix_token,
2609 : .doc = discard_const_p(char, "PIDL-generated element of base type security_unix_token")
2610 : },
2611 : {
2612 : .name = discard_const_p(char, "info"),
2613 : .get = py_auth_session_info_get_info,
2614 : .set = py_auth_session_info_set_info,
2615 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_user_info")
2616 : },
2617 : {
2618 : .name = discard_const_p(char, "unix_info"),
2619 : .get = py_auth_session_info_get_unix_info,
2620 : .set = py_auth_session_info_set_unix_info,
2621 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_user_info_unix")
2622 : },
2623 : {
2624 : .name = discard_const_p(char, "torture"),
2625 : .get = py_auth_session_info_get_torture,
2626 : .set = py_auth_session_info_set_torture,
2627 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_user_info_torture")
2628 : },
2629 : {
2630 : .name = discard_const_p(char, "session_key"),
2631 : .get = py_auth_session_info_get_session_key,
2632 : .set = py_auth_session_info_set_session_key,
2633 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2634 : },
2635 : {
2636 : .name = discard_const_p(char, "credentials"),
2637 : .get = py_auth_session_info_get_credentials,
2638 : .set = py_auth_session_info_set_credentials,
2639 : .doc = discard_const_p(char, "PIDL-generated element of base type cli_credentials")
2640 : },
2641 : {
2642 : .name = discard_const_p(char, "unique_session_token"),
2643 : .get = py_auth_session_info_get_unique_session_token,
2644 : .set = py_auth_session_info_set_unique_session_token,
2645 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
2646 : },
2647 : {
2648 : .name = discard_const_p(char, "ticket_type"),
2649 : .get = py_auth_session_info_get_ticket_type,
2650 : .set = py_auth_session_info_set_ticket_type,
2651 : .doc = discard_const_p(char, "PIDL-generated element of base type ticket_type")
2652 : },
2653 : { .name = NULL }
2654 : };
2655 :
2656 0 : static PyObject *py_auth_session_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2657 : {
2658 0 : return pytalloc_new(struct auth_session_info, type);
2659 : }
2660 :
2661 0 : static PyObject *py_auth_session_info_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2662 : {
2663 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2664 0 : PyObject *ret = NULL;
2665 0 : DATA_BLOB blob;
2666 0 : enum ndr_err_code err;
2667 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2668 0 : if (tmp_ctx == NULL) {
2669 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2670 0 : return NULL;
2671 : }
2672 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_session_info);
2673 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2674 0 : TALLOC_FREE(tmp_ctx);
2675 0 : PyErr_SetNdrError(err);
2676 0 : return NULL;
2677 : }
2678 :
2679 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2680 0 : TALLOC_FREE(tmp_ctx);
2681 0 : return ret;
2682 : }
2683 :
2684 0 : static PyObject *py_auth_session_info_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2685 : {
2686 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2687 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2688 0 : Py_ssize_t blob_length = 0;
2689 0 : enum ndr_err_code err;
2690 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2691 0 : PyObject *allow_remaining_obj = NULL;
2692 0 : bool allow_remaining = false;
2693 :
2694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2695 : discard_const_p(char *, kwnames),
2696 : &blob.data, &blob_length,
2697 : &allow_remaining_obj)) {
2698 0 : return NULL;
2699 : }
2700 0 : blob.length = blob_length;
2701 :
2702 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2703 0 : allow_remaining = true;
2704 : }
2705 :
2706 0 : if (allow_remaining) {
2707 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_session_info);
2708 : } else {
2709 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_session_info);
2710 : }
2711 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2712 0 : PyErr_SetNdrError(err);
2713 0 : return NULL;
2714 : }
2715 :
2716 0 : Py_RETURN_NONE;
2717 : }
2718 :
2719 0 : static PyObject *py_auth_session_info_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2720 : {
2721 0 : struct auth_session_info *object = (struct auth_session_info *)pytalloc_get_ptr(py_obj);
2722 0 : PyObject *ret;
2723 0 : char *retstr;
2724 :
2725 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_session_info, "auth_session_info", object);
2726 0 : ret = PyUnicode_FromString(retstr);
2727 0 : talloc_free(retstr);
2728 :
2729 0 : return ret;
2730 : }
2731 :
2732 : static PyMethodDef py_auth_session_info_methods[] = {
2733 : { "__ndr_pack__", (PyCFunction)py_auth_session_info_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2734 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_session_info_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2735 : { "__ndr_print__", (PyCFunction)py_auth_session_info_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2736 : { NULL, NULL, 0, NULL }
2737 : };
2738 :
2739 :
2740 : static PyTypeObject auth_session_info_Type = {
2741 : PyVarObject_HEAD_INIT(NULL, 0)
2742 : .tp_name = "auth.session_info",
2743 : .tp_getset = py_auth_session_info_getsetters,
2744 : .tp_methods = py_auth_session_info_methods,
2745 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2746 : .tp_new = py_auth_session_info_new,
2747 : };
2748 :
2749 :
2750 0 : static PyObject *py_auth_session_info_transport_get_session_info(PyObject *obj, void *closure)
2751 : {
2752 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(obj);
2753 0 : PyObject *py_session_info;
2754 0 : if (object->session_info == NULL) {
2755 0 : Py_RETURN_NONE;
2756 : }
2757 0 : if (object->session_info == NULL) {
2758 0 : py_session_info = Py_None;
2759 0 : Py_INCREF(py_session_info);
2760 : } else {
2761 0 : py_session_info = pytalloc_reference_ex(&auth_session_info_Type, object->session_info, object->session_info);
2762 : }
2763 0 : return py_session_info;
2764 : }
2765 :
2766 0 : static int py_auth_session_info_transport_set_session_info(PyObject *py_obj, PyObject *value, void *closure)
2767 : {
2768 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(py_obj);
2769 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->session_info));
2770 0 : if (value == NULL) {
2771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->session_info");
2772 0 : return -1;
2773 : }
2774 0 : if (value == Py_None) {
2775 0 : object->session_info = NULL;
2776 : } else {
2777 0 : object->session_info = NULL;
2778 0 : PY_CHECK_TYPE(&auth_session_info_Type, value, return -1;);
2779 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2780 0 : PyErr_NoMemory();
2781 0 : return -1;
2782 : }
2783 0 : object->session_info = (struct auth_session_info *)pytalloc_get_ptr(value);
2784 : }
2785 0 : return 0;
2786 : }
2787 :
2788 0 : static PyObject *py_auth_session_info_transport_get_exported_gssapi_credentials(PyObject *obj, void *closure)
2789 : {
2790 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(obj);
2791 0 : PyObject *py_exported_gssapi_credentials;
2792 0 : py_exported_gssapi_credentials = PyBytes_FromStringAndSize((char *)(object->exported_gssapi_credentials).data, (object->exported_gssapi_credentials).length);
2793 0 : return py_exported_gssapi_credentials;
2794 : }
2795 :
2796 0 : static int py_auth_session_info_transport_set_exported_gssapi_credentials(PyObject *py_obj, PyObject *value, void *closure)
2797 : {
2798 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(py_obj);
2799 0 : if (value == NULL) {
2800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->exported_gssapi_credentials");
2801 0 : return -1;
2802 : }
2803 0 : object->exported_gssapi_credentials = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2804 0 : return 0;
2805 : }
2806 :
2807 : static PyGetSetDef py_auth_session_info_transport_getsetters[] = {
2808 : {
2809 : .name = discard_const_p(char, "session_info"),
2810 : .get = py_auth_session_info_transport_get_session_info,
2811 : .set = py_auth_session_info_transport_set_session_info,
2812 : .doc = discard_const_p(char, "PIDL-generated element of base type auth_session_info")
2813 : },
2814 : {
2815 : .name = discard_const_p(char, "exported_gssapi_credentials"),
2816 : .get = py_auth_session_info_transport_get_exported_gssapi_credentials,
2817 : .set = py_auth_session_info_transport_set_exported_gssapi_credentials,
2818 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2819 : },
2820 : { .name = NULL }
2821 : };
2822 :
2823 0 : static PyObject *py_auth_session_info_transport_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2824 : {
2825 0 : return pytalloc_new(struct auth_session_info_transport, type);
2826 : }
2827 :
2828 0 : static PyObject *py_auth_session_info_transport_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2829 : {
2830 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(py_obj);
2831 0 : PyObject *ret = NULL;
2832 0 : DATA_BLOB blob;
2833 0 : enum ndr_err_code err;
2834 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2835 0 : if (tmp_ctx == NULL) {
2836 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2837 0 : return NULL;
2838 : }
2839 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_auth_session_info_transport);
2840 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2841 0 : TALLOC_FREE(tmp_ctx);
2842 0 : PyErr_SetNdrError(err);
2843 0 : return NULL;
2844 : }
2845 :
2846 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2847 0 : TALLOC_FREE(tmp_ctx);
2848 0 : return ret;
2849 : }
2850 :
2851 0 : static PyObject *py_auth_session_info_transport_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2852 : {
2853 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(py_obj);
2854 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2855 0 : Py_ssize_t blob_length = 0;
2856 0 : enum ndr_err_code err;
2857 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2858 0 : PyObject *allow_remaining_obj = NULL;
2859 0 : bool allow_remaining = false;
2860 :
2861 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2862 : discard_const_p(char *, kwnames),
2863 : &blob.data, &blob_length,
2864 : &allow_remaining_obj)) {
2865 0 : return NULL;
2866 : }
2867 0 : blob.length = blob_length;
2868 :
2869 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2870 0 : allow_remaining = true;
2871 : }
2872 :
2873 0 : if (allow_remaining) {
2874 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_session_info_transport);
2875 : } else {
2876 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_auth_session_info_transport);
2877 : }
2878 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2879 0 : PyErr_SetNdrError(err);
2880 0 : return NULL;
2881 : }
2882 :
2883 0 : Py_RETURN_NONE;
2884 : }
2885 :
2886 0 : static PyObject *py_auth_session_info_transport_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2887 : {
2888 0 : struct auth_session_info_transport *object = (struct auth_session_info_transport *)pytalloc_get_ptr(py_obj);
2889 0 : PyObject *ret;
2890 0 : char *retstr;
2891 :
2892 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_auth_session_info_transport, "auth_session_info_transport", object);
2893 0 : ret = PyUnicode_FromString(retstr);
2894 0 : talloc_free(retstr);
2895 :
2896 0 : return ret;
2897 : }
2898 :
2899 : static PyMethodDef py_auth_session_info_transport_methods[] = {
2900 : { "__ndr_pack__", (PyCFunction)py_auth_session_info_transport_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2901 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_auth_session_info_transport_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2902 : { "__ndr_print__", (PyCFunction)py_auth_session_info_transport_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2903 : { NULL, NULL, 0, NULL }
2904 : };
2905 :
2906 :
2907 : static PyTypeObject auth_session_info_transport_Type = {
2908 : PyVarObject_HEAD_INIT(NULL, 0)
2909 : .tp_name = "auth.session_info_transport",
2910 : .tp_getset = py_auth_session_info_transport_getsetters,
2911 : .tp_methods = py_auth_session_info_transport_methods,
2912 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2913 : .tp_new = py_auth_session_info_transport_new,
2914 : };
2915 :
2916 : static PyMethodDef auth_methods[] = {
2917 : { NULL, NULL, 0, NULL }
2918 : };
2919 :
2920 : static struct PyModuleDef moduledef = {
2921 : PyModuleDef_HEAD_INIT,
2922 : .m_name = "auth",
2923 : .m_doc = "auth DCE/RPC",
2924 : .m_size = -1,
2925 : .m_methods = auth_methods,
2926 : };
2927 3427 : MODULE_INIT_FUNC(auth)
2928 : {
2929 3427 : PyObject *m = NULL;
2930 3427 : PyObject *dep_samba_dcerpc_misc = NULL;
2931 3427 : PyObject *dep_samba_dcerpc_security = NULL;
2932 3427 : PyObject *dep_samba_dcerpc_lsa = NULL;
2933 3427 : PyObject *dep_samba_dcerpc_krb5pac = NULL;
2934 3427 : PyObject *dep_talloc = NULL;
2935 :
2936 3427 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
2937 3427 : if (dep_samba_dcerpc_misc == NULL)
2938 0 : goto out;
2939 :
2940 3427 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
2941 3427 : if (dep_samba_dcerpc_security == NULL)
2942 0 : goto out;
2943 :
2944 3427 : dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
2945 3427 : if (dep_samba_dcerpc_lsa == NULL)
2946 0 : goto out;
2947 :
2948 3427 : dep_samba_dcerpc_krb5pac = PyImport_ImportModule("samba.dcerpc.krb5pac");
2949 3427 : if (dep_samba_dcerpc_krb5pac == NULL)
2950 0 : goto out;
2951 :
2952 3427 : dep_talloc = PyImport_ImportModule("talloc");
2953 3427 : if (dep_talloc == NULL)
2954 0 : goto out;
2955 :
2956 3427 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
2957 3427 : if (BaseObject_Type == NULL)
2958 0 : goto out;
2959 :
2960 3427 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
2961 3427 : if (dom_sid_Type == NULL)
2962 0 : goto out;
2963 :
2964 3427 : security_token_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "token");
2965 3427 : if (security_token_Type == NULL)
2966 0 : goto out;
2967 :
2968 3427 : security_unix_token_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "unix_token");
2969 3427 : if (security_unix_token_Type == NULL)
2970 0 : goto out;
2971 :
2972 3427 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
2973 3427 : if (GUID_Type == NULL)
2974 0 : goto out;
2975 :
2976 3427 : auth_user_info_Type.tp_base = BaseObject_Type;
2977 3427 : auth_user_info_Type.tp_basicsize = pytalloc_BaseObject_size();
2978 :
2979 3427 : auth_user_info_torture_Type.tp_base = BaseObject_Type;
2980 3427 : auth_user_info_torture_Type.tp_basicsize = pytalloc_BaseObject_size();
2981 :
2982 3427 : auth_user_info_unix_Type.tp_base = BaseObject_Type;
2983 3427 : auth_user_info_unix_Type.tp_basicsize = pytalloc_BaseObject_size();
2984 :
2985 3427 : auth_SidAttr_Type.tp_base = BaseObject_Type;
2986 3427 : auth_SidAttr_Type.tp_basicsize = pytalloc_BaseObject_size();
2987 :
2988 3427 : auth_user_info_dc_Type.tp_base = BaseObject_Type;
2989 3427 : auth_user_info_dc_Type.tp_basicsize = pytalloc_BaseObject_size();
2990 :
2991 3427 : auth_session_info_Type.tp_base = BaseObject_Type;
2992 3427 : auth_session_info_Type.tp_basicsize = pytalloc_BaseObject_size();
2993 :
2994 3427 : auth_session_info_transport_Type.tp_base = BaseObject_Type;
2995 3427 : auth_session_info_transport_Type.tp_basicsize = pytalloc_BaseObject_size();
2996 :
2997 3427 : if (PyType_Ready(&auth_user_info_Type) < 0)
2998 0 : goto out;
2999 3427 : if (PyType_Ready(&auth_user_info_torture_Type) < 0)
3000 0 : goto out;
3001 3427 : if (PyType_Ready(&auth_user_info_unix_Type) < 0)
3002 0 : goto out;
3003 3427 : if (PyType_Ready(&auth_SidAttr_Type) < 0)
3004 0 : goto out;
3005 3427 : if (PyType_Ready(&auth_user_info_dc_Type) < 0)
3006 0 : goto out;
3007 3427 : if (PyType_Ready(&auth_session_info_Type) < 0)
3008 0 : goto out;
3009 3427 : if (PyType_Ready(&auth_session_info_transport_Type) < 0)
3010 0 : goto out;
3011 : #ifdef PY_USER_INFO_PATCH
3012 : PY_USER_INFO_PATCH(&auth_user_info_Type);
3013 : #endif
3014 : #ifdef PY_USER_INFO_TORTURE_PATCH
3015 : PY_USER_INFO_TORTURE_PATCH(&auth_user_info_torture_Type);
3016 : #endif
3017 : #ifdef PY_USER_INFO_UNIX_PATCH
3018 : PY_USER_INFO_UNIX_PATCH(&auth_user_info_unix_Type);
3019 : #endif
3020 : #ifdef PY_SIDATTR_PATCH
3021 : PY_SIDATTR_PATCH(&auth_SidAttr_Type);
3022 : #endif
3023 : #ifdef PY_USER_INFO_DC_PATCH
3024 : PY_USER_INFO_DC_PATCH(&auth_user_info_dc_Type);
3025 : #endif
3026 : #ifdef PY_SESSION_INFO_PATCH
3027 3427 : PY_SESSION_INFO_PATCH(&auth_session_info_Type);
3028 : #endif
3029 : #ifdef PY_SESSION_INFO_TRANSPORT_PATCH
3030 : PY_SESSION_INFO_TRANSPORT_PATCH(&auth_session_info_transport_Type);
3031 : #endif
3032 :
3033 3427 : m = PyModule_Create(&moduledef);
3034 3427 : if (m == NULL)
3035 0 : goto out;
3036 :
3037 3427 : PyModule_AddObject(m, "SEC_AUTH_METHOD_UNAUTHENTICATED", PyLong_FromLong((uint16_t)SEC_AUTH_METHOD_UNAUTHENTICATED));
3038 3427 : PyModule_AddObject(m, "SEC_AUTH_METHOD_NTLM", PyLong_FromLong((uint16_t)SEC_AUTH_METHOD_NTLM));
3039 3427 : PyModule_AddObject(m, "SEC_AUTH_METHOD_KERBEROS", PyLong_FromLong((uint16_t)SEC_AUTH_METHOD_KERBEROS));
3040 3427 : PyModule_AddObject(m, "TICKET_TYPE_UNKNOWN", PyLong_FromLong((uint16_t)TICKET_TYPE_UNKNOWN));
3041 3427 : PyModule_AddObject(m, "TICKET_TYPE_TGT", PyLong_FromLong((uint16_t)TICKET_TYPE_TGT));
3042 3427 : PyModule_AddObject(m, "TICKET_TYPE_NON_TGT", PyLong_FromLong((uint16_t)TICKET_TYPE_NON_TGT));
3043 3427 : PyModule_AddObject(m, "AUTH_GROUP_INCLUSION_INVALID", PyLong_FromLong((uint16_t)AUTH_GROUP_INCLUSION_INVALID));
3044 3427 : PyModule_AddObject(m, "AUTH_INCLUDE_RESOURCE_GROUPS", PyLong_FromLong((uint16_t)AUTH_INCLUDE_RESOURCE_GROUPS));
3045 3427 : PyModule_AddObject(m, "AUTH_INCLUDE_RESOURCE_GROUPS_COMPRESSED", PyLong_FromLong((uint16_t)AUTH_INCLUDE_RESOURCE_GROUPS_COMPRESSED));
3046 3427 : PyModule_AddObject(m, "AUTH_EXCLUDE_RESOURCE_GROUPS", PyLong_FromLong((uint16_t)AUTH_EXCLUDE_RESOURCE_GROUPS));
3047 3427 : Py_INCREF((PyObject *)(void *)&auth_user_info_Type);
3048 3427 : PyModule_AddObject(m, "user_info", (PyObject *)(void *)&auth_user_info_Type);
3049 3427 : Py_INCREF((PyObject *)(void *)&auth_user_info_torture_Type);
3050 3427 : PyModule_AddObject(m, "user_info_torture", (PyObject *)(void *)&auth_user_info_torture_Type);
3051 3427 : Py_INCREF((PyObject *)(void *)&auth_user_info_unix_Type);
3052 3427 : PyModule_AddObject(m, "user_info_unix", (PyObject *)(void *)&auth_user_info_unix_Type);
3053 3427 : Py_INCREF((PyObject *)(void *)&auth_SidAttr_Type);
3054 3427 : PyModule_AddObject(m, "SidAttr", (PyObject *)(void *)&auth_SidAttr_Type);
3055 3427 : Py_INCREF((PyObject *)(void *)&auth_user_info_dc_Type);
3056 3427 : PyModule_AddObject(m, "user_info_dc", (PyObject *)(void *)&auth_user_info_dc_Type);
3057 3427 : Py_INCREF((PyObject *)(void *)&auth_session_info_Type);
3058 3427 : PyModule_AddObject(m, "session_info", (PyObject *)(void *)&auth_session_info_Type);
3059 3427 : Py_INCREF((PyObject *)(void *)&auth_session_info_transport_Type);
3060 3427 : PyModule_AddObject(m, "session_info_transport", (PyObject *)(void *)&auth_session_info_transport_Type);
3061 : #ifdef PY_MOD_AUTH_PATCH
3062 : PY_MOD_AUTH_PATCH(m);
3063 : #endif
3064 3427 : out:
3065 3427 : Py_XDECREF(dep_samba_dcerpc_misc);
3066 3427 : Py_XDECREF(dep_samba_dcerpc_security);
3067 3427 : Py_XDECREF(dep_samba_dcerpc_lsa);
3068 3427 : Py_XDECREF(dep_samba_dcerpc_krb5pac);
3069 3427 : Py_XDECREF(dep_talloc);
3070 3427 : return m;
3071 :
3072 : }
|