Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_unixinfo.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_unixinfo_c.h"
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/security.h"
65 : static PyTypeObject unixinfo_GetPWUidInfo_Type;
66 : static PyTypeObject unixinfo_InterfaceType;
67 : static PyTypeObject unixinfo_SidToUid_Type;
68 : static PyTypeObject unixinfo_UidToSid_Type;
69 : static PyTypeObject unixinfo_SidToGid_Type;
70 : static PyTypeObject unixinfo_GidToSid_Type;
71 : static PyTypeObject unixinfo_GetPWUid_Type;
72 :
73 : static PyTypeObject *BaseObject_Type;
74 : static PyTypeObject *dom_sid_Type;
75 : static PyTypeObject *ClientConnection_Type;
76 : static PyTypeObject *ndr_syntax_id_Type;
77 :
78 0 : static PyObject *py_unixinfo_GetPWUidInfo_get_status(PyObject *obj, void *closure)
79 : {
80 0 : struct unixinfo_GetPWUidInfo *object = pytalloc_get_ptr(obj);
81 : PyObject *py_status;
82 0 : py_status = PyErr_FromNTSTATUS(object->status);
83 0 : return py_status;
84 : }
85 :
86 0 : static int py_unixinfo_GetPWUidInfo_set_status(PyObject *py_obj, PyObject *value, void *closure)
87 : {
88 0 : struct unixinfo_GetPWUidInfo *object = pytalloc_get_ptr(py_obj);
89 0 : if (value == NULL) {
90 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
91 0 : return -1;
92 : }
93 0 : object->status = NT_STATUS(PyLong_AsLong(value));
94 0 : return 0;
95 : }
96 :
97 0 : static PyObject *py_unixinfo_GetPWUidInfo_get_homedir(PyObject *obj, void *closure)
98 : {
99 0 : struct unixinfo_GetPWUidInfo *object = pytalloc_get_ptr(obj);
100 : PyObject *py_homedir;
101 0 : if (object->homedir == NULL) {
102 0 : py_homedir = Py_None;
103 0 : Py_INCREF(py_homedir);
104 : } else {
105 0 : py_homedir = PyUnicode_Decode(object->homedir, strlen(object->homedir), "utf-8", "ignore");
106 : }
107 0 : return py_homedir;
108 : }
109 :
110 0 : static int py_unixinfo_GetPWUidInfo_set_homedir(PyObject *py_obj, PyObject *value, void *closure)
111 : {
112 0 : struct unixinfo_GetPWUidInfo *object = pytalloc_get_ptr(py_obj);
113 0 : if (value == NULL) {
114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->homedir");
115 0 : return -1;
116 : }
117 : {
118 : const char *test_str;
119 : const char *talloc_str;
120 0 : PyObject *unicode = NULL;
121 0 : if (PyUnicode_Check(value)) {
122 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
123 0 : if (unicode == NULL) {
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->homedir = talloc_str;
142 : }
143 0 : return 0;
144 : }
145 :
146 0 : static PyObject *py_unixinfo_GetPWUidInfo_get_shell(PyObject *obj, void *closure)
147 : {
148 0 : struct unixinfo_GetPWUidInfo *object = pytalloc_get_ptr(obj);
149 : PyObject *py_shell;
150 0 : if (object->shell == NULL) {
151 0 : py_shell = Py_None;
152 0 : Py_INCREF(py_shell);
153 : } else {
154 0 : py_shell = PyUnicode_Decode(object->shell, strlen(object->shell), "utf-8", "ignore");
155 : }
156 0 : return py_shell;
157 : }
158 :
159 0 : static int py_unixinfo_GetPWUidInfo_set_shell(PyObject *py_obj, PyObject *value, void *closure)
160 : {
161 0 : struct unixinfo_GetPWUidInfo *object = pytalloc_get_ptr(py_obj);
162 0 : if (value == NULL) {
163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->shell");
164 0 : return -1;
165 : }
166 : {
167 : const char *test_str;
168 : const char *talloc_str;
169 0 : PyObject *unicode = NULL;
170 0 : if (PyUnicode_Check(value)) {
171 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
172 0 : if (unicode == NULL) {
173 0 : return -1;
174 : }
175 0 : test_str = PyBytes_AS_STRING(unicode);
176 0 : } else if (PyBytes_Check(value)) {
177 0 : test_str = PyBytes_AS_STRING(value);
178 : } else {
179 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
180 0 : return -1;
181 : }
182 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
183 0 : if (unicode != NULL) {
184 0 : Py_DECREF(unicode);
185 : }
186 0 : if (talloc_str == NULL) {
187 0 : PyErr_NoMemory();
188 0 : return -1;
189 : }
190 0 : object->shell = talloc_str;
191 : }
192 0 : return 0;
193 : }
194 :
195 : static PyGetSetDef py_unixinfo_GetPWUidInfo_getsetters[] = {
196 : {
197 : .name = discard_const_p(char, "status"),
198 : .get = py_unixinfo_GetPWUidInfo_get_status,
199 : .set = py_unixinfo_GetPWUidInfo_set_status,
200 : .doc = discard_const_p(char, "PIDL-generated element of base type NTSTATUS")
201 : },
202 : {
203 : .name = discard_const_p(char, "homedir"),
204 : .get = py_unixinfo_GetPWUidInfo_get_homedir,
205 : .set = py_unixinfo_GetPWUidInfo_set_homedir,
206 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
207 : },
208 : {
209 : .name = discard_const_p(char, "shell"),
210 : .get = py_unixinfo_GetPWUidInfo_get_shell,
211 : .set = py_unixinfo_GetPWUidInfo_set_shell,
212 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
213 : },
214 : { .name = NULL }
215 : };
216 :
217 0 : static PyObject *py_unixinfo_GetPWUidInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
218 : {
219 0 : return pytalloc_new(struct unixinfo_GetPWUidInfo, type);
220 : }
221 :
222 :
223 : static PyTypeObject unixinfo_GetPWUidInfo_Type = {
224 : PyVarObject_HEAD_INIT(NULL, 0)
225 : .tp_name = "unixinfo.GetPWUidInfo",
226 : .tp_getset = py_unixinfo_GetPWUidInfo_getsetters,
227 : .tp_methods = NULL,
228 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
229 : .tp_new = py_unixinfo_GetPWUidInfo_new,
230 : };
231 :
232 :
233 :
234 0 : static PyObject *py_unixinfo_SidToUid_in_get_sid(PyObject *obj, void *closure)
235 : {
236 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(obj);
237 : PyObject *py_sid;
238 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->in.sid);
239 0 : return py_sid;
240 : }
241 :
242 0 : static int py_unixinfo_SidToUid_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
243 : {
244 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(py_obj);
245 0 : if (value == NULL) {
246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
247 0 : return -1;
248 : }
249 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
250 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
251 0 : PyErr_NoMemory();
252 0 : return -1;
253 : }
254 0 : object->in.sid = *(struct dom_sid *)pytalloc_get_ptr(value);
255 0 : return 0;
256 : }
257 :
258 0 : static PyObject *py_unixinfo_SidToUid_out_get_uid(PyObject *obj, void *closure)
259 : {
260 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(obj);
261 : PyObject *py_uid;
262 0 : if (object->out.uid == NULL) {
263 0 : Py_RETURN_NONE;
264 : }
265 0 : py_uid = PyLong_FromUnsignedLongLong(*object->out.uid);
266 0 : return py_uid;
267 : }
268 :
269 0 : static int py_unixinfo_SidToUid_out_set_uid(PyObject *py_obj, PyObject *value, void *closure)
270 : {
271 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(py_obj);
272 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.uid));
273 0 : if (value == NULL) {
274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.uid");
275 0 : return -1;
276 : }
277 0 : object->out.uid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.uid);
278 0 : if (object->out.uid == NULL) {
279 0 : PyErr_NoMemory();
280 0 : return -1;
281 : }
282 : {
283 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.uid));
284 0 : if (PyLong_Check(value)) {
285 : unsigned long long test_var;
286 0 : test_var = PyLong_AsUnsignedLongLong(value);
287 0 : if (PyErr_Occurred() != NULL) {
288 0 : return -1;
289 : }
290 0 : if (test_var > uint_max) {
291 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
292 : PyLong_Type.tp_name, uint_max, test_var);
293 0 : return -1;
294 : }
295 0 : *object->out.uid = test_var;
296 : } else {
297 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
298 : PyLong_Type.tp_name);
299 0 : return -1;
300 : }
301 : }
302 0 : return 0;
303 : }
304 :
305 0 : static PyObject *py_unixinfo_SidToUid_get_result(PyObject *obj, void *closure)
306 : {
307 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(obj);
308 : PyObject *py_result;
309 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
310 0 : return py_result;
311 : }
312 :
313 0 : static int py_unixinfo_SidToUid_set_result(PyObject *py_obj, PyObject *value, void *closure)
314 : {
315 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(py_obj);
316 0 : if (value == NULL) {
317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
318 0 : return -1;
319 : }
320 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
321 0 : return 0;
322 : }
323 :
324 : static PyGetSetDef py_unixinfo_SidToUid_getsetters[] = {
325 : {
326 : .name = discard_const_p(char, "in_sid"),
327 : .get = py_unixinfo_SidToUid_in_get_sid,
328 : .set = py_unixinfo_SidToUid_in_set_sid,
329 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
330 : },
331 : {
332 : .name = discard_const_p(char, "out_uid"),
333 : .get = py_unixinfo_SidToUid_out_get_uid,
334 : .set = py_unixinfo_SidToUid_out_set_uid,
335 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
336 : },
337 : {
338 : .name = discard_const_p(char, "result"),
339 : .get = py_unixinfo_SidToUid_get_result,
340 : .set = py_unixinfo_SidToUid_set_result,
341 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
342 : },
343 : { .name = NULL }
344 : };
345 :
346 0 : static PyObject *py_unixinfo_SidToUid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
347 : {
348 0 : PyObject *self = pytalloc_new(struct unixinfo_SidToUid, type);
349 0 : struct unixinfo_SidToUid *_self = (struct unixinfo_SidToUid *)pytalloc_get_ptr(self);
350 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
351 0 : _self->out.uid = talloc_zero(mem_ctx, uint64_t);
352 0 : return self;
353 : }
354 :
355 0 : static PyObject *py_unixinfo_SidToUid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
356 : {
357 :
358 :
359 0 : return PyLong_FromLong(0);
360 : }
361 :
362 0 : static PyObject *py_unixinfo_SidToUid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
363 : {
364 0 : const struct ndr_interface_call *call = NULL;
365 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(py_obj);
366 0 : PyObject *ret = NULL;
367 0 : struct ndr_push *push = NULL;
368 : DATA_BLOB blob;
369 : enum ndr_err_code err;
370 :
371 0 : if (ndr_table_unixinfo.num_calls < 1) {
372 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_SidToUid_ndr_pack");
373 0 : return NULL;
374 : }
375 0 : call = &ndr_table_unixinfo.calls[0];
376 :
377 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
378 0 : if (push == NULL) {
379 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
380 0 : return NULL;
381 : }
382 :
383 0 : push->flags |= ndr_push_flags;
384 :
385 0 : err = call->ndr_push(push, ndr_inout_flags, object);
386 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
387 0 : TALLOC_FREE(push);
388 0 : PyErr_SetNdrError(err);
389 0 : return NULL;
390 : }
391 0 : blob = ndr_push_blob(push);
392 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
393 0 : TALLOC_FREE(push);
394 0 : return ret;
395 : }
396 :
397 0 : static PyObject *py_unixinfo_SidToUid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
398 : {
399 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
400 0 : PyObject *bigendian_obj = NULL;
401 0 : PyObject *ndr64_obj = NULL;
402 0 : libndr_flags ndr_push_flags = 0;
403 :
404 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
405 : discard_const_p(char *, kwnames),
406 : &bigendian_obj,
407 : &ndr64_obj)) {
408 0 : return NULL;
409 : }
410 :
411 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
412 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
413 : }
414 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
415 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
416 : }
417 :
418 0 : return py_unixinfo_SidToUid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
419 : }
420 :
421 0 : static PyObject *py_unixinfo_SidToUid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
422 : {
423 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
424 0 : PyObject *bigendian_obj = NULL;
425 0 : PyObject *ndr64_obj = NULL;
426 0 : libndr_flags ndr_push_flags = 0;
427 :
428 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
429 : discard_const_p(char *, kwnames),
430 : &bigendian_obj,
431 : &ndr64_obj)) {
432 0 : return NULL;
433 : }
434 :
435 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
436 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
437 : }
438 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
439 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
440 : }
441 :
442 0 : return py_unixinfo_SidToUid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
443 : }
444 :
445 0 : static PyObject *py_unixinfo_SidToUid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
446 : {
447 0 : const struct ndr_interface_call *call = NULL;
448 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(py_obj);
449 0 : struct ndr_pull *pull = NULL;
450 : enum ndr_err_code err;
451 :
452 0 : if (ndr_table_unixinfo.num_calls < 1) {
453 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_SidToUid_ndr_unpack");
454 0 : return NULL;
455 : }
456 0 : call = &ndr_table_unixinfo.calls[0];
457 :
458 0 : pull = ndr_pull_init_blob(blob, object);
459 0 : if (pull == NULL) {
460 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
461 0 : return NULL;
462 : }
463 :
464 0 : pull->flags |= ndr_pull_flags;
465 :
466 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
467 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
468 0 : TALLOC_FREE(pull);
469 0 : PyErr_SetNdrError(err);
470 0 : return NULL;
471 : }
472 0 : if (!allow_remaining) {
473 : uint32_t highest_ofs;
474 :
475 0 : if (pull->offset > pull->relative_highest_offset) {
476 0 : highest_ofs = pull->offset;
477 : } else {
478 0 : highest_ofs = pull->relative_highest_offset;
479 : }
480 0 : if (highest_ofs < pull->data_size) {
481 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
482 : "not all bytes consumed ofs[%u] size[%u]",
483 : highest_ofs, pull->data_size);
484 0 : TALLOC_FREE(pull);
485 0 : PyErr_SetNdrError(err);
486 0 : return NULL;
487 : }
488 : }
489 :
490 0 : TALLOC_FREE(pull);
491 0 : Py_RETURN_NONE;
492 : }
493 :
494 0 : static PyObject *py_unixinfo_SidToUid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
495 : {
496 : DATA_BLOB blob;
497 0 : Py_ssize_t blob_length = 0;
498 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
499 0 : PyObject *bigendian_obj = NULL;
500 0 : PyObject *ndr64_obj = NULL;
501 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
502 0 : PyObject *allow_remaining_obj = NULL;
503 0 : bool allow_remaining = false;
504 :
505 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
506 : discard_const_p(char *, kwnames),
507 : &blob.data, &blob_length,
508 : &bigendian_obj,
509 : &ndr64_obj,
510 : &allow_remaining_obj)) {
511 0 : return NULL;
512 : }
513 0 : blob.length = blob_length;
514 :
515 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
516 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
517 : }
518 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
519 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
520 : }
521 :
522 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
523 0 : allow_remaining = true;
524 : }
525 :
526 0 : return py_unixinfo_SidToUid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
527 : }
528 :
529 0 : static PyObject *py_unixinfo_SidToUid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
530 : {
531 : DATA_BLOB blob;
532 0 : Py_ssize_t blob_length = 0;
533 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
534 0 : PyObject *bigendian_obj = NULL;
535 0 : PyObject *ndr64_obj = NULL;
536 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
537 0 : PyObject *allow_remaining_obj = NULL;
538 0 : bool allow_remaining = false;
539 :
540 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
541 : discard_const_p(char *, kwnames),
542 : &blob.data, &blob_length,
543 : &bigendian_obj,
544 : &ndr64_obj,
545 : &allow_remaining_obj)) {
546 0 : return NULL;
547 : }
548 0 : blob.length = blob_length;
549 :
550 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
551 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
552 : }
553 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
554 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
555 : }
556 :
557 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
558 0 : allow_remaining = true;
559 : }
560 :
561 0 : return py_unixinfo_SidToUid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
562 : }
563 :
564 0 : static PyObject *py_unixinfo_SidToUid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
565 : {
566 0 : const struct ndr_interface_call *call = NULL;
567 0 : struct unixinfo_SidToUid *object = pytalloc_get_ptr(py_obj);
568 : PyObject *ret;
569 : char *retstr;
570 :
571 0 : if (ndr_table_unixinfo.num_calls < 1) {
572 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_SidToUid_ndr_print");
573 0 : return NULL;
574 : }
575 0 : call = &ndr_table_unixinfo.calls[0];
576 :
577 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
578 0 : ret = PyUnicode_FromString(retstr);
579 0 : TALLOC_FREE(retstr);
580 :
581 0 : return ret;
582 : }
583 :
584 0 : static PyObject *py_unixinfo_SidToUid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
585 : {
586 0 : return py_unixinfo_SidToUid_ndr_print(py_obj, "unixinfo_SidToUid_in", NDR_IN);
587 : }
588 :
589 0 : static PyObject *py_unixinfo_SidToUid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
590 : {
591 0 : return py_unixinfo_SidToUid_ndr_print(py_obj, "unixinfo_SidToUid_out", NDR_OUT);
592 : }
593 :
594 : static PyMethodDef py_unixinfo_SidToUid_methods[] = {
595 : { "opnum", (PyCFunction)py_unixinfo_SidToUid_ndr_opnum, METH_NOARGS|METH_CLASS,
596 : "unixinfo.SidToUid.opnum() -> 0 (0x00) " },
597 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToUid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
598 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
599 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToUid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
600 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
601 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToUid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
602 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
603 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToUid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
604 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
605 : { "__ndr_print_in__", (PyCFunction)py_unixinfo_SidToUid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
606 : { "__ndr_print_out__", (PyCFunction)py_unixinfo_SidToUid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
607 : { NULL, NULL, 0, NULL }
608 : };
609 :
610 :
611 : static PyTypeObject unixinfo_SidToUid_Type = {
612 : PyVarObject_HEAD_INIT(NULL, 0)
613 : .tp_name = "unixinfo.SidToUid",
614 : .tp_getset = py_unixinfo_SidToUid_getsetters,
615 : .tp_methods = py_unixinfo_SidToUid_methods,
616 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
617 : .tp_new = py_unixinfo_SidToUid_new,
618 : };
619 :
620 0 : static bool pack_py_unixinfo_SidToUid_args_in(PyObject *args, PyObject *kwargs, struct unixinfo_SidToUid *r)
621 : {
622 : PyObject *py_sid;
623 0 : const char *kwnames[] = {
624 : "sid", NULL
625 : };
626 :
627 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:unixinfo_SidToUid", discard_const_p(char *, kwnames), &py_sid)) {
628 0 : return false;
629 : }
630 :
631 0 : if (py_sid == NULL) {
632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
633 0 : return false;
634 : }
635 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
636 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
637 0 : PyErr_NoMemory();
638 0 : return false;
639 : }
640 0 : r->in.sid = *(struct dom_sid *)pytalloc_get_ptr(py_sid);
641 0 : return true;
642 : }
643 :
644 0 : static PyObject *unpack_py_unixinfo_SidToUid_args_out(struct unixinfo_SidToUid *r)
645 : {
646 : PyObject *result;
647 : PyObject *py_uid;
648 0 : py_uid = PyLong_FromUnsignedLongLong(*r->out.uid);
649 0 : result = py_uid;
650 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
651 0 : PyErr_SetNTSTATUS(r->out.result);
652 0 : return NULL;
653 : }
654 :
655 0 : return result;
656 : }
657 :
658 :
659 0 : static PyObject *py_unixinfo_UidToSid_in_get_uid(PyObject *obj, void *closure)
660 : {
661 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(obj);
662 : PyObject *py_uid;
663 0 : py_uid = PyLong_FromUnsignedLongLong(object->in.uid);
664 0 : return py_uid;
665 : }
666 :
667 0 : static int py_unixinfo_UidToSid_in_set_uid(PyObject *py_obj, PyObject *value, void *closure)
668 : {
669 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(py_obj);
670 0 : if (value == NULL) {
671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.uid");
672 0 : return -1;
673 : }
674 : {
675 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.uid));
676 0 : if (PyLong_Check(value)) {
677 : unsigned long long test_var;
678 0 : test_var = PyLong_AsUnsignedLongLong(value);
679 0 : if (PyErr_Occurred() != NULL) {
680 0 : return -1;
681 : }
682 0 : if (test_var > uint_max) {
683 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
684 : PyLong_Type.tp_name, uint_max, test_var);
685 0 : return -1;
686 : }
687 0 : object->in.uid = test_var;
688 : } else {
689 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
690 : PyLong_Type.tp_name);
691 0 : return -1;
692 : }
693 : }
694 0 : return 0;
695 : }
696 :
697 0 : static PyObject *py_unixinfo_UidToSid_out_get_sid(PyObject *obj, void *closure)
698 : {
699 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(obj);
700 : PyObject *py_sid;
701 0 : if (object->out.sid == NULL) {
702 0 : Py_RETURN_NONE;
703 : }
704 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
705 0 : return py_sid;
706 : }
707 :
708 0 : static int py_unixinfo_UidToSid_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
709 : {
710 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(py_obj);
711 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
712 0 : if (value == NULL) {
713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sid");
714 0 : return -1;
715 : }
716 0 : object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
717 0 : if (object->out.sid == NULL) {
718 0 : PyErr_NoMemory();
719 0 : return -1;
720 : }
721 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
722 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
723 0 : PyErr_NoMemory();
724 0 : return -1;
725 : }
726 0 : object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
727 0 : return 0;
728 : }
729 :
730 0 : static PyObject *py_unixinfo_UidToSid_get_result(PyObject *obj, void *closure)
731 : {
732 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(obj);
733 : PyObject *py_result;
734 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
735 0 : return py_result;
736 : }
737 :
738 0 : static int py_unixinfo_UidToSid_set_result(PyObject *py_obj, PyObject *value, void *closure)
739 : {
740 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(py_obj);
741 0 : if (value == NULL) {
742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
743 0 : return -1;
744 : }
745 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
746 0 : return 0;
747 : }
748 :
749 : static PyGetSetDef py_unixinfo_UidToSid_getsetters[] = {
750 : {
751 : .name = discard_const_p(char, "in_uid"),
752 : .get = py_unixinfo_UidToSid_in_get_uid,
753 : .set = py_unixinfo_UidToSid_in_set_uid,
754 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
755 : },
756 : {
757 : .name = discard_const_p(char, "out_sid"),
758 : .get = py_unixinfo_UidToSid_out_get_sid,
759 : .set = py_unixinfo_UidToSid_out_set_sid,
760 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
761 : },
762 : {
763 : .name = discard_const_p(char, "result"),
764 : .get = py_unixinfo_UidToSid_get_result,
765 : .set = py_unixinfo_UidToSid_set_result,
766 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
767 : },
768 : { .name = NULL }
769 : };
770 :
771 0 : static PyObject *py_unixinfo_UidToSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
772 : {
773 0 : PyObject *self = pytalloc_new(struct unixinfo_UidToSid, type);
774 0 : struct unixinfo_UidToSid *_self = (struct unixinfo_UidToSid *)pytalloc_get_ptr(self);
775 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
776 0 : _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
777 0 : return self;
778 : }
779 :
780 0 : static PyObject *py_unixinfo_UidToSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
781 : {
782 :
783 :
784 0 : return PyLong_FromLong(1);
785 : }
786 :
787 0 : static PyObject *py_unixinfo_UidToSid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
788 : {
789 0 : const struct ndr_interface_call *call = NULL;
790 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(py_obj);
791 0 : PyObject *ret = NULL;
792 0 : struct ndr_push *push = NULL;
793 : DATA_BLOB blob;
794 : enum ndr_err_code err;
795 :
796 0 : if (ndr_table_unixinfo.num_calls < 2) {
797 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_UidToSid_ndr_pack");
798 0 : return NULL;
799 : }
800 0 : call = &ndr_table_unixinfo.calls[1];
801 :
802 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
803 0 : if (push == NULL) {
804 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
805 0 : return NULL;
806 : }
807 :
808 0 : push->flags |= ndr_push_flags;
809 :
810 0 : err = call->ndr_push(push, ndr_inout_flags, object);
811 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
812 0 : TALLOC_FREE(push);
813 0 : PyErr_SetNdrError(err);
814 0 : return NULL;
815 : }
816 0 : blob = ndr_push_blob(push);
817 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
818 0 : TALLOC_FREE(push);
819 0 : return ret;
820 : }
821 :
822 0 : static PyObject *py_unixinfo_UidToSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
823 : {
824 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
825 0 : PyObject *bigendian_obj = NULL;
826 0 : PyObject *ndr64_obj = NULL;
827 0 : libndr_flags ndr_push_flags = 0;
828 :
829 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
830 : discard_const_p(char *, kwnames),
831 : &bigendian_obj,
832 : &ndr64_obj)) {
833 0 : return NULL;
834 : }
835 :
836 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
837 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
838 : }
839 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
840 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
841 : }
842 :
843 0 : return py_unixinfo_UidToSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
844 : }
845 :
846 0 : static PyObject *py_unixinfo_UidToSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
847 : {
848 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
849 0 : PyObject *bigendian_obj = NULL;
850 0 : PyObject *ndr64_obj = NULL;
851 0 : libndr_flags ndr_push_flags = 0;
852 :
853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
854 : discard_const_p(char *, kwnames),
855 : &bigendian_obj,
856 : &ndr64_obj)) {
857 0 : return NULL;
858 : }
859 :
860 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
861 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
862 : }
863 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
864 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
865 : }
866 :
867 0 : return py_unixinfo_UidToSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
868 : }
869 :
870 0 : static PyObject *py_unixinfo_UidToSid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
871 : {
872 0 : const struct ndr_interface_call *call = NULL;
873 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(py_obj);
874 0 : struct ndr_pull *pull = NULL;
875 : enum ndr_err_code err;
876 :
877 0 : if (ndr_table_unixinfo.num_calls < 2) {
878 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_UidToSid_ndr_unpack");
879 0 : return NULL;
880 : }
881 0 : call = &ndr_table_unixinfo.calls[1];
882 :
883 0 : pull = ndr_pull_init_blob(blob, object);
884 0 : if (pull == NULL) {
885 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
886 0 : return NULL;
887 : }
888 :
889 0 : pull->flags |= ndr_pull_flags;
890 :
891 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
892 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
893 0 : TALLOC_FREE(pull);
894 0 : PyErr_SetNdrError(err);
895 0 : return NULL;
896 : }
897 0 : if (!allow_remaining) {
898 : uint32_t highest_ofs;
899 :
900 0 : if (pull->offset > pull->relative_highest_offset) {
901 0 : highest_ofs = pull->offset;
902 : } else {
903 0 : highest_ofs = pull->relative_highest_offset;
904 : }
905 0 : if (highest_ofs < pull->data_size) {
906 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
907 : "not all bytes consumed ofs[%u] size[%u]",
908 : highest_ofs, pull->data_size);
909 0 : TALLOC_FREE(pull);
910 0 : PyErr_SetNdrError(err);
911 0 : return NULL;
912 : }
913 : }
914 :
915 0 : TALLOC_FREE(pull);
916 0 : Py_RETURN_NONE;
917 : }
918 :
919 0 : static PyObject *py_unixinfo_UidToSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
920 : {
921 : DATA_BLOB blob;
922 0 : Py_ssize_t blob_length = 0;
923 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
924 0 : PyObject *bigendian_obj = NULL;
925 0 : PyObject *ndr64_obj = NULL;
926 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
927 0 : PyObject *allow_remaining_obj = NULL;
928 0 : bool allow_remaining = false;
929 :
930 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
931 : discard_const_p(char *, kwnames),
932 : &blob.data, &blob_length,
933 : &bigendian_obj,
934 : &ndr64_obj,
935 : &allow_remaining_obj)) {
936 0 : return NULL;
937 : }
938 0 : blob.length = blob_length;
939 :
940 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
941 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
942 : }
943 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
944 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
945 : }
946 :
947 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
948 0 : allow_remaining = true;
949 : }
950 :
951 0 : return py_unixinfo_UidToSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
952 : }
953 :
954 0 : static PyObject *py_unixinfo_UidToSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
955 : {
956 : DATA_BLOB blob;
957 0 : Py_ssize_t blob_length = 0;
958 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
959 0 : PyObject *bigendian_obj = NULL;
960 0 : PyObject *ndr64_obj = NULL;
961 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
962 0 : PyObject *allow_remaining_obj = NULL;
963 0 : bool allow_remaining = false;
964 :
965 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
966 : discard_const_p(char *, kwnames),
967 : &blob.data, &blob_length,
968 : &bigendian_obj,
969 : &ndr64_obj,
970 : &allow_remaining_obj)) {
971 0 : return NULL;
972 : }
973 0 : blob.length = blob_length;
974 :
975 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
976 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
977 : }
978 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
979 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
980 : }
981 :
982 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
983 0 : allow_remaining = true;
984 : }
985 :
986 0 : return py_unixinfo_UidToSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
987 : }
988 :
989 0 : static PyObject *py_unixinfo_UidToSid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
990 : {
991 0 : const struct ndr_interface_call *call = NULL;
992 0 : struct unixinfo_UidToSid *object = pytalloc_get_ptr(py_obj);
993 : PyObject *ret;
994 : char *retstr;
995 :
996 0 : if (ndr_table_unixinfo.num_calls < 2) {
997 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_UidToSid_ndr_print");
998 0 : return NULL;
999 : }
1000 0 : call = &ndr_table_unixinfo.calls[1];
1001 :
1002 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
1003 0 : ret = PyUnicode_FromString(retstr);
1004 0 : TALLOC_FREE(retstr);
1005 :
1006 0 : return ret;
1007 : }
1008 :
1009 0 : static PyObject *py_unixinfo_UidToSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1010 : {
1011 0 : return py_unixinfo_UidToSid_ndr_print(py_obj, "unixinfo_UidToSid_in", NDR_IN);
1012 : }
1013 :
1014 0 : static PyObject *py_unixinfo_UidToSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1015 : {
1016 0 : return py_unixinfo_UidToSid_ndr_print(py_obj, "unixinfo_UidToSid_out", NDR_OUT);
1017 : }
1018 :
1019 : static PyMethodDef py_unixinfo_UidToSid_methods[] = {
1020 : { "opnum", (PyCFunction)py_unixinfo_UidToSid_ndr_opnum, METH_NOARGS|METH_CLASS,
1021 : "unixinfo.UidToSid.opnum() -> 1 (0x01) " },
1022 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_UidToSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
1023 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
1024 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_UidToSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
1025 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
1026 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_UidToSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
1027 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
1028 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_UidToSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
1029 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
1030 : { "__ndr_print_in__", (PyCFunction)py_unixinfo_UidToSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
1031 : { "__ndr_print_out__", (PyCFunction)py_unixinfo_UidToSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
1032 : { NULL, NULL, 0, NULL }
1033 : };
1034 :
1035 :
1036 : static PyTypeObject unixinfo_UidToSid_Type = {
1037 : PyVarObject_HEAD_INIT(NULL, 0)
1038 : .tp_name = "unixinfo.UidToSid",
1039 : .tp_getset = py_unixinfo_UidToSid_getsetters,
1040 : .tp_methods = py_unixinfo_UidToSid_methods,
1041 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1042 : .tp_new = py_unixinfo_UidToSid_new,
1043 : };
1044 :
1045 0 : static bool pack_py_unixinfo_UidToSid_args_in(PyObject *args, PyObject *kwargs, struct unixinfo_UidToSid *r)
1046 : {
1047 : PyObject *py_uid;
1048 0 : const char *kwnames[] = {
1049 : "uid", NULL
1050 : };
1051 :
1052 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:unixinfo_UidToSid", discard_const_p(char *, kwnames), &py_uid)) {
1053 0 : return false;
1054 : }
1055 :
1056 0 : if (py_uid == NULL) {
1057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.uid");
1058 0 : return false;
1059 : }
1060 : {
1061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.uid));
1062 0 : if (PyLong_Check(py_uid)) {
1063 : unsigned long long test_var;
1064 0 : test_var = PyLong_AsUnsignedLongLong(py_uid);
1065 0 : if (PyErr_Occurred() != NULL) {
1066 0 : return false;
1067 : }
1068 0 : if (test_var > uint_max) {
1069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1070 : PyLong_Type.tp_name, uint_max, test_var);
1071 0 : return false;
1072 : }
1073 0 : r->in.uid = test_var;
1074 : } else {
1075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1076 : PyLong_Type.tp_name);
1077 0 : return false;
1078 : }
1079 : }
1080 0 : return true;
1081 : }
1082 :
1083 0 : static PyObject *unpack_py_unixinfo_UidToSid_args_out(struct unixinfo_UidToSid *r)
1084 : {
1085 : PyObject *result;
1086 : PyObject *py_sid;
1087 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
1088 0 : result = py_sid;
1089 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
1090 0 : PyErr_SetNTSTATUS(r->out.result);
1091 0 : return NULL;
1092 : }
1093 :
1094 0 : return result;
1095 : }
1096 :
1097 :
1098 0 : static PyObject *py_unixinfo_SidToGid_in_get_sid(PyObject *obj, void *closure)
1099 : {
1100 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(obj);
1101 : PyObject *py_sid;
1102 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->in.sid);
1103 0 : return py_sid;
1104 : }
1105 :
1106 0 : static int py_unixinfo_SidToGid_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
1107 : {
1108 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(py_obj);
1109 0 : if (value == NULL) {
1110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
1111 0 : return -1;
1112 : }
1113 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
1114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1115 0 : PyErr_NoMemory();
1116 0 : return -1;
1117 : }
1118 0 : object->in.sid = *(struct dom_sid *)pytalloc_get_ptr(value);
1119 0 : return 0;
1120 : }
1121 :
1122 0 : static PyObject *py_unixinfo_SidToGid_out_get_gid(PyObject *obj, void *closure)
1123 : {
1124 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(obj);
1125 : PyObject *py_gid;
1126 0 : if (object->out.gid == NULL) {
1127 0 : Py_RETURN_NONE;
1128 : }
1129 0 : py_gid = PyLong_FromUnsignedLongLong(*object->out.gid);
1130 0 : return py_gid;
1131 : }
1132 :
1133 0 : static int py_unixinfo_SidToGid_out_set_gid(PyObject *py_obj, PyObject *value, void *closure)
1134 : {
1135 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(py_obj);
1136 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gid));
1137 0 : if (value == NULL) {
1138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.gid");
1139 0 : return -1;
1140 : }
1141 0 : object->out.gid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gid);
1142 0 : if (object->out.gid == NULL) {
1143 0 : PyErr_NoMemory();
1144 0 : return -1;
1145 : }
1146 : {
1147 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.gid));
1148 0 : if (PyLong_Check(value)) {
1149 : unsigned long long test_var;
1150 0 : test_var = PyLong_AsUnsignedLongLong(value);
1151 0 : if (PyErr_Occurred() != NULL) {
1152 0 : return -1;
1153 : }
1154 0 : if (test_var > uint_max) {
1155 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1156 : PyLong_Type.tp_name, uint_max, test_var);
1157 0 : return -1;
1158 : }
1159 0 : *object->out.gid = test_var;
1160 : } else {
1161 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1162 : PyLong_Type.tp_name);
1163 0 : return -1;
1164 : }
1165 : }
1166 0 : return 0;
1167 : }
1168 :
1169 0 : static PyObject *py_unixinfo_SidToGid_get_result(PyObject *obj, void *closure)
1170 : {
1171 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(obj);
1172 : PyObject *py_result;
1173 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
1174 0 : return py_result;
1175 : }
1176 :
1177 0 : static int py_unixinfo_SidToGid_set_result(PyObject *py_obj, PyObject *value, void *closure)
1178 : {
1179 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(py_obj);
1180 0 : if (value == NULL) {
1181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
1182 0 : return -1;
1183 : }
1184 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
1185 0 : return 0;
1186 : }
1187 :
1188 : static PyGetSetDef py_unixinfo_SidToGid_getsetters[] = {
1189 : {
1190 : .name = discard_const_p(char, "in_sid"),
1191 : .get = py_unixinfo_SidToGid_in_get_sid,
1192 : .set = py_unixinfo_SidToGid_in_set_sid,
1193 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1194 : },
1195 : {
1196 : .name = discard_const_p(char, "out_gid"),
1197 : .get = py_unixinfo_SidToGid_out_get_gid,
1198 : .set = py_unixinfo_SidToGid_out_set_gid,
1199 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1200 : },
1201 : {
1202 : .name = discard_const_p(char, "result"),
1203 : .get = py_unixinfo_SidToGid_get_result,
1204 : .set = py_unixinfo_SidToGid_set_result,
1205 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
1206 : },
1207 : { .name = NULL }
1208 : };
1209 :
1210 0 : static PyObject *py_unixinfo_SidToGid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1211 : {
1212 0 : PyObject *self = pytalloc_new(struct unixinfo_SidToGid, type);
1213 0 : struct unixinfo_SidToGid *_self = (struct unixinfo_SidToGid *)pytalloc_get_ptr(self);
1214 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
1215 0 : _self->out.gid = talloc_zero(mem_ctx, uint64_t);
1216 0 : return self;
1217 : }
1218 :
1219 0 : static PyObject *py_unixinfo_SidToGid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
1220 : {
1221 :
1222 :
1223 0 : return PyLong_FromLong(2);
1224 : }
1225 :
1226 0 : static PyObject *py_unixinfo_SidToGid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
1227 : {
1228 0 : const struct ndr_interface_call *call = NULL;
1229 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(py_obj);
1230 0 : PyObject *ret = NULL;
1231 0 : struct ndr_push *push = NULL;
1232 : DATA_BLOB blob;
1233 : enum ndr_err_code err;
1234 :
1235 0 : if (ndr_table_unixinfo.num_calls < 3) {
1236 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_SidToGid_ndr_pack");
1237 0 : return NULL;
1238 : }
1239 0 : call = &ndr_table_unixinfo.calls[2];
1240 :
1241 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
1242 0 : if (push == NULL) {
1243 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1244 0 : return NULL;
1245 : }
1246 :
1247 0 : push->flags |= ndr_push_flags;
1248 :
1249 0 : err = call->ndr_push(push, ndr_inout_flags, object);
1250 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1251 0 : TALLOC_FREE(push);
1252 0 : PyErr_SetNdrError(err);
1253 0 : return NULL;
1254 : }
1255 0 : blob = ndr_push_blob(push);
1256 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1257 0 : TALLOC_FREE(push);
1258 0 : return ret;
1259 : }
1260 :
1261 0 : static PyObject *py_unixinfo_SidToGid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1262 : {
1263 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
1264 0 : PyObject *bigendian_obj = NULL;
1265 0 : PyObject *ndr64_obj = NULL;
1266 0 : libndr_flags ndr_push_flags = 0;
1267 :
1268 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
1269 : discard_const_p(char *, kwnames),
1270 : &bigendian_obj,
1271 : &ndr64_obj)) {
1272 0 : return NULL;
1273 : }
1274 :
1275 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1276 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
1277 : }
1278 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1279 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
1280 : }
1281 :
1282 0 : return py_unixinfo_SidToGid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
1283 : }
1284 :
1285 0 : static PyObject *py_unixinfo_SidToGid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1286 : {
1287 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
1288 0 : PyObject *bigendian_obj = NULL;
1289 0 : PyObject *ndr64_obj = NULL;
1290 0 : libndr_flags ndr_push_flags = 0;
1291 :
1292 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
1293 : discard_const_p(char *, kwnames),
1294 : &bigendian_obj,
1295 : &ndr64_obj)) {
1296 0 : return NULL;
1297 : }
1298 :
1299 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1300 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
1301 : }
1302 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1303 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
1304 : }
1305 :
1306 0 : return py_unixinfo_SidToGid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
1307 : }
1308 :
1309 0 : static PyObject *py_unixinfo_SidToGid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
1310 : {
1311 0 : const struct ndr_interface_call *call = NULL;
1312 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(py_obj);
1313 0 : struct ndr_pull *pull = NULL;
1314 : enum ndr_err_code err;
1315 :
1316 0 : if (ndr_table_unixinfo.num_calls < 3) {
1317 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_SidToGid_ndr_unpack");
1318 0 : return NULL;
1319 : }
1320 0 : call = &ndr_table_unixinfo.calls[2];
1321 :
1322 0 : pull = ndr_pull_init_blob(blob, object);
1323 0 : if (pull == NULL) {
1324 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1325 0 : return NULL;
1326 : }
1327 :
1328 0 : pull->flags |= ndr_pull_flags;
1329 :
1330 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
1331 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1332 0 : TALLOC_FREE(pull);
1333 0 : PyErr_SetNdrError(err);
1334 0 : return NULL;
1335 : }
1336 0 : if (!allow_remaining) {
1337 : uint32_t highest_ofs;
1338 :
1339 0 : if (pull->offset > pull->relative_highest_offset) {
1340 0 : highest_ofs = pull->offset;
1341 : } else {
1342 0 : highest_ofs = pull->relative_highest_offset;
1343 : }
1344 0 : if (highest_ofs < pull->data_size) {
1345 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
1346 : "not all bytes consumed ofs[%u] size[%u]",
1347 : highest_ofs, pull->data_size);
1348 0 : TALLOC_FREE(pull);
1349 0 : PyErr_SetNdrError(err);
1350 0 : return NULL;
1351 : }
1352 : }
1353 :
1354 0 : TALLOC_FREE(pull);
1355 0 : Py_RETURN_NONE;
1356 : }
1357 :
1358 0 : static PyObject *py_unixinfo_SidToGid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1359 : {
1360 : DATA_BLOB blob;
1361 0 : Py_ssize_t blob_length = 0;
1362 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
1363 0 : PyObject *bigendian_obj = NULL;
1364 0 : PyObject *ndr64_obj = NULL;
1365 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
1366 0 : PyObject *allow_remaining_obj = NULL;
1367 0 : bool allow_remaining = false;
1368 :
1369 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
1370 : discard_const_p(char *, kwnames),
1371 : &blob.data, &blob_length,
1372 : &bigendian_obj,
1373 : &ndr64_obj,
1374 : &allow_remaining_obj)) {
1375 0 : return NULL;
1376 : }
1377 0 : blob.length = blob_length;
1378 :
1379 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1380 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
1381 : }
1382 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1383 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
1384 : }
1385 :
1386 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1387 0 : allow_remaining = true;
1388 : }
1389 :
1390 0 : return py_unixinfo_SidToGid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
1391 : }
1392 :
1393 0 : static PyObject *py_unixinfo_SidToGid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1394 : {
1395 : DATA_BLOB blob;
1396 0 : Py_ssize_t blob_length = 0;
1397 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
1398 0 : PyObject *bigendian_obj = NULL;
1399 0 : PyObject *ndr64_obj = NULL;
1400 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
1401 0 : PyObject *allow_remaining_obj = NULL;
1402 0 : bool allow_remaining = false;
1403 :
1404 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
1405 : discard_const_p(char *, kwnames),
1406 : &blob.data, &blob_length,
1407 : &bigendian_obj,
1408 : &ndr64_obj,
1409 : &allow_remaining_obj)) {
1410 0 : return NULL;
1411 : }
1412 0 : blob.length = blob_length;
1413 :
1414 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1415 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
1416 : }
1417 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1418 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
1419 : }
1420 :
1421 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1422 0 : allow_remaining = true;
1423 : }
1424 :
1425 0 : return py_unixinfo_SidToGid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
1426 : }
1427 :
1428 0 : static PyObject *py_unixinfo_SidToGid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
1429 : {
1430 0 : const struct ndr_interface_call *call = NULL;
1431 0 : struct unixinfo_SidToGid *object = pytalloc_get_ptr(py_obj);
1432 : PyObject *ret;
1433 : char *retstr;
1434 :
1435 0 : if (ndr_table_unixinfo.num_calls < 3) {
1436 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_SidToGid_ndr_print");
1437 0 : return NULL;
1438 : }
1439 0 : call = &ndr_table_unixinfo.calls[2];
1440 :
1441 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
1442 0 : ret = PyUnicode_FromString(retstr);
1443 0 : TALLOC_FREE(retstr);
1444 :
1445 0 : return ret;
1446 : }
1447 :
1448 0 : static PyObject *py_unixinfo_SidToGid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1449 : {
1450 0 : return py_unixinfo_SidToGid_ndr_print(py_obj, "unixinfo_SidToGid_in", NDR_IN);
1451 : }
1452 :
1453 0 : static PyObject *py_unixinfo_SidToGid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1454 : {
1455 0 : return py_unixinfo_SidToGid_ndr_print(py_obj, "unixinfo_SidToGid_out", NDR_OUT);
1456 : }
1457 :
1458 : static PyMethodDef py_unixinfo_SidToGid_methods[] = {
1459 : { "opnum", (PyCFunction)py_unixinfo_SidToGid_ndr_opnum, METH_NOARGS|METH_CLASS,
1460 : "unixinfo.SidToGid.opnum() -> 2 (0x02) " },
1461 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToGid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
1462 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
1463 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToGid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
1464 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
1465 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToGid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
1466 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
1467 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_SidToGid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
1468 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
1469 : { "__ndr_print_in__", (PyCFunction)py_unixinfo_SidToGid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
1470 : { "__ndr_print_out__", (PyCFunction)py_unixinfo_SidToGid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
1471 : { NULL, NULL, 0, NULL }
1472 : };
1473 :
1474 :
1475 : static PyTypeObject unixinfo_SidToGid_Type = {
1476 : PyVarObject_HEAD_INIT(NULL, 0)
1477 : .tp_name = "unixinfo.SidToGid",
1478 : .tp_getset = py_unixinfo_SidToGid_getsetters,
1479 : .tp_methods = py_unixinfo_SidToGid_methods,
1480 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1481 : .tp_new = py_unixinfo_SidToGid_new,
1482 : };
1483 :
1484 0 : static bool pack_py_unixinfo_SidToGid_args_in(PyObject *args, PyObject *kwargs, struct unixinfo_SidToGid *r)
1485 : {
1486 : PyObject *py_sid;
1487 0 : const char *kwnames[] = {
1488 : "sid", NULL
1489 : };
1490 :
1491 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:unixinfo_SidToGid", discard_const_p(char *, kwnames), &py_sid)) {
1492 0 : return false;
1493 : }
1494 :
1495 0 : if (py_sid == NULL) {
1496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
1497 0 : return false;
1498 : }
1499 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
1500 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
1501 0 : PyErr_NoMemory();
1502 0 : return false;
1503 : }
1504 0 : r->in.sid = *(struct dom_sid *)pytalloc_get_ptr(py_sid);
1505 0 : return true;
1506 : }
1507 :
1508 0 : static PyObject *unpack_py_unixinfo_SidToGid_args_out(struct unixinfo_SidToGid *r)
1509 : {
1510 : PyObject *result;
1511 : PyObject *py_gid;
1512 0 : py_gid = PyLong_FromUnsignedLongLong(*r->out.gid);
1513 0 : result = py_gid;
1514 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
1515 0 : PyErr_SetNTSTATUS(r->out.result);
1516 0 : return NULL;
1517 : }
1518 :
1519 0 : return result;
1520 : }
1521 :
1522 :
1523 0 : static PyObject *py_unixinfo_GidToSid_in_get_gid(PyObject *obj, void *closure)
1524 : {
1525 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(obj);
1526 : PyObject *py_gid;
1527 0 : py_gid = PyLong_FromUnsignedLongLong(object->in.gid);
1528 0 : return py_gid;
1529 : }
1530 :
1531 0 : static int py_unixinfo_GidToSid_in_set_gid(PyObject *py_obj, PyObject *value, void *closure)
1532 : {
1533 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(py_obj);
1534 0 : if (value == NULL) {
1535 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.gid");
1536 0 : return -1;
1537 : }
1538 : {
1539 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.gid));
1540 0 : if (PyLong_Check(value)) {
1541 : unsigned long long test_var;
1542 0 : test_var = PyLong_AsUnsignedLongLong(value);
1543 0 : if (PyErr_Occurred() != NULL) {
1544 0 : return -1;
1545 : }
1546 0 : if (test_var > uint_max) {
1547 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1548 : PyLong_Type.tp_name, uint_max, test_var);
1549 0 : return -1;
1550 : }
1551 0 : object->in.gid = test_var;
1552 : } else {
1553 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1554 : PyLong_Type.tp_name);
1555 0 : return -1;
1556 : }
1557 : }
1558 0 : return 0;
1559 : }
1560 :
1561 0 : static PyObject *py_unixinfo_GidToSid_out_get_sid(PyObject *obj, void *closure)
1562 : {
1563 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(obj);
1564 : PyObject *py_sid;
1565 0 : if (object->out.sid == NULL) {
1566 0 : Py_RETURN_NONE;
1567 : }
1568 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
1569 0 : return py_sid;
1570 : }
1571 :
1572 0 : static int py_unixinfo_GidToSid_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
1573 : {
1574 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(py_obj);
1575 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
1576 0 : if (value == NULL) {
1577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sid");
1578 0 : return -1;
1579 : }
1580 0 : object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
1581 0 : if (object->out.sid == NULL) {
1582 0 : PyErr_NoMemory();
1583 0 : return -1;
1584 : }
1585 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
1586 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1587 0 : PyErr_NoMemory();
1588 0 : return -1;
1589 : }
1590 0 : object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
1591 0 : return 0;
1592 : }
1593 :
1594 0 : static PyObject *py_unixinfo_GidToSid_get_result(PyObject *obj, void *closure)
1595 : {
1596 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(obj);
1597 : PyObject *py_result;
1598 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
1599 0 : return py_result;
1600 : }
1601 :
1602 0 : static int py_unixinfo_GidToSid_set_result(PyObject *py_obj, PyObject *value, void *closure)
1603 : {
1604 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(py_obj);
1605 0 : if (value == NULL) {
1606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
1607 0 : return -1;
1608 : }
1609 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
1610 0 : return 0;
1611 : }
1612 :
1613 : static PyGetSetDef py_unixinfo_GidToSid_getsetters[] = {
1614 : {
1615 : .name = discard_const_p(char, "in_gid"),
1616 : .get = py_unixinfo_GidToSid_in_get_gid,
1617 : .set = py_unixinfo_GidToSid_in_set_gid,
1618 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1619 : },
1620 : {
1621 : .name = discard_const_p(char, "out_sid"),
1622 : .get = py_unixinfo_GidToSid_out_get_sid,
1623 : .set = py_unixinfo_GidToSid_out_set_sid,
1624 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1625 : },
1626 : {
1627 : .name = discard_const_p(char, "result"),
1628 : .get = py_unixinfo_GidToSid_get_result,
1629 : .set = py_unixinfo_GidToSid_set_result,
1630 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
1631 : },
1632 : { .name = NULL }
1633 : };
1634 :
1635 0 : static PyObject *py_unixinfo_GidToSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1636 : {
1637 0 : PyObject *self = pytalloc_new(struct unixinfo_GidToSid, type);
1638 0 : struct unixinfo_GidToSid *_self = (struct unixinfo_GidToSid *)pytalloc_get_ptr(self);
1639 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
1640 0 : _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
1641 0 : return self;
1642 : }
1643 :
1644 0 : static PyObject *py_unixinfo_GidToSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
1645 : {
1646 :
1647 :
1648 0 : return PyLong_FromLong(3);
1649 : }
1650 :
1651 0 : static PyObject *py_unixinfo_GidToSid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
1652 : {
1653 0 : const struct ndr_interface_call *call = NULL;
1654 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(py_obj);
1655 0 : PyObject *ret = NULL;
1656 0 : struct ndr_push *push = NULL;
1657 : DATA_BLOB blob;
1658 : enum ndr_err_code err;
1659 :
1660 0 : if (ndr_table_unixinfo.num_calls < 4) {
1661 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_GidToSid_ndr_pack");
1662 0 : return NULL;
1663 : }
1664 0 : call = &ndr_table_unixinfo.calls[3];
1665 :
1666 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
1667 0 : if (push == NULL) {
1668 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1669 0 : return NULL;
1670 : }
1671 :
1672 0 : push->flags |= ndr_push_flags;
1673 :
1674 0 : err = call->ndr_push(push, ndr_inout_flags, object);
1675 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1676 0 : TALLOC_FREE(push);
1677 0 : PyErr_SetNdrError(err);
1678 0 : return NULL;
1679 : }
1680 0 : blob = ndr_push_blob(push);
1681 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1682 0 : TALLOC_FREE(push);
1683 0 : return ret;
1684 : }
1685 :
1686 0 : static PyObject *py_unixinfo_GidToSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1687 : {
1688 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
1689 0 : PyObject *bigendian_obj = NULL;
1690 0 : PyObject *ndr64_obj = NULL;
1691 0 : libndr_flags ndr_push_flags = 0;
1692 :
1693 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
1694 : discard_const_p(char *, kwnames),
1695 : &bigendian_obj,
1696 : &ndr64_obj)) {
1697 0 : return NULL;
1698 : }
1699 :
1700 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1701 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
1702 : }
1703 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1704 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
1705 : }
1706 :
1707 0 : return py_unixinfo_GidToSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
1708 : }
1709 :
1710 0 : static PyObject *py_unixinfo_GidToSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1711 : {
1712 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
1713 0 : PyObject *bigendian_obj = NULL;
1714 0 : PyObject *ndr64_obj = NULL;
1715 0 : libndr_flags ndr_push_flags = 0;
1716 :
1717 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
1718 : discard_const_p(char *, kwnames),
1719 : &bigendian_obj,
1720 : &ndr64_obj)) {
1721 0 : return NULL;
1722 : }
1723 :
1724 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1725 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
1726 : }
1727 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1728 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
1729 : }
1730 :
1731 0 : return py_unixinfo_GidToSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
1732 : }
1733 :
1734 0 : static PyObject *py_unixinfo_GidToSid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
1735 : {
1736 0 : const struct ndr_interface_call *call = NULL;
1737 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(py_obj);
1738 0 : struct ndr_pull *pull = NULL;
1739 : enum ndr_err_code err;
1740 :
1741 0 : if (ndr_table_unixinfo.num_calls < 4) {
1742 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_GidToSid_ndr_unpack");
1743 0 : return NULL;
1744 : }
1745 0 : call = &ndr_table_unixinfo.calls[3];
1746 :
1747 0 : pull = ndr_pull_init_blob(blob, object);
1748 0 : if (pull == NULL) {
1749 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1750 0 : return NULL;
1751 : }
1752 :
1753 0 : pull->flags |= ndr_pull_flags;
1754 :
1755 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
1756 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1757 0 : TALLOC_FREE(pull);
1758 0 : PyErr_SetNdrError(err);
1759 0 : return NULL;
1760 : }
1761 0 : if (!allow_remaining) {
1762 : uint32_t highest_ofs;
1763 :
1764 0 : if (pull->offset > pull->relative_highest_offset) {
1765 0 : highest_ofs = pull->offset;
1766 : } else {
1767 0 : highest_ofs = pull->relative_highest_offset;
1768 : }
1769 0 : if (highest_ofs < pull->data_size) {
1770 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
1771 : "not all bytes consumed ofs[%u] size[%u]",
1772 : highest_ofs, pull->data_size);
1773 0 : TALLOC_FREE(pull);
1774 0 : PyErr_SetNdrError(err);
1775 0 : return NULL;
1776 : }
1777 : }
1778 :
1779 0 : TALLOC_FREE(pull);
1780 0 : Py_RETURN_NONE;
1781 : }
1782 :
1783 0 : static PyObject *py_unixinfo_GidToSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1784 : {
1785 : DATA_BLOB blob;
1786 0 : Py_ssize_t blob_length = 0;
1787 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
1788 0 : PyObject *bigendian_obj = NULL;
1789 0 : PyObject *ndr64_obj = NULL;
1790 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
1791 0 : PyObject *allow_remaining_obj = NULL;
1792 0 : bool allow_remaining = false;
1793 :
1794 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
1795 : discard_const_p(char *, kwnames),
1796 : &blob.data, &blob_length,
1797 : &bigendian_obj,
1798 : &ndr64_obj,
1799 : &allow_remaining_obj)) {
1800 0 : return NULL;
1801 : }
1802 0 : blob.length = blob_length;
1803 :
1804 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1805 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
1806 : }
1807 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1808 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
1809 : }
1810 :
1811 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1812 0 : allow_remaining = true;
1813 : }
1814 :
1815 0 : return py_unixinfo_GidToSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
1816 : }
1817 :
1818 0 : static PyObject *py_unixinfo_GidToSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1819 : {
1820 : DATA_BLOB blob;
1821 0 : Py_ssize_t blob_length = 0;
1822 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
1823 0 : PyObject *bigendian_obj = NULL;
1824 0 : PyObject *ndr64_obj = NULL;
1825 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
1826 0 : PyObject *allow_remaining_obj = NULL;
1827 0 : bool allow_remaining = false;
1828 :
1829 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
1830 : discard_const_p(char *, kwnames),
1831 : &blob.data, &blob_length,
1832 : &bigendian_obj,
1833 : &ndr64_obj,
1834 : &allow_remaining_obj)) {
1835 0 : return NULL;
1836 : }
1837 0 : blob.length = blob_length;
1838 :
1839 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
1840 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
1841 : }
1842 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
1843 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
1844 : }
1845 :
1846 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1847 0 : allow_remaining = true;
1848 : }
1849 :
1850 0 : return py_unixinfo_GidToSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
1851 : }
1852 :
1853 0 : static PyObject *py_unixinfo_GidToSid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
1854 : {
1855 0 : const struct ndr_interface_call *call = NULL;
1856 0 : struct unixinfo_GidToSid *object = pytalloc_get_ptr(py_obj);
1857 : PyObject *ret;
1858 : char *retstr;
1859 :
1860 0 : if (ndr_table_unixinfo.num_calls < 4) {
1861 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_GidToSid_ndr_print");
1862 0 : return NULL;
1863 : }
1864 0 : call = &ndr_table_unixinfo.calls[3];
1865 :
1866 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
1867 0 : ret = PyUnicode_FromString(retstr);
1868 0 : TALLOC_FREE(retstr);
1869 :
1870 0 : return ret;
1871 : }
1872 :
1873 0 : static PyObject *py_unixinfo_GidToSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1874 : {
1875 0 : return py_unixinfo_GidToSid_ndr_print(py_obj, "unixinfo_GidToSid_in", NDR_IN);
1876 : }
1877 :
1878 0 : static PyObject *py_unixinfo_GidToSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1879 : {
1880 0 : return py_unixinfo_GidToSid_ndr_print(py_obj, "unixinfo_GidToSid_out", NDR_OUT);
1881 : }
1882 :
1883 : static PyMethodDef py_unixinfo_GidToSid_methods[] = {
1884 : { "opnum", (PyCFunction)py_unixinfo_GidToSid_ndr_opnum, METH_NOARGS|METH_CLASS,
1885 : "unixinfo.GidToSid.opnum() -> 3 (0x03) " },
1886 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GidToSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
1887 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
1888 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GidToSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
1889 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
1890 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GidToSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
1891 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
1892 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GidToSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
1893 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
1894 : { "__ndr_print_in__", (PyCFunction)py_unixinfo_GidToSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
1895 : { "__ndr_print_out__", (PyCFunction)py_unixinfo_GidToSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
1896 : { NULL, NULL, 0, NULL }
1897 : };
1898 :
1899 :
1900 : static PyTypeObject unixinfo_GidToSid_Type = {
1901 : PyVarObject_HEAD_INIT(NULL, 0)
1902 : .tp_name = "unixinfo.GidToSid",
1903 : .tp_getset = py_unixinfo_GidToSid_getsetters,
1904 : .tp_methods = py_unixinfo_GidToSid_methods,
1905 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1906 : .tp_new = py_unixinfo_GidToSid_new,
1907 : };
1908 :
1909 0 : static bool pack_py_unixinfo_GidToSid_args_in(PyObject *args, PyObject *kwargs, struct unixinfo_GidToSid *r)
1910 : {
1911 : PyObject *py_gid;
1912 0 : const char *kwnames[] = {
1913 : "gid", NULL
1914 : };
1915 :
1916 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:unixinfo_GidToSid", discard_const_p(char *, kwnames), &py_gid)) {
1917 0 : return false;
1918 : }
1919 :
1920 0 : if (py_gid == NULL) {
1921 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.gid");
1922 0 : return false;
1923 : }
1924 : {
1925 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.gid));
1926 0 : if (PyLong_Check(py_gid)) {
1927 : unsigned long long test_var;
1928 0 : test_var = PyLong_AsUnsignedLongLong(py_gid);
1929 0 : if (PyErr_Occurred() != NULL) {
1930 0 : return false;
1931 : }
1932 0 : if (test_var > uint_max) {
1933 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1934 : PyLong_Type.tp_name, uint_max, test_var);
1935 0 : return false;
1936 : }
1937 0 : r->in.gid = test_var;
1938 : } else {
1939 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1940 : PyLong_Type.tp_name);
1941 0 : return false;
1942 : }
1943 : }
1944 0 : return true;
1945 : }
1946 :
1947 0 : static PyObject *unpack_py_unixinfo_GidToSid_args_out(struct unixinfo_GidToSid *r)
1948 : {
1949 : PyObject *result;
1950 : PyObject *py_sid;
1951 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
1952 0 : result = py_sid;
1953 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
1954 0 : PyErr_SetNTSTATUS(r->out.result);
1955 0 : return NULL;
1956 : }
1957 :
1958 0 : return result;
1959 : }
1960 :
1961 :
1962 0 : static PyObject *py_unixinfo_GetPWUid_in_get_count(PyObject *obj, void *closure)
1963 : {
1964 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(obj);
1965 : PyObject *py_count;
1966 0 : if (object->in.count == NULL) {
1967 0 : Py_RETURN_NONE;
1968 : }
1969 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
1970 0 : return py_count;
1971 : }
1972 :
1973 0 : static int py_unixinfo_GetPWUid_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
1974 : {
1975 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
1976 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
1977 0 : if (value == NULL) {
1978 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
1979 0 : return -1;
1980 : }
1981 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
1982 0 : if (object->in.count == NULL) {
1983 0 : PyErr_NoMemory();
1984 0 : return -1;
1985 : }
1986 : {
1987 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
1988 0 : if (PyLong_Check(value)) {
1989 : unsigned long long test_var;
1990 0 : test_var = PyLong_AsUnsignedLongLong(value);
1991 0 : if (PyErr_Occurred() != NULL) {
1992 0 : return -1;
1993 : }
1994 0 : if (test_var > uint_max) {
1995 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1996 : PyLong_Type.tp_name, uint_max, test_var);
1997 0 : return -1;
1998 : }
1999 0 : *object->in.count = test_var;
2000 : } else {
2001 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2002 : PyLong_Type.tp_name);
2003 0 : return -1;
2004 : }
2005 : }
2006 0 : return 0;
2007 : }
2008 :
2009 0 : static PyObject *py_unixinfo_GetPWUid_out_get_count(PyObject *obj, void *closure)
2010 : {
2011 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(obj);
2012 : PyObject *py_count;
2013 0 : if (object->out.count == NULL) {
2014 0 : Py_RETURN_NONE;
2015 : }
2016 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
2017 0 : return py_count;
2018 : }
2019 :
2020 0 : static int py_unixinfo_GetPWUid_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
2021 : {
2022 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2023 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
2024 0 : if (value == NULL) {
2025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
2026 0 : return -1;
2027 : }
2028 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
2029 0 : if (object->out.count == NULL) {
2030 0 : PyErr_NoMemory();
2031 0 : return -1;
2032 : }
2033 : {
2034 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
2035 0 : if (PyLong_Check(value)) {
2036 : unsigned long long test_var;
2037 0 : test_var = PyLong_AsUnsignedLongLong(value);
2038 0 : if (PyErr_Occurred() != NULL) {
2039 0 : return -1;
2040 : }
2041 0 : if (test_var > uint_max) {
2042 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2043 : PyLong_Type.tp_name, uint_max, test_var);
2044 0 : return -1;
2045 : }
2046 0 : *object->out.count = test_var;
2047 : } else {
2048 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2049 : PyLong_Type.tp_name);
2050 0 : return -1;
2051 : }
2052 : }
2053 0 : return 0;
2054 : }
2055 :
2056 0 : static PyObject *py_unixinfo_GetPWUid_in_get_uids(PyObject *obj, void *closure)
2057 : {
2058 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(obj);
2059 : PyObject *py_uids;
2060 0 : py_uids = PyList_New(*object->in.count);
2061 0 : if (py_uids == NULL) {
2062 0 : return NULL;
2063 : }
2064 : {
2065 : int uids_cntr_0;
2066 0 : for (uids_cntr_0 = 0; uids_cntr_0 < (*object->in.count); uids_cntr_0++) {
2067 : PyObject *py_uids_0;
2068 0 : py_uids_0 = PyLong_FromUnsignedLongLong((object->in.uids)[uids_cntr_0]);
2069 0 : PyList_SetItem(py_uids, uids_cntr_0, py_uids_0);
2070 : }
2071 : }
2072 0 : return py_uids;
2073 : }
2074 :
2075 0 : static int py_unixinfo_GetPWUid_in_set_uids(PyObject *py_obj, PyObject *value, void *closure)
2076 : {
2077 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2078 0 : if (value == NULL) {
2079 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.uids");
2080 0 : return -1;
2081 : }
2082 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2083 : {
2084 : int uids_cntr_0;
2085 0 : object->in.uids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.uids, PyList_GET_SIZE(value));
2086 0 : if (!object->in.uids) { return -1; }
2087 0 : talloc_set_name_const(object->in.uids, "ARRAY: object->in.uids");
2088 0 : for (uids_cntr_0 = 0; uids_cntr_0 < PyList_GET_SIZE(value); uids_cntr_0++) {
2089 0 : if (PyList_GET_ITEM(value, uids_cntr_0) == NULL) {
2090 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.uids)[uids_cntr_0]");
2091 0 : return -1;
2092 : }
2093 : {
2094 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.uids)[uids_cntr_0]));
2095 0 : if (PyLong_Check(PyList_GET_ITEM(value, uids_cntr_0))) {
2096 : unsigned long long test_var;
2097 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, uids_cntr_0));
2098 0 : if (PyErr_Occurred() != NULL) {
2099 0 : return -1;
2100 : }
2101 0 : if (test_var > uint_max) {
2102 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2103 : PyLong_Type.tp_name, uint_max, test_var);
2104 0 : return -1;
2105 : }
2106 0 : (object->in.uids)[uids_cntr_0] = test_var;
2107 : } else {
2108 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2109 : PyLong_Type.tp_name);
2110 0 : return -1;
2111 : }
2112 : }
2113 : }
2114 : }
2115 0 : return 0;
2116 : }
2117 :
2118 0 : static PyObject *py_unixinfo_GetPWUid_out_get_infos(PyObject *obj, void *closure)
2119 : {
2120 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(obj);
2121 : PyObject *py_infos;
2122 0 : py_infos = PyList_New(*object->out.count);
2123 0 : if (py_infos == NULL) {
2124 0 : return NULL;
2125 : }
2126 : {
2127 : int infos_cntr_0;
2128 0 : for (infos_cntr_0 = 0; infos_cntr_0 < (*object->out.count); infos_cntr_0++) {
2129 : PyObject *py_infos_0;
2130 0 : py_infos_0 = pytalloc_reference_ex(&unixinfo_GetPWUidInfo_Type, object->out.infos, &(object->out.infos)[infos_cntr_0]);
2131 0 : PyList_SetItem(py_infos, infos_cntr_0, py_infos_0);
2132 : }
2133 : }
2134 0 : return py_infos;
2135 : }
2136 :
2137 0 : static int py_unixinfo_GetPWUid_out_set_infos(PyObject *py_obj, PyObject *value, void *closure)
2138 : {
2139 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2140 0 : if (value == NULL) {
2141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.infos");
2142 0 : return -1;
2143 : }
2144 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2145 : {
2146 : int infos_cntr_0;
2147 0 : object->out.infos = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.infos, PyList_GET_SIZE(value));
2148 0 : if (!object->out.infos) { return -1; }
2149 0 : talloc_set_name_const(object->out.infos, "ARRAY: object->out.infos");
2150 0 : for (infos_cntr_0 = 0; infos_cntr_0 < PyList_GET_SIZE(value); infos_cntr_0++) {
2151 0 : if (PyList_GET_ITEM(value, infos_cntr_0) == NULL) {
2152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.infos)[infos_cntr_0]");
2153 0 : return -1;
2154 : }
2155 0 : PY_CHECK_TYPE(&unixinfo_GetPWUidInfo_Type, PyList_GET_ITEM(value, infos_cntr_0), return -1;);
2156 0 : if (talloc_reference(object->out.infos, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, infos_cntr_0))) == NULL) {
2157 0 : PyErr_NoMemory();
2158 0 : return -1;
2159 : }
2160 0 : (object->out.infos)[infos_cntr_0] = *(struct unixinfo_GetPWUidInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, infos_cntr_0));
2161 : }
2162 : }
2163 0 : return 0;
2164 : }
2165 :
2166 0 : static PyObject *py_unixinfo_GetPWUid_get_result(PyObject *obj, void *closure)
2167 : {
2168 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(obj);
2169 : PyObject *py_result;
2170 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
2171 0 : return py_result;
2172 : }
2173 :
2174 0 : static int py_unixinfo_GetPWUid_set_result(PyObject *py_obj, PyObject *value, void *closure)
2175 : {
2176 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2177 0 : if (value == NULL) {
2178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
2179 0 : return -1;
2180 : }
2181 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
2182 0 : return 0;
2183 : }
2184 :
2185 : static PyGetSetDef py_unixinfo_GetPWUid_getsetters[] = {
2186 : {
2187 : .name = discard_const_p(char, "in_count"),
2188 : .get = py_unixinfo_GetPWUid_in_get_count,
2189 : .set = py_unixinfo_GetPWUid_in_set_count,
2190 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2191 : },
2192 : {
2193 : .name = discard_const_p(char, "out_count"),
2194 : .get = py_unixinfo_GetPWUid_out_get_count,
2195 : .set = py_unixinfo_GetPWUid_out_set_count,
2196 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2197 : },
2198 : {
2199 : .name = discard_const_p(char, "in_uids"),
2200 : .get = py_unixinfo_GetPWUid_in_get_uids,
2201 : .set = py_unixinfo_GetPWUid_in_set_uids,
2202 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2203 : },
2204 : {
2205 : .name = discard_const_p(char, "out_infos"),
2206 : .get = py_unixinfo_GetPWUid_out_get_infos,
2207 : .set = py_unixinfo_GetPWUid_out_set_infos,
2208 : .doc = discard_const_p(char, "PIDL-generated element of base type unixinfo_GetPWUidInfo")
2209 : },
2210 : {
2211 : .name = discard_const_p(char, "result"),
2212 : .get = py_unixinfo_GetPWUid_get_result,
2213 : .set = py_unixinfo_GetPWUid_set_result,
2214 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
2215 : },
2216 : { .name = NULL }
2217 : };
2218 :
2219 0 : static PyObject *py_unixinfo_GetPWUid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2220 : {
2221 0 : PyObject *self = pytalloc_new(struct unixinfo_GetPWUid, type);
2222 0 : struct unixinfo_GetPWUid *_self = (struct unixinfo_GetPWUid *)pytalloc_get_ptr(self);
2223 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
2224 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
2225 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
2226 0 : return self;
2227 : }
2228 :
2229 0 : static PyObject *py_unixinfo_GetPWUid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
2230 : {
2231 :
2232 :
2233 0 : return PyLong_FromLong(4);
2234 : }
2235 :
2236 0 : static PyObject *py_unixinfo_GetPWUid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
2237 : {
2238 0 : const struct ndr_interface_call *call = NULL;
2239 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2240 0 : PyObject *ret = NULL;
2241 0 : struct ndr_push *push = NULL;
2242 : DATA_BLOB blob;
2243 : enum ndr_err_code err;
2244 :
2245 0 : if (ndr_table_unixinfo.num_calls < 5) {
2246 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_GetPWUid_ndr_pack");
2247 0 : return NULL;
2248 : }
2249 0 : call = &ndr_table_unixinfo.calls[4];
2250 :
2251 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
2252 0 : if (push == NULL) {
2253 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2254 0 : return NULL;
2255 : }
2256 :
2257 0 : push->flags |= ndr_push_flags;
2258 :
2259 0 : err = call->ndr_push(push, ndr_inout_flags, object);
2260 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2261 0 : TALLOC_FREE(push);
2262 0 : PyErr_SetNdrError(err);
2263 0 : return NULL;
2264 : }
2265 0 : blob = ndr_push_blob(push);
2266 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2267 0 : TALLOC_FREE(push);
2268 0 : return ret;
2269 : }
2270 :
2271 0 : static PyObject *py_unixinfo_GetPWUid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2272 : {
2273 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2274 0 : PyObject *bigendian_obj = NULL;
2275 0 : PyObject *ndr64_obj = NULL;
2276 0 : libndr_flags ndr_push_flags = 0;
2277 :
2278 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
2279 : discard_const_p(char *, kwnames),
2280 : &bigendian_obj,
2281 : &ndr64_obj)) {
2282 0 : return NULL;
2283 : }
2284 :
2285 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2286 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2287 : }
2288 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2289 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2290 : }
2291 :
2292 0 : return py_unixinfo_GetPWUid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
2293 : }
2294 :
2295 0 : static PyObject *py_unixinfo_GetPWUid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2296 : {
2297 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2298 0 : PyObject *bigendian_obj = NULL;
2299 0 : PyObject *ndr64_obj = NULL;
2300 0 : libndr_flags ndr_push_flags = 0;
2301 :
2302 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
2303 : discard_const_p(char *, kwnames),
2304 : &bigendian_obj,
2305 : &ndr64_obj)) {
2306 0 : return NULL;
2307 : }
2308 :
2309 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2310 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2311 : }
2312 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2313 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2314 : }
2315 :
2316 0 : return py_unixinfo_GetPWUid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
2317 : }
2318 :
2319 0 : static PyObject *py_unixinfo_GetPWUid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
2320 : {
2321 0 : const struct ndr_interface_call *call = NULL;
2322 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2323 0 : struct ndr_pull *pull = NULL;
2324 : enum ndr_err_code err;
2325 :
2326 0 : if (ndr_table_unixinfo.num_calls < 5) {
2327 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_GetPWUid_ndr_unpack");
2328 0 : return NULL;
2329 : }
2330 0 : call = &ndr_table_unixinfo.calls[4];
2331 :
2332 0 : pull = ndr_pull_init_blob(blob, object);
2333 0 : if (pull == NULL) {
2334 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2335 0 : return NULL;
2336 : }
2337 :
2338 0 : pull->flags |= ndr_pull_flags;
2339 :
2340 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
2341 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2342 0 : TALLOC_FREE(pull);
2343 0 : PyErr_SetNdrError(err);
2344 0 : return NULL;
2345 : }
2346 0 : if (!allow_remaining) {
2347 : uint32_t highest_ofs;
2348 :
2349 0 : if (pull->offset > pull->relative_highest_offset) {
2350 0 : highest_ofs = pull->offset;
2351 : } else {
2352 0 : highest_ofs = pull->relative_highest_offset;
2353 : }
2354 0 : if (highest_ofs < pull->data_size) {
2355 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
2356 : "not all bytes consumed ofs[%u] size[%u]",
2357 : highest_ofs, pull->data_size);
2358 0 : TALLOC_FREE(pull);
2359 0 : PyErr_SetNdrError(err);
2360 0 : return NULL;
2361 : }
2362 : }
2363 :
2364 0 : TALLOC_FREE(pull);
2365 0 : Py_RETURN_NONE;
2366 : }
2367 :
2368 0 : static PyObject *py_unixinfo_GetPWUid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2369 : {
2370 : DATA_BLOB blob;
2371 0 : Py_ssize_t blob_length = 0;
2372 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
2373 0 : PyObject *bigendian_obj = NULL;
2374 0 : PyObject *ndr64_obj = NULL;
2375 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
2376 0 : PyObject *allow_remaining_obj = NULL;
2377 0 : bool allow_remaining = false;
2378 :
2379 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
2380 : discard_const_p(char *, kwnames),
2381 : &blob.data, &blob_length,
2382 : &bigendian_obj,
2383 : &ndr64_obj,
2384 : &allow_remaining_obj)) {
2385 0 : return NULL;
2386 : }
2387 0 : blob.length = blob_length;
2388 :
2389 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2390 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
2391 : }
2392 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2393 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
2394 : }
2395 :
2396 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2397 0 : allow_remaining = true;
2398 : }
2399 :
2400 0 : return py_unixinfo_GetPWUid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
2401 : }
2402 :
2403 0 : static PyObject *py_unixinfo_GetPWUid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2404 : {
2405 : DATA_BLOB blob;
2406 0 : Py_ssize_t blob_length = 0;
2407 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
2408 0 : PyObject *bigendian_obj = NULL;
2409 0 : PyObject *ndr64_obj = NULL;
2410 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
2411 0 : PyObject *allow_remaining_obj = NULL;
2412 0 : bool allow_remaining = false;
2413 :
2414 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
2415 : discard_const_p(char *, kwnames),
2416 : &blob.data, &blob_length,
2417 : &bigendian_obj,
2418 : &ndr64_obj,
2419 : &allow_remaining_obj)) {
2420 0 : return NULL;
2421 : }
2422 0 : blob.length = blob_length;
2423 :
2424 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2425 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
2426 : }
2427 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2428 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
2429 : }
2430 :
2431 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2432 0 : allow_remaining = true;
2433 : }
2434 :
2435 0 : return py_unixinfo_GetPWUid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
2436 : }
2437 :
2438 0 : static PyObject *py_unixinfo_GetPWUid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
2439 : {
2440 0 : const struct ndr_interface_call *call = NULL;
2441 0 : struct unixinfo_GetPWUid *object = pytalloc_get_ptr(py_obj);
2442 : PyObject *ret;
2443 : char *retstr;
2444 :
2445 0 : if (ndr_table_unixinfo.num_calls < 5) {
2446 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_unixinfo_GetPWUid_ndr_print");
2447 0 : return NULL;
2448 : }
2449 0 : call = &ndr_table_unixinfo.calls[4];
2450 :
2451 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
2452 0 : ret = PyUnicode_FromString(retstr);
2453 0 : TALLOC_FREE(retstr);
2454 :
2455 0 : return ret;
2456 : }
2457 :
2458 0 : static PyObject *py_unixinfo_GetPWUid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2459 : {
2460 0 : return py_unixinfo_GetPWUid_ndr_print(py_obj, "unixinfo_GetPWUid_in", NDR_IN);
2461 : }
2462 :
2463 0 : static PyObject *py_unixinfo_GetPWUid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2464 : {
2465 0 : return py_unixinfo_GetPWUid_ndr_print(py_obj, "unixinfo_GetPWUid_out", NDR_OUT);
2466 : }
2467 :
2468 : static PyMethodDef py_unixinfo_GetPWUid_methods[] = {
2469 : { "opnum", (PyCFunction)py_unixinfo_GetPWUid_ndr_opnum, METH_NOARGS|METH_CLASS,
2470 : "unixinfo.GetPWUid.opnum() -> 4 (0x04) " },
2471 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GetPWUid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
2472 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
2473 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GetPWUid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
2474 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
2475 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GetPWUid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
2476 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
2477 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_unixinfo_GetPWUid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
2478 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
2479 : { "__ndr_print_in__", (PyCFunction)py_unixinfo_GetPWUid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
2480 : { "__ndr_print_out__", (PyCFunction)py_unixinfo_GetPWUid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
2481 : { NULL, NULL, 0, NULL }
2482 : };
2483 :
2484 :
2485 : static PyTypeObject unixinfo_GetPWUid_Type = {
2486 : PyVarObject_HEAD_INIT(NULL, 0)
2487 : .tp_name = "unixinfo.GetPWUid",
2488 : .tp_getset = py_unixinfo_GetPWUid_getsetters,
2489 : .tp_methods = py_unixinfo_GetPWUid_methods,
2490 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2491 : .tp_new = py_unixinfo_GetPWUid_new,
2492 : };
2493 :
2494 0 : static bool pack_py_unixinfo_GetPWUid_args_in(PyObject *args, PyObject *kwargs, struct unixinfo_GetPWUid *r)
2495 : {
2496 : PyObject *py_uids;
2497 0 : const char *kwnames[] = {
2498 : "uids", NULL
2499 : };
2500 :
2501 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:unixinfo_GetPWUid", discard_const_p(char *, kwnames), &py_uids)) {
2502 0 : return false;
2503 : }
2504 :
2505 0 : PY_CHECK_TYPE(&PyList_Type, py_uids, return false;);
2506 0 : r->in.count = talloc_ptrtype(r, r->in.count);
2507 0 : if (r->in.count == NULL) {
2508 0 : PyErr_NoMemory();
2509 0 : return false;
2510 : }
2511 0 : *r->in.count = PyList_GET_SIZE(py_uids);
2512 0 : if (py_uids == NULL) {
2513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.uids");
2514 0 : return false;
2515 : }
2516 0 : PY_CHECK_TYPE(&PyList_Type, py_uids, return false;);
2517 : {
2518 : int uids_cntr_0;
2519 0 : r->in.uids = talloc_array_ptrtype(r, r->in.uids, PyList_GET_SIZE(py_uids));
2520 0 : if (!r->in.uids) { return false; }
2521 0 : talloc_set_name_const(r->in.uids, "ARRAY: r->in.uids");
2522 0 : for (uids_cntr_0 = 0; uids_cntr_0 < PyList_GET_SIZE(py_uids); uids_cntr_0++) {
2523 0 : if (PyList_GET_ITEM(py_uids, uids_cntr_0) == NULL) {
2524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.uids)[uids_cntr_0]");
2525 0 : return false;
2526 : }
2527 : {
2528 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.uids)[uids_cntr_0]));
2529 0 : if (PyLong_Check(PyList_GET_ITEM(py_uids, uids_cntr_0))) {
2530 : unsigned long long test_var;
2531 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_uids, uids_cntr_0));
2532 0 : if (PyErr_Occurred() != NULL) {
2533 0 : return false;
2534 : }
2535 0 : if (test_var > uint_max) {
2536 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2537 : PyLong_Type.tp_name, uint_max, test_var);
2538 0 : return false;
2539 : }
2540 0 : (r->in.uids)[uids_cntr_0] = test_var;
2541 : } else {
2542 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2543 : PyLong_Type.tp_name);
2544 0 : return false;
2545 : }
2546 : }
2547 : }
2548 : }
2549 0 : return true;
2550 : }
2551 :
2552 0 : static PyObject *unpack_py_unixinfo_GetPWUid_args_out(struct unixinfo_GetPWUid *r)
2553 : {
2554 : PyObject *result;
2555 : PyObject *py_infos;
2556 0 : py_infos = PyList_New(*r->out.count);
2557 0 : if (py_infos == NULL) {
2558 0 : return NULL;
2559 : }
2560 : {
2561 : int infos_cntr_0;
2562 0 : for (infos_cntr_0 = 0; infos_cntr_0 < (*r->out.count); infos_cntr_0++) {
2563 : PyObject *py_infos_0;
2564 0 : py_infos_0 = pytalloc_reference_ex(&unixinfo_GetPWUidInfo_Type, r->out.infos, &(r->out.infos)[infos_cntr_0]);
2565 0 : PyList_SetItem(py_infos, infos_cntr_0, py_infos_0);
2566 : }
2567 : }
2568 0 : result = py_infos;
2569 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
2570 0 : PyErr_SetNTSTATUS(r->out.result);
2571 0 : return NULL;
2572 : }
2573 :
2574 0 : return result;
2575 : }
2576 :
2577 : const struct PyNdrRpcMethodDef py_ndr_unixinfo_methods[] = {
2578 : { "SidToUid", "S.SidToUid(sid) -> uid", (py_dcerpc_call_fn)dcerpc_unixinfo_SidToUid_r, (py_data_pack_fn)pack_py_unixinfo_SidToUid_args_in, (py_data_unpack_fn)unpack_py_unixinfo_SidToUid_args_out, 0, &ndr_table_unixinfo },
2579 : { "UidToSid", "S.UidToSid(uid) -> sid", (py_dcerpc_call_fn)dcerpc_unixinfo_UidToSid_r, (py_data_pack_fn)pack_py_unixinfo_UidToSid_args_in, (py_data_unpack_fn)unpack_py_unixinfo_UidToSid_args_out, 1, &ndr_table_unixinfo },
2580 : { "SidToGid", "S.SidToGid(sid) -> gid", (py_dcerpc_call_fn)dcerpc_unixinfo_SidToGid_r, (py_data_pack_fn)pack_py_unixinfo_SidToGid_args_in, (py_data_unpack_fn)unpack_py_unixinfo_SidToGid_args_out, 2, &ndr_table_unixinfo },
2581 : { "GidToSid", "S.GidToSid(gid) -> sid", (py_dcerpc_call_fn)dcerpc_unixinfo_GidToSid_r, (py_data_pack_fn)pack_py_unixinfo_GidToSid_args_in, (py_data_unpack_fn)unpack_py_unixinfo_GidToSid_args_out, 3, &ndr_table_unixinfo },
2582 : { "GetPWUid", "S.GetPWUid(uids) -> infos", (py_dcerpc_call_fn)dcerpc_unixinfo_GetPWUid_r, (py_data_pack_fn)pack_py_unixinfo_GetPWUid_args_in, (py_data_unpack_fn)unpack_py_unixinfo_GetPWUid_args_out, 4, &ndr_table_unixinfo },
2583 : {0}
2584 : };
2585 :
2586 0 : static PyObject *interface_unixinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2587 : {
2588 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_unixinfo);
2589 : }
2590 :
2591 : #define PY_DOC_UNIXINFO "Unixinfo specific stuff"
2592 : static PyTypeObject unixinfo_InterfaceType = {
2593 : PyVarObject_HEAD_INIT(NULL, 0)
2594 : .tp_name = "unixinfo.unixinfo",
2595 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
2596 : .tp_doc = "unixinfo(binding, lp_ctx=None, credentials=None) -> connection\n"
2597 : "\n"
2598 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
2599 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
2600 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_UNIXINFO,
2601 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2602 : .tp_new = interface_unixinfo_new,
2603 : };
2604 :
2605 0 : static PyObject *syntax_unixinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2606 : {
2607 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_unixinfo.syntax_id);
2608 : }
2609 :
2610 : #define PY_DOC_UNIXINFO_SYNTAX "Unixinfo specific stuff"
2611 : static PyTypeObject unixinfo_SyntaxType = {
2612 : PyVarObject_HEAD_INIT(NULL, 0)
2613 : .tp_name = "unixinfo.unixinfo_abstract_syntax",
2614 : .tp_doc = "unixinfo_abstract_syntax()\n"PY_DOC_UNIXINFO_SYNTAX,
2615 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2616 : .tp_new = syntax_unixinfo_new,
2617 : };
2618 :
2619 : static PyMethodDef unixinfo_methods[] = {
2620 : { NULL, NULL, 0, NULL }
2621 : };
2622 :
2623 : static struct PyModuleDef moduledef = {
2624 : PyModuleDef_HEAD_INIT,
2625 : .m_name = "unixinfo",
2626 : .m_doc = "unixinfo DCE/RPC",
2627 : .m_size = -1,
2628 : .m_methods = unixinfo_methods,
2629 : };
2630 2 : MODULE_INIT_FUNC(unixinfo)
2631 : {
2632 2 : PyObject *m = NULL;
2633 2 : PyObject *dep_samba_dcerpc_security = NULL;
2634 2 : PyObject *dep_talloc = NULL;
2635 2 : PyObject *dep_samba_dcerpc_base = NULL;
2636 2 : PyObject *dep_samba_dcerpc_misc = NULL;
2637 :
2638 2 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
2639 2 : if (dep_samba_dcerpc_security == NULL)
2640 0 : goto out;
2641 :
2642 2 : dep_talloc = PyImport_ImportModule("talloc");
2643 2 : if (dep_talloc == NULL)
2644 0 : goto out;
2645 :
2646 2 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
2647 2 : if (dep_samba_dcerpc_base == NULL)
2648 0 : goto out;
2649 :
2650 2 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
2651 2 : if (dep_samba_dcerpc_misc == NULL)
2652 0 : goto out;
2653 :
2654 2 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
2655 2 : if (BaseObject_Type == NULL)
2656 0 : goto out;
2657 :
2658 2 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
2659 2 : if (dom_sid_Type == NULL)
2660 0 : goto out;
2661 :
2662 2 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
2663 2 : if (ClientConnection_Type == NULL)
2664 0 : goto out;
2665 :
2666 2 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
2667 2 : if (ndr_syntax_id_Type == NULL)
2668 0 : goto out;
2669 :
2670 2 : unixinfo_GetPWUidInfo_Type.tp_base = BaseObject_Type;
2671 2 : unixinfo_GetPWUidInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
2672 :
2673 2 : unixinfo_SidToUid_Type.tp_base = BaseObject_Type;
2674 2 : unixinfo_SidToUid_Type.tp_basicsize = pytalloc_BaseObject_size();
2675 :
2676 2 : unixinfo_UidToSid_Type.tp_base = BaseObject_Type;
2677 2 : unixinfo_UidToSid_Type.tp_basicsize = pytalloc_BaseObject_size();
2678 :
2679 2 : unixinfo_SidToGid_Type.tp_base = BaseObject_Type;
2680 2 : unixinfo_SidToGid_Type.tp_basicsize = pytalloc_BaseObject_size();
2681 :
2682 2 : unixinfo_GidToSid_Type.tp_base = BaseObject_Type;
2683 2 : unixinfo_GidToSid_Type.tp_basicsize = pytalloc_BaseObject_size();
2684 :
2685 2 : unixinfo_GetPWUid_Type.tp_base = BaseObject_Type;
2686 2 : unixinfo_GetPWUid_Type.tp_basicsize = pytalloc_BaseObject_size();
2687 :
2688 2 : unixinfo_InterfaceType.tp_base = ClientConnection_Type;
2689 :
2690 2 : unixinfo_SyntaxType.tp_base = ndr_syntax_id_Type;
2691 2 : unixinfo_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
2692 :
2693 2 : if (PyType_Ready(&unixinfo_GetPWUidInfo_Type) < 0)
2694 0 : goto out;
2695 2 : if (PyType_Ready(&unixinfo_SidToUid_Type) < 0)
2696 0 : goto out;
2697 2 : if (PyType_Ready(&unixinfo_UidToSid_Type) < 0)
2698 0 : goto out;
2699 2 : if (PyType_Ready(&unixinfo_SidToGid_Type) < 0)
2700 0 : goto out;
2701 2 : if (PyType_Ready(&unixinfo_GidToSid_Type) < 0)
2702 0 : goto out;
2703 2 : if (PyType_Ready(&unixinfo_GetPWUid_Type) < 0)
2704 0 : goto out;
2705 2 : if (PyType_Ready(&unixinfo_InterfaceType) < 0)
2706 0 : goto out;
2707 2 : if (PyType_Ready(&unixinfo_SyntaxType) < 0)
2708 0 : goto out;
2709 2 : if (!PyInterface_AddNdrRpcMethods(&unixinfo_InterfaceType, py_ndr_unixinfo_methods))
2710 0 : return NULL;
2711 :
2712 : #ifdef PY_GETPWUIDINFO_PATCH
2713 : PY_GETPWUIDINFO_PATCH(&unixinfo_GetPWUidInfo_Type);
2714 : #endif
2715 : #ifdef PY_SIDTOUID_PATCH
2716 : PY_SIDTOUID_PATCH(&unixinfo_SidToUid_Type);
2717 : #endif
2718 : #ifdef PY_UIDTOSID_PATCH
2719 : PY_UIDTOSID_PATCH(&unixinfo_UidToSid_Type);
2720 : #endif
2721 : #ifdef PY_SIDTOGID_PATCH
2722 : PY_SIDTOGID_PATCH(&unixinfo_SidToGid_Type);
2723 : #endif
2724 : #ifdef PY_GIDTOSID_PATCH
2725 : PY_GIDTOSID_PATCH(&unixinfo_GidToSid_Type);
2726 : #endif
2727 : #ifdef PY_GETPWUID_PATCH
2728 : PY_GETPWUID_PATCH(&unixinfo_GetPWUid_Type);
2729 : #endif
2730 : #ifdef PY_UNIXINFO_PATCH
2731 : PY_UNIXINFO_PATCH(&unixinfo_InterfaceType);
2732 : #endif
2733 : #ifdef PY_UNIXINFO_ABSTRACT_SYNTAX_PATCH
2734 : PY_UNIXINFO_ABSTRACT_SYNTAX_PATCH(&unixinfo_SyntaxType);
2735 : #endif
2736 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
2737 : PY_ABSTRACT_SYNTAX_PATCH(&unixinfo_SyntaxType);
2738 : #endif
2739 :
2740 2 : m = PyModule_Create(&moduledef);
2741 2 : if (m == NULL)
2742 0 : goto out;
2743 :
2744 1 : Py_INCREF((PyObject *)(void *)&unixinfo_GetPWUidInfo_Type);
2745 2 : PyModule_AddObject(m, "GetPWUidInfo", (PyObject *)(void *)&unixinfo_GetPWUidInfo_Type);
2746 1 : Py_INCREF((PyObject *)(void *)&unixinfo_SidToUid_Type);
2747 2 : PyModule_AddObject(m, "SidToUid", (PyObject *)(void *)&unixinfo_SidToUid_Type);
2748 1 : Py_INCREF((PyObject *)(void *)&unixinfo_UidToSid_Type);
2749 2 : PyModule_AddObject(m, "UidToSid", (PyObject *)(void *)&unixinfo_UidToSid_Type);
2750 1 : Py_INCREF((PyObject *)(void *)&unixinfo_SidToGid_Type);
2751 2 : PyModule_AddObject(m, "SidToGid", (PyObject *)(void *)&unixinfo_SidToGid_Type);
2752 1 : Py_INCREF((PyObject *)(void *)&unixinfo_GidToSid_Type);
2753 2 : PyModule_AddObject(m, "GidToSid", (PyObject *)(void *)&unixinfo_GidToSid_Type);
2754 1 : Py_INCREF((PyObject *)(void *)&unixinfo_GetPWUid_Type);
2755 2 : PyModule_AddObject(m, "GetPWUid", (PyObject *)(void *)&unixinfo_GetPWUid_Type);
2756 1 : Py_INCREF((PyObject *)(void *)&unixinfo_InterfaceType);
2757 2 : PyModule_AddObject(m, "unixinfo", (PyObject *)(void *)&unixinfo_InterfaceType);
2758 1 : Py_INCREF((PyObject *)(void *)&unixinfo_SyntaxType);
2759 2 : PyModule_AddObject(m, "unixinfo_abstract_syntax", (PyObject *)(void *)&unixinfo_SyntaxType);
2760 1 : Py_INCREF((PyObject *)(void *)&unixinfo_SyntaxType);
2761 2 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&unixinfo_SyntaxType);
2762 : #ifdef PY_MOD_UNIXINFO_PATCH
2763 : PY_MOD_UNIXINFO_PATCH(m);
2764 : #endif
2765 2 : out:
2766 2 : Py_XDECREF(dep_samba_dcerpc_security);
2767 2 : Py_XDECREF(dep_talloc);
2768 2 : Py_XDECREF(dep_samba_dcerpc_base);
2769 2 : Py_XDECREF(dep_samba_dcerpc_misc);
2770 2 : return m;
2771 :
2772 : }
|