Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include <Python.h>
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_xattr.h"
12 :
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 570 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 570 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 0 : case 4:
38 0 : return UINT32_MAX;
39 570 : case 2:
40 570 : 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 xattr_DosInfoFFFFCompat_Type;
66 : static PyTypeObject xattr_DosInfo1_Type;
67 : static PyTypeObject xattr_DosInfo2Old_Type;
68 : static PyTypeObject xattr_DosInfo3_Type;
69 : static PyTypeObject xattr_DosInfo4_Type;
70 : static PyTypeObject xattr_DosInfo5_Type;
71 : static PyTypeObject xattr_DosInfo_Type;
72 : static PyTypeObject xattr_DosAttrib_Type;
73 : static PyTypeObject xattr_DOSATTRIB_Type;
74 : static PyTypeObject xattr_EA_Type;
75 : static PyTypeObject xattr_DosEAs_Type;
76 : static PyTypeObject tdb_xattrs_Type;
77 : static PyTypeObject xattr_DosStream_Type;
78 : static PyTypeObject xattr_DosStreams_Type;
79 : static PyTypeObject security_descriptor_hash_v2_Type;
80 : static PyTypeObject security_descriptor_hash_v3_Type;
81 : static PyTypeObject security_descriptor_hash_v4_Type;
82 : static PyTypeObject xattr_NTACL_Info_Type;
83 : static PyTypeObject xattr_NTACL_Type;
84 : static PyTypeObject xattr_sys_acl_hash_wrapper_Type;
85 :
86 : static PyTypeObject *BaseObject_Type;
87 : static PyTypeObject *security_descriptor_Type;
88 : #include "librpc/ndr/py_xattr.c"
89 :
90 :
91 0 : static PyObject *py_xattr_DosInfoFFFFCompat_get_attrib(PyObject *obj, void *closure)
92 : {
93 0 : struct xattr_DosInfoFFFFCompat *object = (struct xattr_DosInfoFFFFCompat *)pytalloc_get_ptr(obj);
94 : PyObject *py_attrib;
95 0 : py_attrib = PyLong_FromUnsignedLongLong((uint32_t)object->attrib);
96 0 : return py_attrib;
97 : }
98 :
99 0 : static int py_xattr_DosInfoFFFFCompat_set_attrib(PyObject *py_obj, PyObject *value, void *closure)
100 : {
101 0 : struct xattr_DosInfoFFFFCompat *object = (struct xattr_DosInfoFFFFCompat *)pytalloc_get_ptr(py_obj);
102 0 : if (value == NULL) {
103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib");
104 0 : return -1;
105 : }
106 : {
107 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrib));
108 0 : if (PyLong_Check(value)) {
109 : unsigned long long test_var;
110 0 : test_var = PyLong_AsUnsignedLongLong(value);
111 0 : if (PyErr_Occurred() != NULL) {
112 0 : return -1;
113 : }
114 0 : if (test_var > uint_max) {
115 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
116 : PyLong_Type.tp_name, uint_max, test_var);
117 0 : return -1;
118 : }
119 0 : object->attrib = test_var;
120 : } else {
121 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
122 : PyLong_Type.tp_name);
123 0 : return -1;
124 : }
125 : }
126 0 : return 0;
127 : }
128 :
129 : static PyGetSetDef py_xattr_DosInfoFFFFCompat_getsetters[] = {
130 : {
131 : .name = discard_const_p(char, "attrib"),
132 : .get = py_xattr_DosInfoFFFFCompat_get_attrib,
133 : .set = py_xattr_DosInfoFFFFCompat_set_attrib,
134 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
135 : },
136 : { .name = NULL }
137 : };
138 :
139 0 : static PyObject *py_xattr_DosInfoFFFFCompat_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
140 : {
141 0 : return pytalloc_new(struct xattr_DosInfoFFFFCompat, type);
142 : }
143 :
144 :
145 : static PyTypeObject xattr_DosInfoFFFFCompat_Type = {
146 : PyVarObject_HEAD_INIT(NULL, 0)
147 : .tp_name = "xattr.DosInfoFFFFCompat",
148 : .tp_getset = py_xattr_DosInfoFFFFCompat_getsetters,
149 : .tp_methods = NULL,
150 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
151 : .tp_new = py_xattr_DosInfoFFFFCompat_new,
152 : };
153 :
154 :
155 0 : static PyObject *py_xattr_DosInfo1_get_attrib(PyObject *obj, void *closure)
156 : {
157 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(obj);
158 : PyObject *py_attrib;
159 0 : py_attrib = PyLong_FromUnsignedLongLong((uint32_t)object->attrib);
160 0 : return py_attrib;
161 : }
162 :
163 0 : static int py_xattr_DosInfo1_set_attrib(PyObject *py_obj, PyObject *value, void *closure)
164 : {
165 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(py_obj);
166 0 : if (value == NULL) {
167 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib");
168 0 : return -1;
169 : }
170 : {
171 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrib));
172 0 : if (PyLong_Check(value)) {
173 : unsigned long long test_var;
174 0 : test_var = PyLong_AsUnsignedLongLong(value);
175 0 : if (PyErr_Occurred() != NULL) {
176 0 : return -1;
177 : }
178 0 : if (test_var > uint_max) {
179 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
180 : PyLong_Type.tp_name, uint_max, test_var);
181 0 : return -1;
182 : }
183 0 : object->attrib = test_var;
184 : } else {
185 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
186 : PyLong_Type.tp_name);
187 0 : return -1;
188 : }
189 : }
190 0 : return 0;
191 : }
192 :
193 0 : static PyObject *py_xattr_DosInfo1_get_ea_size(PyObject *obj, void *closure)
194 : {
195 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(obj);
196 : PyObject *py_ea_size;
197 0 : py_ea_size = PyLong_FromUnsignedLongLong((uint32_t)object->ea_size);
198 0 : return py_ea_size;
199 : }
200 :
201 0 : static int py_xattr_DosInfo1_set_ea_size(PyObject *py_obj, PyObject *value, void *closure)
202 : {
203 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(py_obj);
204 0 : if (value == NULL) {
205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ea_size");
206 0 : return -1;
207 : }
208 : {
209 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ea_size));
210 0 : if (PyLong_Check(value)) {
211 : unsigned long long test_var;
212 0 : test_var = PyLong_AsUnsignedLongLong(value);
213 0 : if (PyErr_Occurred() != NULL) {
214 0 : return -1;
215 : }
216 0 : if (test_var > uint_max) {
217 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
218 : PyLong_Type.tp_name, uint_max, test_var);
219 0 : return -1;
220 : }
221 0 : object->ea_size = test_var;
222 : } else {
223 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
224 : PyLong_Type.tp_name);
225 0 : return -1;
226 : }
227 : }
228 0 : return 0;
229 : }
230 :
231 0 : static PyObject *py_xattr_DosInfo1_get_size(PyObject *obj, void *closure)
232 : {
233 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(obj);
234 : PyObject *py_size;
235 0 : py_size = PyLong_FromUnsignedLongLong(object->size);
236 0 : return py_size;
237 : }
238 :
239 0 : static int py_xattr_DosInfo1_set_size(PyObject *py_obj, PyObject *value, void *closure)
240 : {
241 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(py_obj);
242 0 : if (value == NULL) {
243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
244 0 : return -1;
245 : }
246 : {
247 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
248 0 : if (PyLong_Check(value)) {
249 : unsigned long long test_var;
250 0 : test_var = PyLong_AsUnsignedLongLong(value);
251 0 : if (PyErr_Occurred() != NULL) {
252 0 : return -1;
253 : }
254 0 : if (test_var > uint_max) {
255 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
256 : PyLong_Type.tp_name, uint_max, test_var);
257 0 : return -1;
258 : }
259 0 : object->size = test_var;
260 : } else {
261 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
262 : PyLong_Type.tp_name);
263 0 : return -1;
264 : }
265 : }
266 0 : return 0;
267 : }
268 :
269 0 : static PyObject *py_xattr_DosInfo1_get_alloc_size(PyObject *obj, void *closure)
270 : {
271 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(obj);
272 : PyObject *py_alloc_size;
273 0 : py_alloc_size = PyLong_FromUnsignedLongLong(object->alloc_size);
274 0 : return py_alloc_size;
275 : }
276 :
277 0 : static int py_xattr_DosInfo1_set_alloc_size(PyObject *py_obj, PyObject *value, void *closure)
278 : {
279 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(py_obj);
280 0 : if (value == NULL) {
281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->alloc_size");
282 0 : return -1;
283 : }
284 : {
285 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_size));
286 0 : if (PyLong_Check(value)) {
287 : unsigned long long test_var;
288 0 : test_var = PyLong_AsUnsignedLongLong(value);
289 0 : if (PyErr_Occurred() != NULL) {
290 0 : return -1;
291 : }
292 0 : if (test_var > uint_max) {
293 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
294 : PyLong_Type.tp_name, uint_max, test_var);
295 0 : return -1;
296 : }
297 0 : object->alloc_size = test_var;
298 : } else {
299 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
300 : PyLong_Type.tp_name);
301 0 : return -1;
302 : }
303 : }
304 0 : return 0;
305 : }
306 :
307 0 : static PyObject *py_xattr_DosInfo1_get_create_time(PyObject *obj, void *closure)
308 : {
309 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(obj);
310 : PyObject *py_create_time;
311 0 : py_create_time = PyLong_FromUnsignedLongLong(object->create_time);
312 0 : return py_create_time;
313 : }
314 :
315 0 : static int py_xattr_DosInfo1_set_create_time(PyObject *py_obj, PyObject *value, void *closure)
316 : {
317 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(py_obj);
318 0 : if (value == NULL) {
319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->create_time");
320 0 : return -1;
321 : }
322 : {
323 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->create_time));
324 0 : if (PyLong_Check(value)) {
325 : unsigned long long test_var;
326 0 : test_var = PyLong_AsUnsignedLongLong(value);
327 0 : if (PyErr_Occurred() != NULL) {
328 0 : return -1;
329 : }
330 0 : if (test_var > uint_max) {
331 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
332 : PyLong_Type.tp_name, uint_max, test_var);
333 0 : return -1;
334 : }
335 0 : object->create_time = test_var;
336 : } else {
337 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
338 : PyLong_Type.tp_name);
339 0 : return -1;
340 : }
341 : }
342 0 : return 0;
343 : }
344 :
345 0 : static PyObject *py_xattr_DosInfo1_get_change_time(PyObject *obj, void *closure)
346 : {
347 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(obj);
348 : PyObject *py_change_time;
349 0 : py_change_time = PyLong_FromUnsignedLongLong(object->change_time);
350 0 : return py_change_time;
351 : }
352 :
353 0 : static int py_xattr_DosInfo1_set_change_time(PyObject *py_obj, PyObject *value, void *closure)
354 : {
355 0 : struct xattr_DosInfo1 *object = (struct xattr_DosInfo1 *)pytalloc_get_ptr(py_obj);
356 0 : if (value == NULL) {
357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->change_time");
358 0 : return -1;
359 : }
360 : {
361 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->change_time));
362 0 : if (PyLong_Check(value)) {
363 : unsigned long long test_var;
364 0 : test_var = PyLong_AsUnsignedLongLong(value);
365 0 : if (PyErr_Occurred() != NULL) {
366 0 : return -1;
367 : }
368 0 : if (test_var > uint_max) {
369 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
370 : PyLong_Type.tp_name, uint_max, test_var);
371 0 : return -1;
372 : }
373 0 : object->change_time = test_var;
374 : } else {
375 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
376 : PyLong_Type.tp_name);
377 0 : return -1;
378 : }
379 : }
380 0 : return 0;
381 : }
382 :
383 : static PyGetSetDef py_xattr_DosInfo1_getsetters[] = {
384 : {
385 : .name = discard_const_p(char, "attrib"),
386 : .get = py_xattr_DosInfo1_get_attrib,
387 : .set = py_xattr_DosInfo1_set_attrib,
388 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
389 : },
390 : {
391 : .name = discard_const_p(char, "ea_size"),
392 : .get = py_xattr_DosInfo1_get_ea_size,
393 : .set = py_xattr_DosInfo1_set_ea_size,
394 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
395 : },
396 : {
397 : .name = discard_const_p(char, "size"),
398 : .get = py_xattr_DosInfo1_get_size,
399 : .set = py_xattr_DosInfo1_set_size,
400 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
401 : },
402 : {
403 : .name = discard_const_p(char, "alloc_size"),
404 : .get = py_xattr_DosInfo1_get_alloc_size,
405 : .set = py_xattr_DosInfo1_set_alloc_size,
406 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
407 : },
408 : {
409 : .name = discard_const_p(char, "create_time"),
410 : .get = py_xattr_DosInfo1_get_create_time,
411 : .set = py_xattr_DosInfo1_set_create_time,
412 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
413 : },
414 : {
415 : .name = discard_const_p(char, "change_time"),
416 : .get = py_xattr_DosInfo1_get_change_time,
417 : .set = py_xattr_DosInfo1_set_change_time,
418 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
419 : },
420 : { .name = NULL }
421 : };
422 :
423 0 : static PyObject *py_xattr_DosInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
424 : {
425 0 : return pytalloc_new(struct xattr_DosInfo1, type);
426 : }
427 :
428 :
429 : static PyTypeObject xattr_DosInfo1_Type = {
430 : PyVarObject_HEAD_INIT(NULL, 0)
431 : .tp_name = "xattr.DosInfo1",
432 : .tp_getset = py_xattr_DosInfo1_getsetters,
433 : .tp_methods = NULL,
434 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
435 : .tp_new = py_xattr_DosInfo1_new,
436 : };
437 :
438 :
439 0 : static PyObject *py_xattr_DosInfo2Old_get_flags(PyObject *obj, void *closure)
440 : {
441 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
442 : PyObject *py_flags;
443 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
444 0 : return py_flags;
445 : }
446 :
447 0 : static int py_xattr_DosInfo2Old_set_flags(PyObject *py_obj, PyObject *value, void *closure)
448 : {
449 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
450 0 : if (value == NULL) {
451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
452 0 : return -1;
453 : }
454 : {
455 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
456 0 : if (PyLong_Check(value)) {
457 : unsigned long long test_var;
458 0 : test_var = PyLong_AsUnsignedLongLong(value);
459 0 : if (PyErr_Occurred() != NULL) {
460 0 : return -1;
461 : }
462 0 : if (test_var > uint_max) {
463 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
464 : PyLong_Type.tp_name, uint_max, test_var);
465 0 : return -1;
466 : }
467 0 : object->flags = test_var;
468 : } else {
469 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
470 : PyLong_Type.tp_name);
471 0 : return -1;
472 : }
473 : }
474 0 : return 0;
475 : }
476 :
477 0 : static PyObject *py_xattr_DosInfo2Old_get_attrib(PyObject *obj, void *closure)
478 : {
479 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
480 : PyObject *py_attrib;
481 0 : py_attrib = PyLong_FromUnsignedLongLong((uint32_t)object->attrib);
482 0 : return py_attrib;
483 : }
484 :
485 0 : static int py_xattr_DosInfo2Old_set_attrib(PyObject *py_obj, PyObject *value, void *closure)
486 : {
487 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
488 0 : if (value == NULL) {
489 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib");
490 0 : return -1;
491 : }
492 : {
493 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrib));
494 0 : if (PyLong_Check(value)) {
495 : unsigned long long test_var;
496 0 : test_var = PyLong_AsUnsignedLongLong(value);
497 0 : if (PyErr_Occurred() != NULL) {
498 0 : return -1;
499 : }
500 0 : if (test_var > uint_max) {
501 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
502 : PyLong_Type.tp_name, uint_max, test_var);
503 0 : return -1;
504 : }
505 0 : object->attrib = test_var;
506 : } else {
507 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
508 : PyLong_Type.tp_name);
509 0 : return -1;
510 : }
511 : }
512 0 : return 0;
513 : }
514 :
515 0 : static PyObject *py_xattr_DosInfo2Old_get_ea_size(PyObject *obj, void *closure)
516 : {
517 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
518 : PyObject *py_ea_size;
519 0 : py_ea_size = PyLong_FromUnsignedLongLong((uint32_t)object->ea_size);
520 0 : return py_ea_size;
521 : }
522 :
523 0 : static int py_xattr_DosInfo2Old_set_ea_size(PyObject *py_obj, PyObject *value, void *closure)
524 : {
525 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
526 0 : if (value == NULL) {
527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ea_size");
528 0 : return -1;
529 : }
530 : {
531 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ea_size));
532 0 : if (PyLong_Check(value)) {
533 : unsigned long long test_var;
534 0 : test_var = PyLong_AsUnsignedLongLong(value);
535 0 : if (PyErr_Occurred() != NULL) {
536 0 : return -1;
537 : }
538 0 : if (test_var > uint_max) {
539 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
540 : PyLong_Type.tp_name, uint_max, test_var);
541 0 : return -1;
542 : }
543 0 : object->ea_size = test_var;
544 : } else {
545 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
546 : PyLong_Type.tp_name);
547 0 : return -1;
548 : }
549 : }
550 0 : return 0;
551 : }
552 :
553 0 : static PyObject *py_xattr_DosInfo2Old_get_size(PyObject *obj, void *closure)
554 : {
555 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
556 : PyObject *py_size;
557 0 : py_size = PyLong_FromUnsignedLongLong(object->size);
558 0 : return py_size;
559 : }
560 :
561 0 : static int py_xattr_DosInfo2Old_set_size(PyObject *py_obj, PyObject *value, void *closure)
562 : {
563 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
564 0 : if (value == NULL) {
565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
566 0 : return -1;
567 : }
568 : {
569 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
570 0 : if (PyLong_Check(value)) {
571 : unsigned long long test_var;
572 0 : test_var = PyLong_AsUnsignedLongLong(value);
573 0 : if (PyErr_Occurred() != NULL) {
574 0 : return -1;
575 : }
576 0 : if (test_var > uint_max) {
577 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
578 : PyLong_Type.tp_name, uint_max, test_var);
579 0 : return -1;
580 : }
581 0 : object->size = test_var;
582 : } else {
583 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
584 : PyLong_Type.tp_name);
585 0 : return -1;
586 : }
587 : }
588 0 : return 0;
589 : }
590 :
591 0 : static PyObject *py_xattr_DosInfo2Old_get_alloc_size(PyObject *obj, void *closure)
592 : {
593 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
594 : PyObject *py_alloc_size;
595 0 : py_alloc_size = PyLong_FromUnsignedLongLong(object->alloc_size);
596 0 : return py_alloc_size;
597 : }
598 :
599 0 : static int py_xattr_DosInfo2Old_set_alloc_size(PyObject *py_obj, PyObject *value, void *closure)
600 : {
601 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
602 0 : if (value == NULL) {
603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->alloc_size");
604 0 : return -1;
605 : }
606 : {
607 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_size));
608 0 : if (PyLong_Check(value)) {
609 : unsigned long long test_var;
610 0 : test_var = PyLong_AsUnsignedLongLong(value);
611 0 : if (PyErr_Occurred() != NULL) {
612 0 : return -1;
613 : }
614 0 : if (test_var > uint_max) {
615 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
616 : PyLong_Type.tp_name, uint_max, test_var);
617 0 : return -1;
618 : }
619 0 : object->alloc_size = test_var;
620 : } else {
621 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
622 : PyLong_Type.tp_name);
623 0 : return -1;
624 : }
625 : }
626 0 : return 0;
627 : }
628 :
629 0 : static PyObject *py_xattr_DosInfo2Old_get_create_time(PyObject *obj, void *closure)
630 : {
631 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
632 : PyObject *py_create_time;
633 0 : py_create_time = PyLong_FromUnsignedLongLong(object->create_time);
634 0 : return py_create_time;
635 : }
636 :
637 0 : static int py_xattr_DosInfo2Old_set_create_time(PyObject *py_obj, PyObject *value, void *closure)
638 : {
639 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
640 0 : if (value == NULL) {
641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->create_time");
642 0 : return -1;
643 : }
644 : {
645 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->create_time));
646 0 : if (PyLong_Check(value)) {
647 : unsigned long long test_var;
648 0 : test_var = PyLong_AsUnsignedLongLong(value);
649 0 : if (PyErr_Occurred() != NULL) {
650 0 : return -1;
651 : }
652 0 : if (test_var > uint_max) {
653 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
654 : PyLong_Type.tp_name, uint_max, test_var);
655 0 : return -1;
656 : }
657 0 : object->create_time = test_var;
658 : } else {
659 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
660 : PyLong_Type.tp_name);
661 0 : return -1;
662 : }
663 : }
664 0 : return 0;
665 : }
666 :
667 0 : static PyObject *py_xattr_DosInfo2Old_get_change_time(PyObject *obj, void *closure)
668 : {
669 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
670 : PyObject *py_change_time;
671 0 : py_change_time = PyLong_FromUnsignedLongLong(object->change_time);
672 0 : return py_change_time;
673 : }
674 :
675 0 : static int py_xattr_DosInfo2Old_set_change_time(PyObject *py_obj, PyObject *value, void *closure)
676 : {
677 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
678 0 : if (value == NULL) {
679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->change_time");
680 0 : return -1;
681 : }
682 : {
683 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->change_time));
684 0 : if (PyLong_Check(value)) {
685 : unsigned long long test_var;
686 0 : test_var = PyLong_AsUnsignedLongLong(value);
687 0 : if (PyErr_Occurred() != NULL) {
688 0 : return -1;
689 : }
690 0 : if (test_var > uint_max) {
691 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
692 : PyLong_Type.tp_name, uint_max, test_var);
693 0 : return -1;
694 : }
695 0 : object->change_time = test_var;
696 : } else {
697 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
698 : PyLong_Type.tp_name);
699 0 : return -1;
700 : }
701 : }
702 0 : return 0;
703 : }
704 :
705 0 : static PyObject *py_xattr_DosInfo2Old_get_write_time(PyObject *obj, void *closure)
706 : {
707 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
708 : PyObject *py_write_time;
709 0 : py_write_time = PyLong_FromUnsignedLongLong(object->write_time);
710 0 : return py_write_time;
711 : }
712 :
713 0 : static int py_xattr_DosInfo2Old_set_write_time(PyObject *py_obj, PyObject *value, void *closure)
714 : {
715 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
716 0 : if (value == NULL) {
717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->write_time");
718 0 : return -1;
719 : }
720 : {
721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->write_time));
722 0 : if (PyLong_Check(value)) {
723 : unsigned long long test_var;
724 0 : test_var = PyLong_AsUnsignedLongLong(value);
725 0 : if (PyErr_Occurred() != NULL) {
726 0 : return -1;
727 : }
728 0 : if (test_var > uint_max) {
729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
730 : PyLong_Type.tp_name, uint_max, test_var);
731 0 : return -1;
732 : }
733 0 : object->write_time = test_var;
734 : } else {
735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
736 : PyLong_Type.tp_name);
737 0 : return -1;
738 : }
739 : }
740 0 : return 0;
741 : }
742 :
743 0 : static PyObject *py_xattr_DosInfo2Old_get_name(PyObject *obj, void *closure)
744 : {
745 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(obj);
746 : PyObject *py_name;
747 0 : py_name = PyString_FromStringOrNULL(object->name);
748 0 : return py_name;
749 : }
750 :
751 0 : static int py_xattr_DosInfo2Old_set_name(PyObject *py_obj, PyObject *value, void *closure)
752 : {
753 0 : struct xattr_DosInfo2Old *object = (struct xattr_DosInfo2Old *)pytalloc_get_ptr(py_obj);
754 0 : if (value == NULL) {
755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
756 0 : return -1;
757 : }
758 : {
759 : const char *test_str;
760 : const char *talloc_str;
761 0 : PyObject *unicode = NULL;
762 0 : if (PyUnicode_Check(value)) {
763 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
764 0 : if (unicode == NULL) {
765 0 : PyErr_NoMemory();
766 0 : return -1;
767 : }
768 0 : test_str = PyBytes_AS_STRING(unicode);
769 0 : } else if (PyBytes_Check(value)) {
770 0 : test_str = PyBytes_AS_STRING(value);
771 : } else {
772 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
773 0 : return -1;
774 : }
775 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
776 0 : if (unicode != NULL) {
777 0 : Py_DECREF(unicode);
778 : }
779 0 : if (talloc_str == NULL) {
780 0 : PyErr_NoMemory();
781 0 : return -1;
782 : }
783 0 : object->name = talloc_str;
784 : }
785 0 : return 0;
786 : }
787 :
788 : static PyGetSetDef py_xattr_DosInfo2Old_getsetters[] = {
789 : {
790 : .name = discard_const_p(char, "flags"),
791 : .get = py_xattr_DosInfo2Old_get_flags,
792 : .set = py_xattr_DosInfo2Old_set_flags,
793 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
794 : },
795 : {
796 : .name = discard_const_p(char, "attrib"),
797 : .get = py_xattr_DosInfo2Old_get_attrib,
798 : .set = py_xattr_DosInfo2Old_set_attrib,
799 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
800 : },
801 : {
802 : .name = discard_const_p(char, "ea_size"),
803 : .get = py_xattr_DosInfo2Old_get_ea_size,
804 : .set = py_xattr_DosInfo2Old_set_ea_size,
805 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
806 : },
807 : {
808 : .name = discard_const_p(char, "size"),
809 : .get = py_xattr_DosInfo2Old_get_size,
810 : .set = py_xattr_DosInfo2Old_set_size,
811 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
812 : },
813 : {
814 : .name = discard_const_p(char, "alloc_size"),
815 : .get = py_xattr_DosInfo2Old_get_alloc_size,
816 : .set = py_xattr_DosInfo2Old_set_alloc_size,
817 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
818 : },
819 : {
820 : .name = discard_const_p(char, "create_time"),
821 : .get = py_xattr_DosInfo2Old_get_create_time,
822 : .set = py_xattr_DosInfo2Old_set_create_time,
823 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
824 : },
825 : {
826 : .name = discard_const_p(char, "change_time"),
827 : .get = py_xattr_DosInfo2Old_get_change_time,
828 : .set = py_xattr_DosInfo2Old_set_change_time,
829 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
830 : },
831 : {
832 : .name = discard_const_p(char, "write_time"),
833 : .get = py_xattr_DosInfo2Old_get_write_time,
834 : .set = py_xattr_DosInfo2Old_set_write_time,
835 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
836 : },
837 : {
838 : .name = discard_const_p(char, "name"),
839 : .get = py_xattr_DosInfo2Old_get_name,
840 : .set = py_xattr_DosInfo2Old_set_name,
841 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
842 : },
843 : { .name = NULL }
844 : };
845 :
846 0 : static PyObject *py_xattr_DosInfo2Old_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
847 : {
848 0 : return pytalloc_new(struct xattr_DosInfo2Old, type);
849 : }
850 :
851 :
852 : static PyTypeObject xattr_DosInfo2Old_Type = {
853 : PyVarObject_HEAD_INIT(NULL, 0)
854 : .tp_name = "xattr.DosInfo2Old",
855 : .tp_getset = py_xattr_DosInfo2Old_getsetters,
856 : .tp_methods = NULL,
857 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
858 : .tp_new = py_xattr_DosInfo2Old_new,
859 : };
860 :
861 :
862 0 : static PyObject *py_xattr_DosInfo3_get_valid_flags(PyObject *obj, void *closure)
863 : {
864 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
865 : PyObject *py_valid_flags;
866 0 : py_valid_flags = PyLong_FromUnsignedLongLong((uint32_t)object->valid_flags);
867 0 : return py_valid_flags;
868 : }
869 :
870 0 : static int py_xattr_DosInfo3_set_valid_flags(PyObject *py_obj, PyObject *value, void *closure)
871 : {
872 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
873 0 : if (value == NULL) {
874 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->valid_flags");
875 0 : return -1;
876 : }
877 : {
878 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->valid_flags));
879 0 : if (PyLong_Check(value)) {
880 : unsigned long long test_var;
881 0 : test_var = PyLong_AsUnsignedLongLong(value);
882 0 : if (PyErr_Occurred() != NULL) {
883 0 : return -1;
884 : }
885 0 : if (test_var > uint_max) {
886 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
887 : PyLong_Type.tp_name, uint_max, test_var);
888 0 : return -1;
889 : }
890 0 : object->valid_flags = test_var;
891 : } else {
892 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
893 : PyLong_Type.tp_name);
894 0 : return -1;
895 : }
896 : }
897 0 : return 0;
898 : }
899 :
900 0 : static PyObject *py_xattr_DosInfo3_get_attrib(PyObject *obj, void *closure)
901 : {
902 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
903 : PyObject *py_attrib;
904 0 : py_attrib = PyLong_FromUnsignedLongLong((uint32_t)object->attrib);
905 0 : return py_attrib;
906 : }
907 :
908 0 : static int py_xattr_DosInfo3_set_attrib(PyObject *py_obj, PyObject *value, void *closure)
909 : {
910 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
911 0 : if (value == NULL) {
912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib");
913 0 : return -1;
914 : }
915 : {
916 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrib));
917 0 : if (PyLong_Check(value)) {
918 : unsigned long long test_var;
919 0 : test_var = PyLong_AsUnsignedLongLong(value);
920 0 : if (PyErr_Occurred() != NULL) {
921 0 : return -1;
922 : }
923 0 : if (test_var > uint_max) {
924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
925 : PyLong_Type.tp_name, uint_max, test_var);
926 0 : return -1;
927 : }
928 0 : object->attrib = test_var;
929 : } else {
930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
931 : PyLong_Type.tp_name);
932 0 : return -1;
933 : }
934 : }
935 0 : return 0;
936 : }
937 :
938 0 : static PyObject *py_xattr_DosInfo3_get_ea_size(PyObject *obj, void *closure)
939 : {
940 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
941 : PyObject *py_ea_size;
942 0 : py_ea_size = PyLong_FromUnsignedLongLong((uint32_t)object->ea_size);
943 0 : return py_ea_size;
944 : }
945 :
946 0 : static int py_xattr_DosInfo3_set_ea_size(PyObject *py_obj, PyObject *value, void *closure)
947 : {
948 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
949 0 : if (value == NULL) {
950 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ea_size");
951 0 : return -1;
952 : }
953 : {
954 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ea_size));
955 0 : if (PyLong_Check(value)) {
956 : unsigned long long test_var;
957 0 : test_var = PyLong_AsUnsignedLongLong(value);
958 0 : if (PyErr_Occurred() != NULL) {
959 0 : return -1;
960 : }
961 0 : if (test_var > uint_max) {
962 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
963 : PyLong_Type.tp_name, uint_max, test_var);
964 0 : return -1;
965 : }
966 0 : object->ea_size = test_var;
967 : } else {
968 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
969 : PyLong_Type.tp_name);
970 0 : return -1;
971 : }
972 : }
973 0 : return 0;
974 : }
975 :
976 0 : static PyObject *py_xattr_DosInfo3_get_size(PyObject *obj, void *closure)
977 : {
978 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
979 : PyObject *py_size;
980 0 : py_size = PyLong_FromUnsignedLongLong(object->size);
981 0 : return py_size;
982 : }
983 :
984 0 : static int py_xattr_DosInfo3_set_size(PyObject *py_obj, PyObject *value, void *closure)
985 : {
986 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
987 0 : if (value == NULL) {
988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
989 0 : return -1;
990 : }
991 : {
992 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
993 0 : if (PyLong_Check(value)) {
994 : unsigned long long test_var;
995 0 : test_var = PyLong_AsUnsignedLongLong(value);
996 0 : if (PyErr_Occurred() != NULL) {
997 0 : return -1;
998 : }
999 0 : if (test_var > uint_max) {
1000 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1001 : PyLong_Type.tp_name, uint_max, test_var);
1002 0 : return -1;
1003 : }
1004 0 : object->size = test_var;
1005 : } else {
1006 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1007 : PyLong_Type.tp_name);
1008 0 : return -1;
1009 : }
1010 : }
1011 0 : return 0;
1012 : }
1013 :
1014 0 : static PyObject *py_xattr_DosInfo3_get_alloc_size(PyObject *obj, void *closure)
1015 : {
1016 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
1017 : PyObject *py_alloc_size;
1018 0 : py_alloc_size = PyLong_FromUnsignedLongLong(object->alloc_size);
1019 0 : return py_alloc_size;
1020 : }
1021 :
1022 0 : static int py_xattr_DosInfo3_set_alloc_size(PyObject *py_obj, PyObject *value, void *closure)
1023 : {
1024 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
1025 0 : if (value == NULL) {
1026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->alloc_size");
1027 0 : return -1;
1028 : }
1029 : {
1030 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_size));
1031 0 : if (PyLong_Check(value)) {
1032 : unsigned long long test_var;
1033 0 : test_var = PyLong_AsUnsignedLongLong(value);
1034 0 : if (PyErr_Occurred() != NULL) {
1035 0 : return -1;
1036 : }
1037 0 : if (test_var > uint_max) {
1038 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1039 : PyLong_Type.tp_name, uint_max, test_var);
1040 0 : return -1;
1041 : }
1042 0 : object->alloc_size = test_var;
1043 : } else {
1044 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1045 : PyLong_Type.tp_name);
1046 0 : return -1;
1047 : }
1048 : }
1049 0 : return 0;
1050 : }
1051 :
1052 0 : static PyObject *py_xattr_DosInfo3_get_create_time(PyObject *obj, void *closure)
1053 : {
1054 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
1055 : PyObject *py_create_time;
1056 0 : py_create_time = PyLong_FromUnsignedLongLong(object->create_time);
1057 0 : return py_create_time;
1058 : }
1059 :
1060 0 : static int py_xattr_DosInfo3_set_create_time(PyObject *py_obj, PyObject *value, void *closure)
1061 : {
1062 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
1063 0 : if (value == NULL) {
1064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->create_time");
1065 0 : return -1;
1066 : }
1067 : {
1068 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->create_time));
1069 0 : if (PyLong_Check(value)) {
1070 : unsigned long long test_var;
1071 0 : test_var = PyLong_AsUnsignedLongLong(value);
1072 0 : if (PyErr_Occurred() != NULL) {
1073 0 : return -1;
1074 : }
1075 0 : if (test_var > uint_max) {
1076 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1077 : PyLong_Type.tp_name, uint_max, test_var);
1078 0 : return -1;
1079 : }
1080 0 : object->create_time = test_var;
1081 : } else {
1082 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1083 : PyLong_Type.tp_name);
1084 0 : return -1;
1085 : }
1086 : }
1087 0 : return 0;
1088 : }
1089 :
1090 0 : static PyObject *py_xattr_DosInfo3_get_change_time(PyObject *obj, void *closure)
1091 : {
1092 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(obj);
1093 : PyObject *py_change_time;
1094 0 : py_change_time = PyLong_FromUnsignedLongLong(object->change_time);
1095 0 : return py_change_time;
1096 : }
1097 :
1098 0 : static int py_xattr_DosInfo3_set_change_time(PyObject *py_obj, PyObject *value, void *closure)
1099 : {
1100 0 : struct xattr_DosInfo3 *object = (struct xattr_DosInfo3 *)pytalloc_get_ptr(py_obj);
1101 0 : if (value == NULL) {
1102 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->change_time");
1103 0 : return -1;
1104 : }
1105 : {
1106 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->change_time));
1107 0 : if (PyLong_Check(value)) {
1108 : unsigned long long test_var;
1109 0 : test_var = PyLong_AsUnsignedLongLong(value);
1110 0 : if (PyErr_Occurred() != NULL) {
1111 0 : return -1;
1112 : }
1113 0 : if (test_var > uint_max) {
1114 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1115 : PyLong_Type.tp_name, uint_max, test_var);
1116 0 : return -1;
1117 : }
1118 0 : object->change_time = test_var;
1119 : } else {
1120 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1121 : PyLong_Type.tp_name);
1122 0 : return -1;
1123 : }
1124 : }
1125 0 : return 0;
1126 : }
1127 :
1128 : static PyGetSetDef py_xattr_DosInfo3_getsetters[] = {
1129 : {
1130 : .name = discard_const_p(char, "valid_flags"),
1131 : .get = py_xattr_DosInfo3_get_valid_flags,
1132 : .set = py_xattr_DosInfo3_set_valid_flags,
1133 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_DosInfoValidFlags")
1134 : },
1135 : {
1136 : .name = discard_const_p(char, "attrib"),
1137 : .get = py_xattr_DosInfo3_get_attrib,
1138 : .set = py_xattr_DosInfo3_set_attrib,
1139 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1140 : },
1141 : {
1142 : .name = discard_const_p(char, "ea_size"),
1143 : .get = py_xattr_DosInfo3_get_ea_size,
1144 : .set = py_xattr_DosInfo3_set_ea_size,
1145 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1146 : },
1147 : {
1148 : .name = discard_const_p(char, "size"),
1149 : .get = py_xattr_DosInfo3_get_size,
1150 : .set = py_xattr_DosInfo3_set_size,
1151 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
1152 : },
1153 : {
1154 : .name = discard_const_p(char, "alloc_size"),
1155 : .get = py_xattr_DosInfo3_get_alloc_size,
1156 : .set = py_xattr_DosInfo3_set_alloc_size,
1157 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
1158 : },
1159 : {
1160 : .name = discard_const_p(char, "create_time"),
1161 : .get = py_xattr_DosInfo3_get_create_time,
1162 : .set = py_xattr_DosInfo3_set_create_time,
1163 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1164 : },
1165 : {
1166 : .name = discard_const_p(char, "change_time"),
1167 : .get = py_xattr_DosInfo3_get_change_time,
1168 : .set = py_xattr_DosInfo3_set_change_time,
1169 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1170 : },
1171 : { .name = NULL }
1172 : };
1173 :
1174 0 : static PyObject *py_xattr_DosInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1175 : {
1176 0 : return pytalloc_new(struct xattr_DosInfo3, type);
1177 : }
1178 :
1179 :
1180 : static PyTypeObject xattr_DosInfo3_Type = {
1181 : PyVarObject_HEAD_INIT(NULL, 0)
1182 : .tp_name = "xattr.DosInfo3",
1183 : .tp_getset = py_xattr_DosInfo3_getsetters,
1184 : .tp_methods = NULL,
1185 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1186 : .tp_new = py_xattr_DosInfo3_new,
1187 : };
1188 :
1189 :
1190 0 : static PyObject *py_xattr_DosInfo4_get_valid_flags(PyObject *obj, void *closure)
1191 : {
1192 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(obj);
1193 : PyObject *py_valid_flags;
1194 0 : py_valid_flags = PyLong_FromUnsignedLongLong((uint32_t)object->valid_flags);
1195 0 : return py_valid_flags;
1196 : }
1197 :
1198 0 : static int py_xattr_DosInfo4_set_valid_flags(PyObject *py_obj, PyObject *value, void *closure)
1199 : {
1200 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(py_obj);
1201 0 : if (value == NULL) {
1202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->valid_flags");
1203 0 : return -1;
1204 : }
1205 : {
1206 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->valid_flags));
1207 0 : if (PyLong_Check(value)) {
1208 : unsigned long long test_var;
1209 0 : test_var = PyLong_AsUnsignedLongLong(value);
1210 0 : if (PyErr_Occurred() != NULL) {
1211 0 : return -1;
1212 : }
1213 0 : if (test_var > uint_max) {
1214 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1215 : PyLong_Type.tp_name, uint_max, test_var);
1216 0 : return -1;
1217 : }
1218 0 : object->valid_flags = test_var;
1219 : } else {
1220 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1221 : PyLong_Type.tp_name);
1222 0 : return -1;
1223 : }
1224 : }
1225 0 : return 0;
1226 : }
1227 :
1228 0 : static PyObject *py_xattr_DosInfo4_get_attrib(PyObject *obj, void *closure)
1229 : {
1230 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(obj);
1231 : PyObject *py_attrib;
1232 0 : py_attrib = PyLong_FromUnsignedLongLong((uint32_t)object->attrib);
1233 0 : return py_attrib;
1234 : }
1235 :
1236 0 : static int py_xattr_DosInfo4_set_attrib(PyObject *py_obj, PyObject *value, void *closure)
1237 : {
1238 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(py_obj);
1239 0 : if (value == NULL) {
1240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib");
1241 0 : return -1;
1242 : }
1243 : {
1244 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrib));
1245 0 : if (PyLong_Check(value)) {
1246 : unsigned long long test_var;
1247 0 : test_var = PyLong_AsUnsignedLongLong(value);
1248 0 : if (PyErr_Occurred() != NULL) {
1249 0 : return -1;
1250 : }
1251 0 : if (test_var > uint_max) {
1252 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1253 : PyLong_Type.tp_name, uint_max, test_var);
1254 0 : return -1;
1255 : }
1256 0 : object->attrib = test_var;
1257 : } else {
1258 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1259 : PyLong_Type.tp_name);
1260 0 : return -1;
1261 : }
1262 : }
1263 0 : return 0;
1264 : }
1265 :
1266 0 : static PyObject *py_xattr_DosInfo4_get_itime(PyObject *obj, void *closure)
1267 : {
1268 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(obj);
1269 : PyObject *py_itime;
1270 0 : py_itime = PyLong_FromUnsignedLongLong(object->itime);
1271 0 : return py_itime;
1272 : }
1273 :
1274 0 : static int py_xattr_DosInfo4_set_itime(PyObject *py_obj, PyObject *value, void *closure)
1275 : {
1276 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(py_obj);
1277 0 : if (value == NULL) {
1278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->itime");
1279 0 : return -1;
1280 : }
1281 : {
1282 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->itime));
1283 0 : if (PyLong_Check(value)) {
1284 : unsigned long long test_var;
1285 0 : test_var = PyLong_AsUnsignedLongLong(value);
1286 0 : if (PyErr_Occurred() != NULL) {
1287 0 : return -1;
1288 : }
1289 0 : if (test_var > uint_max) {
1290 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1291 : PyLong_Type.tp_name, uint_max, test_var);
1292 0 : return -1;
1293 : }
1294 0 : object->itime = test_var;
1295 : } else {
1296 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1297 : PyLong_Type.tp_name);
1298 0 : return -1;
1299 : }
1300 : }
1301 0 : return 0;
1302 : }
1303 :
1304 0 : static PyObject *py_xattr_DosInfo4_get_create_time(PyObject *obj, void *closure)
1305 : {
1306 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(obj);
1307 : PyObject *py_create_time;
1308 0 : py_create_time = PyLong_FromUnsignedLongLong(object->create_time);
1309 0 : return py_create_time;
1310 : }
1311 :
1312 0 : static int py_xattr_DosInfo4_set_create_time(PyObject *py_obj, PyObject *value, void *closure)
1313 : {
1314 0 : struct xattr_DosInfo4 *object = (struct xattr_DosInfo4 *)pytalloc_get_ptr(py_obj);
1315 0 : if (value == NULL) {
1316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->create_time");
1317 0 : return -1;
1318 : }
1319 : {
1320 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->create_time));
1321 0 : if (PyLong_Check(value)) {
1322 : unsigned long long test_var;
1323 0 : test_var = PyLong_AsUnsignedLongLong(value);
1324 0 : if (PyErr_Occurred() != NULL) {
1325 0 : return -1;
1326 : }
1327 0 : if (test_var > uint_max) {
1328 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1329 : PyLong_Type.tp_name, uint_max, test_var);
1330 0 : return -1;
1331 : }
1332 0 : object->create_time = test_var;
1333 : } else {
1334 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1335 : PyLong_Type.tp_name);
1336 0 : return -1;
1337 : }
1338 : }
1339 0 : return 0;
1340 : }
1341 :
1342 : static PyGetSetDef py_xattr_DosInfo4_getsetters[] = {
1343 : {
1344 : .name = discard_const_p(char, "valid_flags"),
1345 : .get = py_xattr_DosInfo4_get_valid_flags,
1346 : .set = py_xattr_DosInfo4_set_valid_flags,
1347 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_DosInfoValidFlags")
1348 : },
1349 : {
1350 : .name = discard_const_p(char, "attrib"),
1351 : .get = py_xattr_DosInfo4_get_attrib,
1352 : .set = py_xattr_DosInfo4_set_attrib,
1353 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1354 : },
1355 : {
1356 : .name = discard_const_p(char, "itime"),
1357 : .get = py_xattr_DosInfo4_get_itime,
1358 : .set = py_xattr_DosInfo4_set_itime,
1359 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1360 : },
1361 : {
1362 : .name = discard_const_p(char, "create_time"),
1363 : .get = py_xattr_DosInfo4_get_create_time,
1364 : .set = py_xattr_DosInfo4_set_create_time,
1365 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1366 : },
1367 : { .name = NULL }
1368 : };
1369 :
1370 0 : static PyObject *py_xattr_DosInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1371 : {
1372 0 : return pytalloc_new(struct xattr_DosInfo4, type);
1373 : }
1374 :
1375 :
1376 : static PyTypeObject xattr_DosInfo4_Type = {
1377 : PyVarObject_HEAD_INIT(NULL, 0)
1378 : .tp_name = "xattr.DosInfo4",
1379 : .tp_getset = py_xattr_DosInfo4_getsetters,
1380 : .tp_methods = NULL,
1381 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1382 : .tp_new = py_xattr_DosInfo4_new,
1383 : };
1384 :
1385 :
1386 0 : static PyObject *py_xattr_DosInfo5_get_valid_flags(PyObject *obj, void *closure)
1387 : {
1388 0 : struct xattr_DosInfo5 *object = (struct xattr_DosInfo5 *)pytalloc_get_ptr(obj);
1389 : PyObject *py_valid_flags;
1390 0 : py_valid_flags = PyLong_FromUnsignedLongLong((uint32_t)object->valid_flags);
1391 0 : return py_valid_flags;
1392 : }
1393 :
1394 0 : static int py_xattr_DosInfo5_set_valid_flags(PyObject *py_obj, PyObject *value, void *closure)
1395 : {
1396 0 : struct xattr_DosInfo5 *object = (struct xattr_DosInfo5 *)pytalloc_get_ptr(py_obj);
1397 0 : if (value == NULL) {
1398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->valid_flags");
1399 0 : return -1;
1400 : }
1401 : {
1402 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->valid_flags));
1403 0 : if (PyLong_Check(value)) {
1404 : unsigned long long test_var;
1405 0 : test_var = PyLong_AsUnsignedLongLong(value);
1406 0 : if (PyErr_Occurred() != NULL) {
1407 0 : return -1;
1408 : }
1409 0 : if (test_var > uint_max) {
1410 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1411 : PyLong_Type.tp_name, uint_max, test_var);
1412 0 : return -1;
1413 : }
1414 0 : object->valid_flags = test_var;
1415 : } else {
1416 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1417 : PyLong_Type.tp_name);
1418 0 : return -1;
1419 : }
1420 : }
1421 0 : return 0;
1422 : }
1423 :
1424 0 : static PyObject *py_xattr_DosInfo5_get_attrib(PyObject *obj, void *closure)
1425 : {
1426 0 : struct xattr_DosInfo5 *object = (struct xattr_DosInfo5 *)pytalloc_get_ptr(obj);
1427 : PyObject *py_attrib;
1428 0 : py_attrib = PyLong_FromUnsignedLongLong((uint32_t)object->attrib);
1429 0 : return py_attrib;
1430 : }
1431 :
1432 0 : static int py_xattr_DosInfo5_set_attrib(PyObject *py_obj, PyObject *value, void *closure)
1433 : {
1434 0 : struct xattr_DosInfo5 *object = (struct xattr_DosInfo5 *)pytalloc_get_ptr(py_obj);
1435 0 : if (value == NULL) {
1436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib");
1437 0 : return -1;
1438 : }
1439 : {
1440 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attrib));
1441 0 : if (PyLong_Check(value)) {
1442 : unsigned long long test_var;
1443 0 : test_var = PyLong_AsUnsignedLongLong(value);
1444 0 : if (PyErr_Occurred() != NULL) {
1445 0 : return -1;
1446 : }
1447 0 : if (test_var > uint_max) {
1448 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1449 : PyLong_Type.tp_name, uint_max, test_var);
1450 0 : return -1;
1451 : }
1452 0 : object->attrib = test_var;
1453 : } else {
1454 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1455 : PyLong_Type.tp_name);
1456 0 : return -1;
1457 : }
1458 : }
1459 0 : return 0;
1460 : }
1461 :
1462 0 : static PyObject *py_xattr_DosInfo5_get_create_time(PyObject *obj, void *closure)
1463 : {
1464 0 : struct xattr_DosInfo5 *object = (struct xattr_DosInfo5 *)pytalloc_get_ptr(obj);
1465 : PyObject *py_create_time;
1466 0 : py_create_time = PyLong_FromUnsignedLongLong(object->create_time);
1467 0 : return py_create_time;
1468 : }
1469 :
1470 0 : static int py_xattr_DosInfo5_set_create_time(PyObject *py_obj, PyObject *value, void *closure)
1471 : {
1472 0 : struct xattr_DosInfo5 *object = (struct xattr_DosInfo5 *)pytalloc_get_ptr(py_obj);
1473 0 : if (value == NULL) {
1474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->create_time");
1475 0 : return -1;
1476 : }
1477 : {
1478 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->create_time));
1479 0 : if (PyLong_Check(value)) {
1480 : unsigned long long test_var;
1481 0 : test_var = PyLong_AsUnsignedLongLong(value);
1482 0 : if (PyErr_Occurred() != NULL) {
1483 0 : return -1;
1484 : }
1485 0 : if (test_var > uint_max) {
1486 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1487 : PyLong_Type.tp_name, uint_max, test_var);
1488 0 : return -1;
1489 : }
1490 0 : object->create_time = test_var;
1491 : } else {
1492 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1493 : PyLong_Type.tp_name);
1494 0 : return -1;
1495 : }
1496 : }
1497 0 : return 0;
1498 : }
1499 :
1500 : static PyGetSetDef py_xattr_DosInfo5_getsetters[] = {
1501 : {
1502 : .name = discard_const_p(char, "valid_flags"),
1503 : .get = py_xattr_DosInfo5_get_valid_flags,
1504 : .set = py_xattr_DosInfo5_set_valid_flags,
1505 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_DosInfoValidFlags")
1506 : },
1507 : {
1508 : .name = discard_const_p(char, "attrib"),
1509 : .get = py_xattr_DosInfo5_get_attrib,
1510 : .set = py_xattr_DosInfo5_set_attrib,
1511 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1512 : },
1513 : {
1514 : .name = discard_const_p(char, "create_time"),
1515 : .get = py_xattr_DosInfo5_get_create_time,
1516 : .set = py_xattr_DosInfo5_set_create_time,
1517 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1518 : },
1519 : { .name = NULL }
1520 : };
1521 :
1522 0 : static PyObject *py_xattr_DosInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1523 : {
1524 0 : return pytalloc_new(struct xattr_DosInfo5, type);
1525 : }
1526 :
1527 :
1528 : static PyTypeObject xattr_DosInfo5_Type = {
1529 : PyVarObject_HEAD_INIT(NULL, 0)
1530 : .tp_name = "xattr.DosInfo5",
1531 : .tp_getset = py_xattr_DosInfo5_getsetters,
1532 : .tp_methods = NULL,
1533 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1534 : .tp_new = py_xattr_DosInfo5_new,
1535 : };
1536 :
1537 0 : static PyObject *py_import_xattr_DosInfo(TALLOC_CTX *mem_ctx, int level, union xattr_DosInfo *in)
1538 : {
1539 : PyObject *ret;
1540 :
1541 0 : switch (level) {
1542 0 : case 0xFFFF:
1543 0 : ret = pytalloc_reference_ex(&xattr_DosInfoFFFFCompat_Type, mem_ctx, &in->compatinfoFFFF);
1544 0 : return ret;
1545 :
1546 0 : case 1:
1547 0 : ret = pytalloc_reference_ex(&xattr_DosInfo1_Type, mem_ctx, &in->info1);
1548 0 : return ret;
1549 :
1550 0 : case 2:
1551 0 : ret = pytalloc_reference_ex(&xattr_DosInfo2Old_Type, mem_ctx, &in->oldinfo2);
1552 0 : return ret;
1553 :
1554 0 : case 3:
1555 0 : ret = pytalloc_reference_ex(&xattr_DosInfo3_Type, mem_ctx, &in->info3);
1556 0 : return ret;
1557 :
1558 0 : case 4:
1559 0 : ret = pytalloc_reference_ex(&xattr_DosInfo4_Type, mem_ctx, &in->info4);
1560 0 : return ret;
1561 :
1562 0 : case 5:
1563 0 : ret = pytalloc_reference_ex(&xattr_DosInfo5_Type, mem_ctx, &in->info5);
1564 0 : return ret;
1565 :
1566 : }
1567 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1568 0 : return NULL;
1569 : }
1570 :
1571 0 : static union xattr_DosInfo *py_export_xattr_DosInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1572 : {
1573 0 : union xattr_DosInfo *ret = talloc_zero(mem_ctx, union xattr_DosInfo);
1574 0 : switch (level) {
1575 0 : case 0xFFFF:
1576 0 : if (in == NULL) {
1577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->compatinfoFFFF");
1578 0 : talloc_free(ret); return NULL;
1579 : }
1580 0 : PY_CHECK_TYPE(&xattr_DosInfoFFFFCompat_Type, in, talloc_free(ret); return NULL;);
1581 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1582 0 : PyErr_NoMemory();
1583 0 : talloc_free(ret); return NULL;
1584 : }
1585 0 : ret->compatinfoFFFF = *(struct xattr_DosInfoFFFFCompat *)pytalloc_get_ptr(in);
1586 0 : break;
1587 :
1588 0 : case 1:
1589 0 : if (in == NULL) {
1590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
1591 0 : talloc_free(ret); return NULL;
1592 : }
1593 0 : PY_CHECK_TYPE(&xattr_DosInfo1_Type, in, talloc_free(ret); return NULL;);
1594 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1595 0 : PyErr_NoMemory();
1596 0 : talloc_free(ret); return NULL;
1597 : }
1598 0 : ret->info1 = *(struct xattr_DosInfo1 *)pytalloc_get_ptr(in);
1599 0 : break;
1600 :
1601 0 : case 2:
1602 0 : if (in == NULL) {
1603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->oldinfo2");
1604 0 : talloc_free(ret); return NULL;
1605 : }
1606 0 : PY_CHECK_TYPE(&xattr_DosInfo2Old_Type, in, talloc_free(ret); return NULL;);
1607 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1608 0 : PyErr_NoMemory();
1609 0 : talloc_free(ret); return NULL;
1610 : }
1611 0 : ret->oldinfo2 = *(struct xattr_DosInfo2Old *)pytalloc_get_ptr(in);
1612 0 : break;
1613 :
1614 0 : case 3:
1615 0 : if (in == NULL) {
1616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
1617 0 : talloc_free(ret); return NULL;
1618 : }
1619 0 : PY_CHECK_TYPE(&xattr_DosInfo3_Type, in, talloc_free(ret); return NULL;);
1620 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1621 0 : PyErr_NoMemory();
1622 0 : talloc_free(ret); return NULL;
1623 : }
1624 0 : ret->info3 = *(struct xattr_DosInfo3 *)pytalloc_get_ptr(in);
1625 0 : break;
1626 :
1627 0 : case 4:
1628 0 : if (in == NULL) {
1629 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4");
1630 0 : talloc_free(ret); return NULL;
1631 : }
1632 0 : PY_CHECK_TYPE(&xattr_DosInfo4_Type, in, talloc_free(ret); return NULL;);
1633 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1634 0 : PyErr_NoMemory();
1635 0 : talloc_free(ret); return NULL;
1636 : }
1637 0 : ret->info4 = *(struct xattr_DosInfo4 *)pytalloc_get_ptr(in);
1638 0 : break;
1639 :
1640 0 : case 5:
1641 0 : if (in == NULL) {
1642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5");
1643 0 : talloc_free(ret); return NULL;
1644 : }
1645 0 : PY_CHECK_TYPE(&xattr_DosInfo5_Type, in, talloc_free(ret); return NULL;);
1646 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1647 0 : PyErr_NoMemory();
1648 0 : talloc_free(ret); return NULL;
1649 : }
1650 0 : ret->info5 = *(struct xattr_DosInfo5 *)pytalloc_get_ptr(in);
1651 0 : break;
1652 :
1653 0 : default:
1654 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
1655 0 : talloc_free(ret);
1656 0 : ret = NULL;
1657 : }
1658 :
1659 0 : return ret;
1660 : }
1661 :
1662 0 : static PyObject *py_xattr_DosInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1663 : {
1664 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1665 0 : PyObject *mem_ctx_obj = NULL;
1666 0 : TALLOC_CTX *mem_ctx = NULL;
1667 0 : int level = 0;
1668 0 : PyObject *in_obj = NULL;
1669 0 : union xattr_DosInfo *in = NULL;
1670 :
1671 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1672 : discard_const_p(char *, kwnames),
1673 : &mem_ctx_obj,
1674 : &level,
1675 : &in_obj)) {
1676 0 : return NULL;
1677 : }
1678 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1679 0 : if (mem_ctx == NULL) {
1680 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1681 0 : return NULL;
1682 : }
1683 0 : in = (union xattr_DosInfo *)pytalloc_get_ptr(in_obj);
1684 0 : if (in == NULL) {
1685 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union xattr_DosInfo!");
1686 0 : return NULL;
1687 : }
1688 :
1689 0 : return py_import_xattr_DosInfo(mem_ctx, level, in);
1690 : }
1691 :
1692 0 : static PyObject *py_xattr_DosInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1693 : {
1694 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1695 0 : PyObject *mem_ctx_obj = NULL;
1696 0 : TALLOC_CTX *mem_ctx = NULL;
1697 0 : int level = 0;
1698 0 : PyObject *in = NULL;
1699 0 : union xattr_DosInfo *out = NULL;
1700 :
1701 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1702 : discard_const_p(char *, kwnames),
1703 : &mem_ctx_obj,
1704 : &level,
1705 : &in)) {
1706 0 : return NULL;
1707 : }
1708 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1709 0 : if (mem_ctx == NULL) {
1710 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1711 0 : return NULL;
1712 : }
1713 :
1714 0 : out = py_export_xattr_DosInfo(mem_ctx, level, in);
1715 0 : if (out == NULL) {
1716 0 : return NULL;
1717 : }
1718 :
1719 0 : return pytalloc_GenericObject_reference(out);
1720 : }
1721 :
1722 : static PyMethodDef py_xattr_DosInfo_methods[] = {
1723 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_DosInfo_import),
1724 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1725 : "T.__import__(mem_ctx, level, in) => ret." },
1726 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_DosInfo_export),
1727 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1728 : "T.__export__(mem_ctx, level, in) => ret." },
1729 : { NULL, NULL, 0, NULL }
1730 : };
1731 :
1732 0 : static PyObject *py_xattr_DosInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1733 : {
1734 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1735 0 : return NULL;
1736 : }
1737 :
1738 :
1739 : static PyTypeObject xattr_DosInfo_Type = {
1740 : PyVarObject_HEAD_INIT(NULL, 0)
1741 : .tp_name = "xattr.DosInfo",
1742 : .tp_getset = NULL,
1743 : .tp_methods = py_xattr_DosInfo_methods,
1744 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1745 : .tp_new = py_xattr_DosInfo_new,
1746 : };
1747 :
1748 :
1749 0 : static PyObject *py_xattr_DosAttrib_get_version(PyObject *obj, void *closure)
1750 : {
1751 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(obj);
1752 : PyObject *py_version;
1753 0 : py_version = PyLong_FromLong((uint16_t)object->version);
1754 0 : return py_version;
1755 : }
1756 :
1757 0 : static int py_xattr_DosAttrib_set_version(PyObject *py_obj, PyObject *value, void *closure)
1758 : {
1759 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(py_obj);
1760 0 : if (value == NULL) {
1761 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
1762 0 : return -1;
1763 : }
1764 : {
1765 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
1766 0 : if (PyLong_Check(value)) {
1767 : unsigned long long test_var;
1768 0 : test_var = PyLong_AsUnsignedLongLong(value);
1769 0 : if (PyErr_Occurred() != NULL) {
1770 0 : return -1;
1771 : }
1772 0 : if (test_var > uint_max) {
1773 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1774 : PyLong_Type.tp_name, uint_max, test_var);
1775 0 : return -1;
1776 : }
1777 0 : object->version = test_var;
1778 : } else {
1779 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1780 : PyLong_Type.tp_name);
1781 0 : return -1;
1782 : }
1783 : }
1784 0 : return 0;
1785 : }
1786 :
1787 0 : static PyObject *py_xattr_DosAttrib_get_info(PyObject *obj, void *closure)
1788 : {
1789 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(obj);
1790 : PyObject *py_info;
1791 0 : py_info = pyrpc_import_union(&xattr_DosInfo_Type, pytalloc_get_mem_ctx(obj), object->version, &object->info, "union xattr_DosInfo");
1792 0 : if (py_info == NULL) {
1793 0 : return NULL;
1794 : }
1795 0 : return py_info;
1796 : }
1797 :
1798 0 : static int py_xattr_DosAttrib_set_info(PyObject *py_obj, PyObject *value, void *closure)
1799 : {
1800 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(py_obj);
1801 0 : if (value == NULL) {
1802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
1803 0 : return -1;
1804 : }
1805 : {
1806 : union xattr_DosInfo *info_switch_0;
1807 0 : info_switch_0 = (union xattr_DosInfo *)pyrpc_export_union(&xattr_DosInfo_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union xattr_DosInfo");
1808 0 : if (info_switch_0 == NULL) {
1809 0 : return -1;
1810 : }
1811 0 : object->info = *info_switch_0;
1812 : }
1813 0 : return 0;
1814 : }
1815 :
1816 : static PyGetSetDef py_xattr_DosAttrib_getsetters[] = {
1817 : {
1818 : .name = discard_const_p(char, "version"),
1819 : .get = py_xattr_DosAttrib_get_version,
1820 : .set = py_xattr_DosAttrib_set_version,
1821 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1822 : },
1823 : {
1824 : .name = discard_const_p(char, "info"),
1825 : .get = py_xattr_DosAttrib_get_info,
1826 : .set = py_xattr_DosAttrib_set_info,
1827 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_DosInfo")
1828 : },
1829 : { .name = NULL }
1830 : };
1831 :
1832 0 : static PyObject *py_xattr_DosAttrib_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1833 : {
1834 0 : return pytalloc_new(struct xattr_DosAttrib, type);
1835 : }
1836 :
1837 0 : static PyObject *py_xattr_DosAttrib_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1838 : {
1839 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(py_obj);
1840 0 : PyObject *ret = NULL;
1841 : DATA_BLOB blob;
1842 : enum ndr_err_code err;
1843 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1844 0 : if (tmp_ctx == NULL) {
1845 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1846 0 : return NULL;
1847 : }
1848 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_xattr_DosAttrib);
1849 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1850 0 : TALLOC_FREE(tmp_ctx);
1851 0 : PyErr_SetNdrError(err);
1852 0 : return NULL;
1853 : }
1854 :
1855 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1856 0 : TALLOC_FREE(tmp_ctx);
1857 0 : return ret;
1858 : }
1859 :
1860 0 : static PyObject *py_xattr_DosAttrib_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1861 : {
1862 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(py_obj);
1863 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1864 0 : Py_ssize_t blob_length = 0;
1865 : enum ndr_err_code err;
1866 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1867 0 : PyObject *allow_remaining_obj = NULL;
1868 0 : bool allow_remaining = false;
1869 :
1870 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1871 : discard_const_p(char *, kwnames),
1872 : &blob.data, &blob_length,
1873 : &allow_remaining_obj)) {
1874 0 : return NULL;
1875 : }
1876 0 : blob.length = blob_length;
1877 :
1878 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1879 0 : allow_remaining = true;
1880 : }
1881 :
1882 0 : if (allow_remaining) {
1883 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosAttrib);
1884 : } else {
1885 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosAttrib);
1886 : }
1887 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1888 0 : PyErr_SetNdrError(err);
1889 0 : return NULL;
1890 : }
1891 :
1892 0 : Py_RETURN_NONE;
1893 : }
1894 :
1895 0 : static PyObject *py_xattr_DosAttrib_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1896 : {
1897 0 : struct xattr_DosAttrib *object = (struct xattr_DosAttrib *)pytalloc_get_ptr(py_obj);
1898 : PyObject *ret;
1899 : char *retstr;
1900 :
1901 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_xattr_DosAttrib, "xattr_DosAttrib", object);
1902 0 : ret = PyUnicode_FromString(retstr);
1903 0 : talloc_free(retstr);
1904 :
1905 0 : return ret;
1906 : }
1907 :
1908 : static PyMethodDef py_xattr_DosAttrib_methods[] = {
1909 : { "__ndr_pack__", (PyCFunction)py_xattr_DosAttrib_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1910 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_DosAttrib_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1911 : { "__ndr_print__", (PyCFunction)py_xattr_DosAttrib_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1912 : { NULL, NULL, 0, NULL }
1913 : };
1914 :
1915 :
1916 : static PyTypeObject xattr_DosAttrib_Type = {
1917 : PyVarObject_HEAD_INIT(NULL, 0)
1918 : .tp_name = "xattr.DosAttrib",
1919 : .tp_getset = py_xattr_DosAttrib_getsetters,
1920 : .tp_methods = py_xattr_DosAttrib_methods,
1921 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1922 : .tp_new = py_xattr_DosAttrib_new,
1923 : };
1924 :
1925 :
1926 0 : static PyObject *py_xattr_DOSATTRIB_get_attrib_hex(PyObject *obj, void *closure)
1927 : {
1928 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(obj);
1929 : PyObject *py_attrib_hex;
1930 0 : py_attrib_hex = PyString_FromStringOrNULL(object->attrib_hex);
1931 0 : return py_attrib_hex;
1932 : }
1933 :
1934 0 : static int py_xattr_DOSATTRIB_set_attrib_hex(PyObject *py_obj, PyObject *value, void *closure)
1935 : {
1936 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(py_obj);
1937 0 : if (value == NULL) {
1938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attrib_hex");
1939 0 : return -1;
1940 : }
1941 : {
1942 : const char *test_str;
1943 : const char *talloc_str;
1944 0 : PyObject *unicode = NULL;
1945 0 : if (PyUnicode_Check(value)) {
1946 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1947 0 : if (unicode == NULL) {
1948 0 : PyErr_NoMemory();
1949 0 : return -1;
1950 : }
1951 0 : test_str = PyBytes_AS_STRING(unicode);
1952 0 : } else if (PyBytes_Check(value)) {
1953 0 : test_str = PyBytes_AS_STRING(value);
1954 : } else {
1955 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1956 0 : return -1;
1957 : }
1958 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1959 0 : if (unicode != NULL) {
1960 0 : Py_DECREF(unicode);
1961 : }
1962 0 : if (talloc_str == NULL) {
1963 0 : PyErr_NoMemory();
1964 0 : return -1;
1965 : }
1966 0 : object->attrib_hex = talloc_str;
1967 : }
1968 0 : return 0;
1969 : }
1970 :
1971 0 : static PyObject *py_xattr_DOSATTRIB_get_version(PyObject *obj, void *closure)
1972 : {
1973 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(obj);
1974 : PyObject *py_version;
1975 0 : py_version = PyLong_FromLong((uint16_t)object->version);
1976 0 : return py_version;
1977 : }
1978 :
1979 0 : static int py_xattr_DOSATTRIB_set_version(PyObject *py_obj, PyObject *value, void *closure)
1980 : {
1981 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(py_obj);
1982 0 : if (value == NULL) {
1983 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
1984 0 : return -1;
1985 : }
1986 : {
1987 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
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->version = 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_xattr_DOSATTRIB_get_info(PyObject *obj, void *closure)
2010 : {
2011 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(obj);
2012 : PyObject *py_info;
2013 0 : py_info = pyrpc_import_union(&xattr_DosInfo_Type, pytalloc_get_mem_ctx(obj), object->version, &object->info, "union xattr_DosInfo");
2014 0 : if (py_info == NULL) {
2015 0 : return NULL;
2016 : }
2017 0 : return py_info;
2018 : }
2019 :
2020 0 : static int py_xattr_DOSATTRIB_set_info(PyObject *py_obj, PyObject *value, void *closure)
2021 : {
2022 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(py_obj);
2023 0 : if (value == NULL) {
2024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
2025 0 : return -1;
2026 : }
2027 : {
2028 : union xattr_DosInfo *info_switch_0;
2029 0 : info_switch_0 = (union xattr_DosInfo *)pyrpc_export_union(&xattr_DosInfo_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union xattr_DosInfo");
2030 0 : if (info_switch_0 == NULL) {
2031 0 : return -1;
2032 : }
2033 0 : object->info = *info_switch_0;
2034 : }
2035 0 : return 0;
2036 : }
2037 :
2038 : static PyGetSetDef py_xattr_DOSATTRIB_getsetters[] = {
2039 : {
2040 : .name = discard_const_p(char, "attrib_hex"),
2041 : .get = py_xattr_DOSATTRIB_get_attrib_hex,
2042 : .set = py_xattr_DOSATTRIB_set_attrib_hex,
2043 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2044 : },
2045 : {
2046 : .name = discard_const_p(char, "version"),
2047 : .get = py_xattr_DOSATTRIB_get_version,
2048 : .set = py_xattr_DOSATTRIB_set_version,
2049 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2050 : },
2051 : {
2052 : .name = discard_const_p(char, "info"),
2053 : .get = py_xattr_DOSATTRIB_get_info,
2054 : .set = py_xattr_DOSATTRIB_set_info,
2055 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_DosInfo")
2056 : },
2057 : { .name = NULL }
2058 : };
2059 :
2060 0 : static PyObject *py_xattr_DOSATTRIB_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2061 : {
2062 0 : return pytalloc_new(struct xattr_DOSATTRIB, type);
2063 : }
2064 :
2065 0 : static PyObject *py_xattr_DOSATTRIB_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2066 : {
2067 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(py_obj);
2068 0 : PyObject *ret = NULL;
2069 : DATA_BLOB blob;
2070 : enum ndr_err_code err;
2071 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2072 0 : if (tmp_ctx == NULL) {
2073 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2074 0 : return NULL;
2075 : }
2076 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_xattr_DOSATTRIB);
2077 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2078 0 : TALLOC_FREE(tmp_ctx);
2079 0 : PyErr_SetNdrError(err);
2080 0 : return NULL;
2081 : }
2082 :
2083 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2084 0 : TALLOC_FREE(tmp_ctx);
2085 0 : return ret;
2086 : }
2087 :
2088 0 : static PyObject *py_xattr_DOSATTRIB_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2089 : {
2090 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(py_obj);
2091 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2092 0 : Py_ssize_t blob_length = 0;
2093 : enum ndr_err_code err;
2094 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2095 0 : PyObject *allow_remaining_obj = NULL;
2096 0 : bool allow_remaining = false;
2097 :
2098 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2099 : discard_const_p(char *, kwnames),
2100 : &blob.data, &blob_length,
2101 : &allow_remaining_obj)) {
2102 0 : return NULL;
2103 : }
2104 0 : blob.length = blob_length;
2105 :
2106 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2107 0 : allow_remaining = true;
2108 : }
2109 :
2110 0 : if (allow_remaining) {
2111 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DOSATTRIB);
2112 : } else {
2113 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DOSATTRIB);
2114 : }
2115 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2116 0 : PyErr_SetNdrError(err);
2117 0 : return NULL;
2118 : }
2119 :
2120 0 : Py_RETURN_NONE;
2121 : }
2122 :
2123 0 : static PyObject *py_xattr_DOSATTRIB_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2124 : {
2125 0 : struct xattr_DOSATTRIB *object = (struct xattr_DOSATTRIB *)pytalloc_get_ptr(py_obj);
2126 : PyObject *ret;
2127 : char *retstr;
2128 :
2129 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_xattr_DOSATTRIB, "xattr_DOSATTRIB", object);
2130 0 : ret = PyUnicode_FromString(retstr);
2131 0 : talloc_free(retstr);
2132 :
2133 0 : return ret;
2134 : }
2135 :
2136 : static PyMethodDef py_xattr_DOSATTRIB_methods[] = {
2137 : { "__ndr_pack__", (PyCFunction)py_xattr_DOSATTRIB_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2138 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_DOSATTRIB_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2139 : { "__ndr_print__", (PyCFunction)py_xattr_DOSATTRIB_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2140 : { NULL, NULL, 0, NULL }
2141 : };
2142 :
2143 :
2144 : static PyTypeObject xattr_DOSATTRIB_Type = {
2145 : PyVarObject_HEAD_INIT(NULL, 0)
2146 : .tp_name = "xattr.DOSATTRIB",
2147 : .tp_getset = py_xattr_DOSATTRIB_getsetters,
2148 : .tp_methods = py_xattr_DOSATTRIB_methods,
2149 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2150 : .tp_new = py_xattr_DOSATTRIB_new,
2151 : };
2152 :
2153 :
2154 0 : static PyObject *py_xattr_EA_get_name(PyObject *obj, void *closure)
2155 : {
2156 0 : struct xattr_EA *object = (struct xattr_EA *)pytalloc_get_ptr(obj);
2157 : PyObject *py_name;
2158 0 : py_name = PyString_FromStringOrNULL(object->name);
2159 0 : return py_name;
2160 : }
2161 :
2162 0 : static int py_xattr_EA_set_name(PyObject *py_obj, PyObject *value, void *closure)
2163 : {
2164 0 : struct xattr_EA *object = (struct xattr_EA *)pytalloc_get_ptr(py_obj);
2165 0 : if (value == NULL) {
2166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
2167 0 : return -1;
2168 : }
2169 : {
2170 : const char *test_str;
2171 : const char *talloc_str;
2172 0 : PyObject *unicode = NULL;
2173 0 : if (PyUnicode_Check(value)) {
2174 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2175 0 : if (unicode == NULL) {
2176 0 : PyErr_NoMemory();
2177 0 : return -1;
2178 : }
2179 0 : test_str = PyBytes_AS_STRING(unicode);
2180 0 : } else if (PyBytes_Check(value)) {
2181 0 : test_str = PyBytes_AS_STRING(value);
2182 : } else {
2183 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2184 0 : return -1;
2185 : }
2186 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2187 0 : if (unicode != NULL) {
2188 0 : Py_DECREF(unicode);
2189 : }
2190 0 : if (talloc_str == NULL) {
2191 0 : PyErr_NoMemory();
2192 0 : return -1;
2193 : }
2194 0 : object->name = talloc_str;
2195 : }
2196 0 : return 0;
2197 : }
2198 :
2199 0 : static PyObject *py_xattr_EA_get_value(PyObject *obj, void *closure)
2200 : {
2201 0 : struct xattr_EA *object = (struct xattr_EA *)pytalloc_get_ptr(obj);
2202 : PyObject *py_value;
2203 0 : py_value = PyBytes_FromStringAndSize((char *)(object->value).data, (object->value).length);
2204 0 : return py_value;
2205 : }
2206 :
2207 0 : static int py_xattr_EA_set_value(PyObject *py_obj, PyObject *value, void *closure)
2208 : {
2209 0 : struct xattr_EA *object = (struct xattr_EA *)pytalloc_get_ptr(py_obj);
2210 0 : if (value == NULL) {
2211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->value");
2212 0 : return -1;
2213 : }
2214 0 : object->value = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2215 0 : return 0;
2216 : }
2217 :
2218 : static PyGetSetDef py_xattr_EA_getsetters[] = {
2219 : {
2220 : .name = discard_const_p(char, "name"),
2221 : .get = py_xattr_EA_get_name,
2222 : .set = py_xattr_EA_set_name,
2223 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2224 : },
2225 : {
2226 : .name = discard_const_p(char, "value"),
2227 : .get = py_xattr_EA_get_value,
2228 : .set = py_xattr_EA_set_value,
2229 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2230 : },
2231 : { .name = NULL }
2232 : };
2233 :
2234 0 : static PyObject *py_xattr_EA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2235 : {
2236 0 : return pytalloc_new(struct xattr_EA, type);
2237 : }
2238 :
2239 :
2240 : static PyTypeObject xattr_EA_Type = {
2241 : PyVarObject_HEAD_INIT(NULL, 0)
2242 : .tp_name = "xattr.EA",
2243 : .tp_getset = py_xattr_EA_getsetters,
2244 : .tp_methods = NULL,
2245 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2246 : .tp_new = py_xattr_EA_new,
2247 : };
2248 :
2249 :
2250 0 : static PyObject *py_xattr_DosEAs_get_num_eas(PyObject *obj, void *closure)
2251 : {
2252 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(obj);
2253 : PyObject *py_num_eas;
2254 0 : py_num_eas = PyLong_FromLong((uint16_t)object->num_eas);
2255 0 : return py_num_eas;
2256 : }
2257 :
2258 0 : static int py_xattr_DosEAs_set_num_eas(PyObject *py_obj, PyObject *value, void *closure)
2259 : {
2260 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(py_obj);
2261 0 : if (value == NULL) {
2262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_eas");
2263 0 : return -1;
2264 : }
2265 : {
2266 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_eas));
2267 0 : if (PyLong_Check(value)) {
2268 : unsigned long long test_var;
2269 0 : test_var = PyLong_AsUnsignedLongLong(value);
2270 0 : if (PyErr_Occurred() != NULL) {
2271 0 : return -1;
2272 : }
2273 0 : if (test_var > uint_max) {
2274 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2275 : PyLong_Type.tp_name, uint_max, test_var);
2276 0 : return -1;
2277 : }
2278 0 : object->num_eas = test_var;
2279 : } else {
2280 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2281 : PyLong_Type.tp_name);
2282 0 : return -1;
2283 : }
2284 : }
2285 0 : return 0;
2286 : }
2287 :
2288 0 : static PyObject *py_xattr_DosEAs_get_eas(PyObject *obj, void *closure)
2289 : {
2290 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(obj);
2291 : PyObject *py_eas;
2292 0 : if (object->eas == NULL) {
2293 0 : Py_RETURN_NONE;
2294 : }
2295 0 : if (object->eas == NULL) {
2296 0 : py_eas = Py_None;
2297 0 : Py_INCREF(py_eas);
2298 : } else {
2299 0 : py_eas = PyList_New(object->num_eas);
2300 0 : if (py_eas == NULL) {
2301 0 : return NULL;
2302 : }
2303 : {
2304 : int eas_cntr_1;
2305 0 : for (eas_cntr_1 = 0; eas_cntr_1 < (object->num_eas); eas_cntr_1++) {
2306 : PyObject *py_eas_1;
2307 0 : py_eas_1 = pytalloc_reference_ex(&xattr_EA_Type, object->eas, &object->eas[eas_cntr_1]);
2308 0 : PyList_SetItem(py_eas, eas_cntr_1, py_eas_1);
2309 : }
2310 : }
2311 : }
2312 0 : return py_eas;
2313 : }
2314 :
2315 0 : static int py_xattr_DosEAs_set_eas(PyObject *py_obj, PyObject *value, void *closure)
2316 : {
2317 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(py_obj);
2318 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->eas));
2319 0 : if (value == NULL) {
2320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eas");
2321 0 : return -1;
2322 : }
2323 0 : if (value == Py_None) {
2324 0 : object->eas = NULL;
2325 : } else {
2326 0 : object->eas = NULL;
2327 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2328 : {
2329 : int eas_cntr_1;
2330 0 : object->eas = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->eas, PyList_GET_SIZE(value));
2331 0 : if (!object->eas) { return -1;; }
2332 0 : talloc_set_name_const(object->eas, "ARRAY: object->eas");
2333 0 : for (eas_cntr_1 = 0; eas_cntr_1 < PyList_GET_SIZE(value); eas_cntr_1++) {
2334 0 : if (PyList_GET_ITEM(value, eas_cntr_1) == NULL) {
2335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eas[eas_cntr_1]");
2336 0 : return -1;
2337 : }
2338 0 : PY_CHECK_TYPE(&xattr_EA_Type, PyList_GET_ITEM(value, eas_cntr_1), return -1;);
2339 0 : if (talloc_reference(object->eas, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, eas_cntr_1))) == NULL) {
2340 0 : PyErr_NoMemory();
2341 0 : return -1;
2342 : }
2343 0 : object->eas[eas_cntr_1] = *(struct xattr_EA *)pytalloc_get_ptr(PyList_GET_ITEM(value, eas_cntr_1));
2344 : }
2345 : }
2346 : }
2347 0 : return 0;
2348 : }
2349 :
2350 : static PyGetSetDef py_xattr_DosEAs_getsetters[] = {
2351 : {
2352 : .name = discard_const_p(char, "num_eas"),
2353 : .get = py_xattr_DosEAs_get_num_eas,
2354 : .set = py_xattr_DosEAs_set_num_eas,
2355 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2356 : },
2357 : {
2358 : .name = discard_const_p(char, "eas"),
2359 : .get = py_xattr_DosEAs_get_eas,
2360 : .set = py_xattr_DosEAs_set_eas,
2361 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_EA")
2362 : },
2363 : { .name = NULL }
2364 : };
2365 :
2366 0 : static PyObject *py_xattr_DosEAs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2367 : {
2368 0 : return pytalloc_new(struct xattr_DosEAs, type);
2369 : }
2370 :
2371 0 : static PyObject *py_xattr_DosEAs_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2372 : {
2373 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(py_obj);
2374 0 : PyObject *ret = NULL;
2375 : DATA_BLOB blob;
2376 : enum ndr_err_code err;
2377 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2378 0 : if (tmp_ctx == NULL) {
2379 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2380 0 : return NULL;
2381 : }
2382 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_xattr_DosEAs);
2383 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2384 0 : TALLOC_FREE(tmp_ctx);
2385 0 : PyErr_SetNdrError(err);
2386 0 : return NULL;
2387 : }
2388 :
2389 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2390 0 : TALLOC_FREE(tmp_ctx);
2391 0 : return ret;
2392 : }
2393 :
2394 0 : static PyObject *py_xattr_DosEAs_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2395 : {
2396 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(py_obj);
2397 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2398 0 : Py_ssize_t blob_length = 0;
2399 : enum ndr_err_code err;
2400 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2401 0 : PyObject *allow_remaining_obj = NULL;
2402 0 : bool allow_remaining = false;
2403 :
2404 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2405 : discard_const_p(char *, kwnames),
2406 : &blob.data, &blob_length,
2407 : &allow_remaining_obj)) {
2408 0 : return NULL;
2409 : }
2410 0 : blob.length = blob_length;
2411 :
2412 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2413 0 : allow_remaining = true;
2414 : }
2415 :
2416 0 : if (allow_remaining) {
2417 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosEAs);
2418 : } else {
2419 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosEAs);
2420 : }
2421 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2422 0 : PyErr_SetNdrError(err);
2423 0 : return NULL;
2424 : }
2425 :
2426 0 : Py_RETURN_NONE;
2427 : }
2428 :
2429 0 : static PyObject *py_xattr_DosEAs_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2430 : {
2431 0 : struct xattr_DosEAs *object = (struct xattr_DosEAs *)pytalloc_get_ptr(py_obj);
2432 : PyObject *ret;
2433 : char *retstr;
2434 :
2435 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_xattr_DosEAs, "xattr_DosEAs", object);
2436 0 : ret = PyUnicode_FromString(retstr);
2437 0 : talloc_free(retstr);
2438 :
2439 0 : return ret;
2440 : }
2441 :
2442 : static PyMethodDef py_xattr_DosEAs_methods[] = {
2443 : { "__ndr_pack__", (PyCFunction)py_xattr_DosEAs_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2444 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_DosEAs_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2445 : { "__ndr_print__", (PyCFunction)py_xattr_DosEAs_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2446 : { NULL, NULL, 0, NULL }
2447 : };
2448 :
2449 :
2450 : static PyTypeObject xattr_DosEAs_Type = {
2451 : PyVarObject_HEAD_INIT(NULL, 0)
2452 : .tp_name = "xattr.DosEAs",
2453 : .tp_getset = py_xattr_DosEAs_getsetters,
2454 : .tp_methods = py_xattr_DosEAs_methods,
2455 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2456 : .tp_new = py_xattr_DosEAs_new,
2457 : };
2458 :
2459 :
2460 0 : static PyObject *py_tdb_xattrs_get_num_eas(PyObject *obj, void *closure)
2461 : {
2462 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(obj);
2463 : PyObject *py_num_eas;
2464 0 : py_num_eas = PyLong_FromUnsignedLongLong((uint32_t)object->num_eas);
2465 0 : return py_num_eas;
2466 : }
2467 :
2468 0 : static int py_tdb_xattrs_set_num_eas(PyObject *py_obj, PyObject *value, void *closure)
2469 : {
2470 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(py_obj);
2471 0 : if (value == NULL) {
2472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_eas");
2473 0 : return -1;
2474 : }
2475 : {
2476 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_eas));
2477 0 : if (PyLong_Check(value)) {
2478 : unsigned long long test_var;
2479 0 : test_var = PyLong_AsUnsignedLongLong(value);
2480 0 : if (PyErr_Occurred() != NULL) {
2481 0 : return -1;
2482 : }
2483 0 : if (test_var > uint_max) {
2484 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2485 : PyLong_Type.tp_name, uint_max, test_var);
2486 0 : return -1;
2487 : }
2488 0 : object->num_eas = test_var;
2489 : } else {
2490 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2491 : PyLong_Type.tp_name);
2492 0 : return -1;
2493 : }
2494 : }
2495 0 : return 0;
2496 : }
2497 :
2498 0 : static PyObject *py_tdb_xattrs_get_eas(PyObject *obj, void *closure)
2499 : {
2500 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(obj);
2501 : PyObject *py_eas;
2502 0 : py_eas = PyList_New(object->num_eas);
2503 0 : if (py_eas == NULL) {
2504 0 : return NULL;
2505 : }
2506 : {
2507 : int eas_cntr_0;
2508 0 : for (eas_cntr_0 = 0; eas_cntr_0 < (object->num_eas); eas_cntr_0++) {
2509 : PyObject *py_eas_0;
2510 0 : py_eas_0 = pytalloc_reference_ex(&xattr_EA_Type, object->eas, &object->eas[eas_cntr_0]);
2511 0 : PyList_SetItem(py_eas, eas_cntr_0, py_eas_0);
2512 : }
2513 : }
2514 0 : return py_eas;
2515 : }
2516 :
2517 0 : static int py_tdb_xattrs_set_eas(PyObject *py_obj, PyObject *value, void *closure)
2518 : {
2519 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(py_obj);
2520 0 : if (value == NULL) {
2521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eas");
2522 0 : return -1;
2523 : }
2524 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2525 : {
2526 : int eas_cntr_0;
2527 0 : object->eas = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->eas, PyList_GET_SIZE(value));
2528 0 : if (!object->eas) { return -1;; }
2529 0 : talloc_set_name_const(object->eas, "ARRAY: object->eas");
2530 0 : for (eas_cntr_0 = 0; eas_cntr_0 < PyList_GET_SIZE(value); eas_cntr_0++) {
2531 0 : if (PyList_GET_ITEM(value, eas_cntr_0) == NULL) {
2532 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eas[eas_cntr_0]");
2533 0 : return -1;
2534 : }
2535 0 : PY_CHECK_TYPE(&xattr_EA_Type, PyList_GET_ITEM(value, eas_cntr_0), return -1;);
2536 0 : if (talloc_reference(object->eas, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, eas_cntr_0))) == NULL) {
2537 0 : PyErr_NoMemory();
2538 0 : return -1;
2539 : }
2540 0 : object->eas[eas_cntr_0] = *(struct xattr_EA *)pytalloc_get_ptr(PyList_GET_ITEM(value, eas_cntr_0));
2541 : }
2542 : }
2543 0 : return 0;
2544 : }
2545 :
2546 : static PyGetSetDef py_tdb_xattrs_getsetters[] = {
2547 : {
2548 : .name = discard_const_p(char, "num_eas"),
2549 : .get = py_tdb_xattrs_get_num_eas,
2550 : .set = py_tdb_xattrs_set_num_eas,
2551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2552 : },
2553 : {
2554 : .name = discard_const_p(char, "eas"),
2555 : .get = py_tdb_xattrs_get_eas,
2556 : .set = py_tdb_xattrs_set_eas,
2557 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_EA")
2558 : },
2559 : { .name = NULL }
2560 : };
2561 :
2562 0 : static PyObject *py_tdb_xattrs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2563 : {
2564 0 : return pytalloc_new(struct tdb_xattrs, type);
2565 : }
2566 :
2567 0 : static PyObject *py_tdb_xattrs_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2568 : {
2569 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(py_obj);
2570 0 : PyObject *ret = NULL;
2571 : DATA_BLOB blob;
2572 : enum ndr_err_code err;
2573 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2574 0 : if (tmp_ctx == NULL) {
2575 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2576 0 : return NULL;
2577 : }
2578 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_tdb_xattrs);
2579 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2580 0 : TALLOC_FREE(tmp_ctx);
2581 0 : PyErr_SetNdrError(err);
2582 0 : return NULL;
2583 : }
2584 :
2585 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2586 0 : TALLOC_FREE(tmp_ctx);
2587 0 : return ret;
2588 : }
2589 :
2590 0 : static PyObject *py_tdb_xattrs_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2591 : {
2592 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(py_obj);
2593 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2594 0 : Py_ssize_t blob_length = 0;
2595 : enum ndr_err_code err;
2596 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2597 0 : PyObject *allow_remaining_obj = NULL;
2598 0 : bool allow_remaining = false;
2599 :
2600 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2601 : discard_const_p(char *, kwnames),
2602 : &blob.data, &blob_length,
2603 : &allow_remaining_obj)) {
2604 0 : return NULL;
2605 : }
2606 0 : blob.length = blob_length;
2607 :
2608 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2609 0 : allow_remaining = true;
2610 : }
2611 :
2612 0 : if (allow_remaining) {
2613 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_tdb_xattrs);
2614 : } else {
2615 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_tdb_xattrs);
2616 : }
2617 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2618 0 : PyErr_SetNdrError(err);
2619 0 : return NULL;
2620 : }
2621 :
2622 0 : Py_RETURN_NONE;
2623 : }
2624 :
2625 0 : static PyObject *py_tdb_xattrs_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2626 : {
2627 0 : struct tdb_xattrs *object = (struct tdb_xattrs *)pytalloc_get_ptr(py_obj);
2628 : PyObject *ret;
2629 : char *retstr;
2630 :
2631 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_tdb_xattrs, "tdb_xattrs", object);
2632 0 : ret = PyUnicode_FromString(retstr);
2633 0 : talloc_free(retstr);
2634 :
2635 0 : return ret;
2636 : }
2637 :
2638 : static PyMethodDef py_tdb_xattrs_methods[] = {
2639 : { "__ndr_pack__", (PyCFunction)py_tdb_xattrs_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2640 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_tdb_xattrs_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2641 : { "__ndr_print__", (PyCFunction)py_tdb_xattrs_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2642 : { NULL, NULL, 0, NULL }
2643 : };
2644 :
2645 :
2646 : static PyTypeObject tdb_xattrs_Type = {
2647 : PyVarObject_HEAD_INIT(NULL, 0)
2648 : .tp_name = "xattr.tdb_xattrs",
2649 : .tp_getset = py_tdb_xattrs_getsetters,
2650 : .tp_methods = py_tdb_xattrs_methods,
2651 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2652 : .tp_new = py_tdb_xattrs_new,
2653 : };
2654 :
2655 :
2656 0 : static PyObject *py_xattr_DosStream_get_flags(PyObject *obj, void *closure)
2657 : {
2658 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(obj);
2659 : PyObject *py_flags;
2660 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
2661 0 : return py_flags;
2662 : }
2663 :
2664 0 : static int py_xattr_DosStream_set_flags(PyObject *py_obj, PyObject *value, void *closure)
2665 : {
2666 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(py_obj);
2667 0 : if (value == NULL) {
2668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
2669 0 : return -1;
2670 : }
2671 : {
2672 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
2673 0 : if (PyLong_Check(value)) {
2674 : unsigned long long test_var;
2675 0 : test_var = PyLong_AsUnsignedLongLong(value);
2676 0 : if (PyErr_Occurred() != NULL) {
2677 0 : return -1;
2678 : }
2679 0 : if (test_var > uint_max) {
2680 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2681 : PyLong_Type.tp_name, uint_max, test_var);
2682 0 : return -1;
2683 : }
2684 0 : object->flags = test_var;
2685 : } else {
2686 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2687 : PyLong_Type.tp_name);
2688 0 : return -1;
2689 : }
2690 : }
2691 0 : return 0;
2692 : }
2693 :
2694 0 : static PyObject *py_xattr_DosStream_get_size(PyObject *obj, void *closure)
2695 : {
2696 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(obj);
2697 : PyObject *py_size;
2698 0 : py_size = PyLong_FromUnsignedLongLong(object->size);
2699 0 : return py_size;
2700 : }
2701 :
2702 0 : static int py_xattr_DosStream_set_size(PyObject *py_obj, PyObject *value, void *closure)
2703 : {
2704 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(py_obj);
2705 0 : if (value == NULL) {
2706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
2707 0 : return -1;
2708 : }
2709 : {
2710 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
2711 0 : if (PyLong_Check(value)) {
2712 : unsigned long long test_var;
2713 0 : test_var = PyLong_AsUnsignedLongLong(value);
2714 0 : if (PyErr_Occurred() != NULL) {
2715 0 : return -1;
2716 : }
2717 0 : if (test_var > uint_max) {
2718 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2719 : PyLong_Type.tp_name, uint_max, test_var);
2720 0 : return -1;
2721 : }
2722 0 : object->size = test_var;
2723 : } else {
2724 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2725 : PyLong_Type.tp_name);
2726 0 : return -1;
2727 : }
2728 : }
2729 0 : return 0;
2730 : }
2731 :
2732 0 : static PyObject *py_xattr_DosStream_get_alloc_size(PyObject *obj, void *closure)
2733 : {
2734 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(obj);
2735 : PyObject *py_alloc_size;
2736 0 : py_alloc_size = PyLong_FromUnsignedLongLong(object->alloc_size);
2737 0 : return py_alloc_size;
2738 : }
2739 :
2740 0 : static int py_xattr_DosStream_set_alloc_size(PyObject *py_obj, PyObject *value, void *closure)
2741 : {
2742 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(py_obj);
2743 0 : if (value == NULL) {
2744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->alloc_size");
2745 0 : return -1;
2746 : }
2747 : {
2748 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_size));
2749 0 : if (PyLong_Check(value)) {
2750 : unsigned long long test_var;
2751 0 : test_var = PyLong_AsUnsignedLongLong(value);
2752 0 : if (PyErr_Occurred() != NULL) {
2753 0 : return -1;
2754 : }
2755 0 : if (test_var > uint_max) {
2756 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2757 : PyLong_Type.tp_name, uint_max, test_var);
2758 0 : return -1;
2759 : }
2760 0 : object->alloc_size = test_var;
2761 : } else {
2762 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2763 : PyLong_Type.tp_name);
2764 0 : return -1;
2765 : }
2766 : }
2767 0 : return 0;
2768 : }
2769 :
2770 0 : static PyObject *py_xattr_DosStream_get_name(PyObject *obj, void *closure)
2771 : {
2772 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(obj);
2773 : PyObject *py_name;
2774 0 : py_name = PyString_FromStringOrNULL(object->name);
2775 0 : return py_name;
2776 : }
2777 :
2778 0 : static int py_xattr_DosStream_set_name(PyObject *py_obj, PyObject *value, void *closure)
2779 : {
2780 0 : struct xattr_DosStream *object = (struct xattr_DosStream *)pytalloc_get_ptr(py_obj);
2781 0 : if (value == NULL) {
2782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
2783 0 : return -1;
2784 : }
2785 : {
2786 : const char *test_str;
2787 : const char *talloc_str;
2788 0 : PyObject *unicode = NULL;
2789 0 : if (PyUnicode_Check(value)) {
2790 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2791 0 : if (unicode == NULL) {
2792 0 : PyErr_NoMemory();
2793 0 : return -1;
2794 : }
2795 0 : test_str = PyBytes_AS_STRING(unicode);
2796 0 : } else if (PyBytes_Check(value)) {
2797 0 : test_str = PyBytes_AS_STRING(value);
2798 : } else {
2799 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2800 0 : return -1;
2801 : }
2802 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2803 0 : if (unicode != NULL) {
2804 0 : Py_DECREF(unicode);
2805 : }
2806 0 : if (talloc_str == NULL) {
2807 0 : PyErr_NoMemory();
2808 0 : return -1;
2809 : }
2810 0 : object->name = talloc_str;
2811 : }
2812 0 : return 0;
2813 : }
2814 :
2815 : static PyGetSetDef py_xattr_DosStream_getsetters[] = {
2816 : {
2817 : .name = discard_const_p(char, "flags"),
2818 : .get = py_xattr_DosStream_get_flags,
2819 : .set = py_xattr_DosStream_set_flags,
2820 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2821 : },
2822 : {
2823 : .name = discard_const_p(char, "size"),
2824 : .get = py_xattr_DosStream_get_size,
2825 : .set = py_xattr_DosStream_set_size,
2826 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
2827 : },
2828 : {
2829 : .name = discard_const_p(char, "alloc_size"),
2830 : .get = py_xattr_DosStream_get_alloc_size,
2831 : .set = py_xattr_DosStream_set_alloc_size,
2832 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
2833 : },
2834 : {
2835 : .name = discard_const_p(char, "name"),
2836 : .get = py_xattr_DosStream_get_name,
2837 : .set = py_xattr_DosStream_set_name,
2838 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2839 : },
2840 : { .name = NULL }
2841 : };
2842 :
2843 0 : static PyObject *py_xattr_DosStream_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2844 : {
2845 0 : return pytalloc_new(struct xattr_DosStream, type);
2846 : }
2847 :
2848 :
2849 : static PyTypeObject xattr_DosStream_Type = {
2850 : PyVarObject_HEAD_INIT(NULL, 0)
2851 : .tp_name = "xattr.DosStream",
2852 : .tp_getset = py_xattr_DosStream_getsetters,
2853 : .tp_methods = NULL,
2854 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2855 : .tp_new = py_xattr_DosStream_new,
2856 : };
2857 :
2858 :
2859 0 : static PyObject *py_xattr_DosStreams_get_num_streams(PyObject *obj, void *closure)
2860 : {
2861 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(obj);
2862 : PyObject *py_num_streams;
2863 0 : py_num_streams = PyLong_FromUnsignedLongLong((uint32_t)object->num_streams);
2864 0 : return py_num_streams;
2865 : }
2866 :
2867 0 : static int py_xattr_DosStreams_set_num_streams(PyObject *py_obj, PyObject *value, void *closure)
2868 : {
2869 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(py_obj);
2870 0 : if (value == NULL) {
2871 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_streams");
2872 0 : return -1;
2873 : }
2874 : {
2875 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_streams));
2876 0 : if (PyLong_Check(value)) {
2877 : unsigned long long test_var;
2878 0 : test_var = PyLong_AsUnsignedLongLong(value);
2879 0 : if (PyErr_Occurred() != NULL) {
2880 0 : return -1;
2881 : }
2882 0 : if (test_var > uint_max) {
2883 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2884 : PyLong_Type.tp_name, uint_max, test_var);
2885 0 : return -1;
2886 : }
2887 0 : object->num_streams = test_var;
2888 : } else {
2889 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2890 : PyLong_Type.tp_name);
2891 0 : return -1;
2892 : }
2893 : }
2894 0 : return 0;
2895 : }
2896 :
2897 0 : static PyObject *py_xattr_DosStreams_get_streams(PyObject *obj, void *closure)
2898 : {
2899 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(obj);
2900 : PyObject *py_streams;
2901 0 : if (object->streams == NULL) {
2902 0 : Py_RETURN_NONE;
2903 : }
2904 0 : if (object->streams == NULL) {
2905 0 : py_streams = Py_None;
2906 0 : Py_INCREF(py_streams);
2907 : } else {
2908 0 : py_streams = PyList_New(object->num_streams);
2909 0 : if (py_streams == NULL) {
2910 0 : return NULL;
2911 : }
2912 : {
2913 : int streams_cntr_1;
2914 0 : for (streams_cntr_1 = 0; streams_cntr_1 < (object->num_streams); streams_cntr_1++) {
2915 : PyObject *py_streams_1;
2916 0 : py_streams_1 = pytalloc_reference_ex(&xattr_DosStream_Type, object->streams, &object->streams[streams_cntr_1]);
2917 0 : PyList_SetItem(py_streams, streams_cntr_1, py_streams_1);
2918 : }
2919 : }
2920 : }
2921 0 : return py_streams;
2922 : }
2923 :
2924 0 : static int py_xattr_DosStreams_set_streams(PyObject *py_obj, PyObject *value, void *closure)
2925 : {
2926 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(py_obj);
2927 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->streams));
2928 0 : if (value == NULL) {
2929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->streams");
2930 0 : return -1;
2931 : }
2932 0 : if (value == Py_None) {
2933 0 : object->streams = NULL;
2934 : } else {
2935 0 : object->streams = NULL;
2936 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2937 : {
2938 : int streams_cntr_1;
2939 0 : object->streams = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->streams, PyList_GET_SIZE(value));
2940 0 : if (!object->streams) { return -1;; }
2941 0 : talloc_set_name_const(object->streams, "ARRAY: object->streams");
2942 0 : for (streams_cntr_1 = 0; streams_cntr_1 < PyList_GET_SIZE(value); streams_cntr_1++) {
2943 0 : if (PyList_GET_ITEM(value, streams_cntr_1) == NULL) {
2944 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->streams[streams_cntr_1]");
2945 0 : return -1;
2946 : }
2947 0 : PY_CHECK_TYPE(&xattr_DosStream_Type, PyList_GET_ITEM(value, streams_cntr_1), return -1;);
2948 0 : if (talloc_reference(object->streams, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, streams_cntr_1))) == NULL) {
2949 0 : PyErr_NoMemory();
2950 0 : return -1;
2951 : }
2952 0 : object->streams[streams_cntr_1] = *(struct xattr_DosStream *)pytalloc_get_ptr(PyList_GET_ITEM(value, streams_cntr_1));
2953 : }
2954 : }
2955 : }
2956 0 : return 0;
2957 : }
2958 :
2959 : static PyGetSetDef py_xattr_DosStreams_getsetters[] = {
2960 : {
2961 : .name = discard_const_p(char, "num_streams"),
2962 : .get = py_xattr_DosStreams_get_num_streams,
2963 : .set = py_xattr_DosStreams_set_num_streams,
2964 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2965 : },
2966 : {
2967 : .name = discard_const_p(char, "streams"),
2968 : .get = py_xattr_DosStreams_get_streams,
2969 : .set = py_xattr_DosStreams_set_streams,
2970 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_DosStream")
2971 : },
2972 : { .name = NULL }
2973 : };
2974 :
2975 0 : static PyObject *py_xattr_DosStreams_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2976 : {
2977 0 : return pytalloc_new(struct xattr_DosStreams, type);
2978 : }
2979 :
2980 0 : static PyObject *py_xattr_DosStreams_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2981 : {
2982 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(py_obj);
2983 0 : PyObject *ret = NULL;
2984 : DATA_BLOB blob;
2985 : enum ndr_err_code err;
2986 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2987 0 : if (tmp_ctx == NULL) {
2988 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2989 0 : return NULL;
2990 : }
2991 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_xattr_DosStreams);
2992 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2993 0 : TALLOC_FREE(tmp_ctx);
2994 0 : PyErr_SetNdrError(err);
2995 0 : return NULL;
2996 : }
2997 :
2998 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2999 0 : TALLOC_FREE(tmp_ctx);
3000 0 : return ret;
3001 : }
3002 :
3003 0 : static PyObject *py_xattr_DosStreams_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3004 : {
3005 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(py_obj);
3006 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3007 0 : Py_ssize_t blob_length = 0;
3008 : enum ndr_err_code err;
3009 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3010 0 : PyObject *allow_remaining_obj = NULL;
3011 0 : bool allow_remaining = false;
3012 :
3013 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3014 : discard_const_p(char *, kwnames),
3015 : &blob.data, &blob_length,
3016 : &allow_remaining_obj)) {
3017 0 : return NULL;
3018 : }
3019 0 : blob.length = blob_length;
3020 :
3021 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3022 0 : allow_remaining = true;
3023 : }
3024 :
3025 0 : if (allow_remaining) {
3026 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosStreams);
3027 : } else {
3028 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_DosStreams);
3029 : }
3030 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3031 0 : PyErr_SetNdrError(err);
3032 0 : return NULL;
3033 : }
3034 :
3035 0 : Py_RETURN_NONE;
3036 : }
3037 :
3038 0 : static PyObject *py_xattr_DosStreams_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3039 : {
3040 0 : struct xattr_DosStreams *object = (struct xattr_DosStreams *)pytalloc_get_ptr(py_obj);
3041 : PyObject *ret;
3042 : char *retstr;
3043 :
3044 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_xattr_DosStreams, "xattr_DosStreams", object);
3045 0 : ret = PyUnicode_FromString(retstr);
3046 0 : talloc_free(retstr);
3047 :
3048 0 : return ret;
3049 : }
3050 :
3051 : static PyMethodDef py_xattr_DosStreams_methods[] = {
3052 : { "__ndr_pack__", (PyCFunction)py_xattr_DosStreams_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3053 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_DosStreams_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3054 : { "__ndr_print__", (PyCFunction)py_xattr_DosStreams_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3055 : { NULL, NULL, 0, NULL }
3056 : };
3057 :
3058 :
3059 : static PyTypeObject xattr_DosStreams_Type = {
3060 : PyVarObject_HEAD_INIT(NULL, 0)
3061 : .tp_name = "xattr.DosStreams",
3062 : .tp_getset = py_xattr_DosStreams_getsetters,
3063 : .tp_methods = py_xattr_DosStreams_methods,
3064 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3065 : .tp_new = py_xattr_DosStreams_new,
3066 : };
3067 :
3068 :
3069 0 : static PyObject *py_security_descriptor_hash_v2_get_sd(PyObject *obj, void *closure)
3070 : {
3071 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(obj);
3072 : PyObject *py_sd;
3073 0 : if (object->sd == NULL) {
3074 0 : Py_RETURN_NONE;
3075 : }
3076 0 : if (object->sd == NULL) {
3077 0 : py_sd = Py_None;
3078 0 : Py_INCREF(py_sd);
3079 : } else {
3080 0 : py_sd = pytalloc_reference_ex(security_descriptor_Type, object->sd, object->sd);
3081 : }
3082 0 : return py_sd;
3083 : }
3084 :
3085 0 : static int py_security_descriptor_hash_v2_set_sd(PyObject *py_obj, PyObject *value, void *closure)
3086 : {
3087 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(py_obj);
3088 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sd));
3089 0 : if (value == NULL) {
3090 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd");
3091 0 : return -1;
3092 : }
3093 0 : if (value == Py_None) {
3094 0 : object->sd = NULL;
3095 : } else {
3096 0 : object->sd = NULL;
3097 0 : PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
3098 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3099 0 : PyErr_NoMemory();
3100 0 : return -1;
3101 : }
3102 0 : object->sd = (struct security_descriptor *)pytalloc_get_ptr(value);
3103 : }
3104 0 : return 0;
3105 : }
3106 :
3107 0 : static PyObject *py_security_descriptor_hash_v2_get_hash(PyObject *obj, void *closure)
3108 : {
3109 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(obj);
3110 : PyObject *py_hash;
3111 0 : py_hash = PyList_New(16);
3112 0 : if (py_hash == NULL) {
3113 0 : return NULL;
3114 : }
3115 : {
3116 : int hash_cntr_0;
3117 0 : for (hash_cntr_0 = 0; hash_cntr_0 < (16); hash_cntr_0++) {
3118 : PyObject *py_hash_0;
3119 0 : py_hash_0 = PyLong_FromLong((uint16_t)object->hash[hash_cntr_0]);
3120 0 : PyList_SetItem(py_hash, hash_cntr_0, py_hash_0);
3121 : }
3122 : }
3123 0 : return py_hash;
3124 : }
3125 :
3126 0 : static int py_security_descriptor_hash_v2_set_hash(PyObject *py_obj, PyObject *value, void *closure)
3127 : {
3128 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(py_obj);
3129 0 : if (value == NULL) {
3130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
3131 0 : return -1;
3132 : }
3133 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3134 : {
3135 : int hash_cntr_0;
3136 0 : if (ARRAY_SIZE(object->hash) != PyList_GET_SIZE(value)) {
3137 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->hash), PyList_GET_SIZE(value));
3138 0 : return -1;
3139 : }
3140 0 : for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) {
3141 0 : if (PyList_GET_ITEM(value, hash_cntr_0) == NULL) {
3142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash[hash_cntr_0]");
3143 0 : return -1;
3144 : }
3145 : {
3146 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash[hash_cntr_0]));
3147 0 : if (PyLong_Check(PyList_GET_ITEM(value, hash_cntr_0))) {
3148 : unsigned long long test_var;
3149 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, hash_cntr_0));
3150 0 : if (PyErr_Occurred() != NULL) {
3151 0 : return -1;
3152 : }
3153 0 : if (test_var > uint_max) {
3154 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3155 : PyLong_Type.tp_name, uint_max, test_var);
3156 0 : return -1;
3157 : }
3158 0 : object->hash[hash_cntr_0] = test_var;
3159 : } else {
3160 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3161 : PyLong_Type.tp_name);
3162 0 : return -1;
3163 : }
3164 : }
3165 : }
3166 : }
3167 0 : return 0;
3168 : }
3169 :
3170 : static PyGetSetDef py_security_descriptor_hash_v2_getsetters[] = {
3171 : {
3172 : .name = discard_const_p(char, "sd"),
3173 : .get = py_security_descriptor_hash_v2_get_sd,
3174 : .set = py_security_descriptor_hash_v2_set_sd,
3175 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
3176 : },
3177 : {
3178 : .name = discard_const_p(char, "hash"),
3179 : .get = py_security_descriptor_hash_v2_get_hash,
3180 : .set = py_security_descriptor_hash_v2_set_hash,
3181 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3182 : },
3183 : { .name = NULL }
3184 : };
3185 :
3186 0 : static PyObject *py_security_descriptor_hash_v2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3187 : {
3188 0 : return pytalloc_new(struct security_descriptor_hash_v2, type);
3189 : }
3190 :
3191 0 : static PyObject *py_security_descriptor_hash_v2_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3192 : {
3193 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(py_obj);
3194 0 : PyObject *ret = NULL;
3195 : DATA_BLOB blob;
3196 : enum ndr_err_code err;
3197 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3198 0 : if (tmp_ctx == NULL) {
3199 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3200 0 : return NULL;
3201 : }
3202 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_descriptor_hash_v2);
3203 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3204 0 : TALLOC_FREE(tmp_ctx);
3205 0 : PyErr_SetNdrError(err);
3206 0 : return NULL;
3207 : }
3208 :
3209 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3210 0 : TALLOC_FREE(tmp_ctx);
3211 0 : return ret;
3212 : }
3213 :
3214 0 : static PyObject *py_security_descriptor_hash_v2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3215 : {
3216 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(py_obj);
3217 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3218 0 : Py_ssize_t blob_length = 0;
3219 : enum ndr_err_code err;
3220 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3221 0 : PyObject *allow_remaining_obj = NULL;
3222 0 : bool allow_remaining = false;
3223 :
3224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3225 : discard_const_p(char *, kwnames),
3226 : &blob.data, &blob_length,
3227 : &allow_remaining_obj)) {
3228 0 : return NULL;
3229 : }
3230 0 : blob.length = blob_length;
3231 :
3232 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3233 0 : allow_remaining = true;
3234 : }
3235 :
3236 0 : if (allow_remaining) {
3237 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor_hash_v2);
3238 : } else {
3239 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor_hash_v2);
3240 : }
3241 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3242 0 : PyErr_SetNdrError(err);
3243 0 : return NULL;
3244 : }
3245 :
3246 0 : Py_RETURN_NONE;
3247 : }
3248 :
3249 0 : static PyObject *py_security_descriptor_hash_v2_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3250 : {
3251 0 : struct security_descriptor_hash_v2 *object = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(py_obj);
3252 : PyObject *ret;
3253 : char *retstr;
3254 :
3255 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_descriptor_hash_v2, "security_descriptor_hash_v2", object);
3256 0 : ret = PyUnicode_FromString(retstr);
3257 0 : talloc_free(retstr);
3258 :
3259 0 : return ret;
3260 : }
3261 :
3262 : static PyMethodDef py_security_descriptor_hash_v2_methods[] = {
3263 : { "__ndr_pack__", (PyCFunction)py_security_descriptor_hash_v2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3264 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_descriptor_hash_v2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3265 : { "__ndr_print__", (PyCFunction)py_security_descriptor_hash_v2_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3266 : { NULL, NULL, 0, NULL }
3267 : };
3268 :
3269 :
3270 : static PyTypeObject security_descriptor_hash_v2_Type = {
3271 : PyVarObject_HEAD_INIT(NULL, 0)
3272 : .tp_name = "xattr.security_descriptor_hash_v2",
3273 : .tp_getset = py_security_descriptor_hash_v2_getsetters,
3274 : .tp_methods = py_security_descriptor_hash_v2_methods,
3275 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3276 : .tp_new = py_security_descriptor_hash_v2_new,
3277 : };
3278 :
3279 :
3280 0 : static PyObject *py_security_descriptor_hash_v3_get_sd(PyObject *obj, void *closure)
3281 : {
3282 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(obj);
3283 : PyObject *py_sd;
3284 0 : if (object->sd == NULL) {
3285 0 : Py_RETURN_NONE;
3286 : }
3287 0 : if (object->sd == NULL) {
3288 0 : py_sd = Py_None;
3289 0 : Py_INCREF(py_sd);
3290 : } else {
3291 0 : py_sd = pytalloc_reference_ex(security_descriptor_Type, object->sd, object->sd);
3292 : }
3293 0 : return py_sd;
3294 : }
3295 :
3296 0 : static int py_security_descriptor_hash_v3_set_sd(PyObject *py_obj, PyObject *value, void *closure)
3297 : {
3298 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(py_obj);
3299 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sd));
3300 0 : if (value == NULL) {
3301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd");
3302 0 : return -1;
3303 : }
3304 0 : if (value == Py_None) {
3305 0 : object->sd = NULL;
3306 : } else {
3307 0 : object->sd = NULL;
3308 0 : PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
3309 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3310 0 : PyErr_NoMemory();
3311 0 : return -1;
3312 : }
3313 0 : object->sd = (struct security_descriptor *)pytalloc_get_ptr(value);
3314 : }
3315 0 : return 0;
3316 : }
3317 :
3318 0 : static PyObject *py_security_descriptor_hash_v3_get_hash_type(PyObject *obj, void *closure)
3319 : {
3320 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(obj);
3321 : PyObject *py_hash_type;
3322 0 : py_hash_type = PyLong_FromLong((uint16_t)object->hash_type);
3323 0 : return py_hash_type;
3324 : }
3325 :
3326 0 : static int py_security_descriptor_hash_v3_set_hash_type(PyObject *py_obj, PyObject *value, void *closure)
3327 : {
3328 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(py_obj);
3329 0 : if (value == NULL) {
3330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash_type");
3331 0 : return -1;
3332 : }
3333 : {
3334 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash_type));
3335 0 : if (PyLong_Check(value)) {
3336 : unsigned long long test_var;
3337 0 : test_var = PyLong_AsUnsignedLongLong(value);
3338 0 : if (PyErr_Occurred() != NULL) {
3339 0 : return -1;
3340 : }
3341 0 : if (test_var > uint_max) {
3342 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3343 : PyLong_Type.tp_name, uint_max, test_var);
3344 0 : return -1;
3345 : }
3346 0 : object->hash_type = test_var;
3347 : } else {
3348 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3349 : PyLong_Type.tp_name);
3350 0 : return -1;
3351 : }
3352 : }
3353 0 : return 0;
3354 : }
3355 :
3356 0 : static PyObject *py_security_descriptor_hash_v3_get_hash(PyObject *obj, void *closure)
3357 : {
3358 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(obj);
3359 : PyObject *py_hash;
3360 0 : py_hash = PyList_New(64);
3361 0 : if (py_hash == NULL) {
3362 0 : return NULL;
3363 : }
3364 : {
3365 : int hash_cntr_0;
3366 0 : for (hash_cntr_0 = 0; hash_cntr_0 < (64); hash_cntr_0++) {
3367 : PyObject *py_hash_0;
3368 0 : py_hash_0 = PyLong_FromLong((uint16_t)object->hash[hash_cntr_0]);
3369 0 : PyList_SetItem(py_hash, hash_cntr_0, py_hash_0);
3370 : }
3371 : }
3372 0 : return py_hash;
3373 : }
3374 :
3375 0 : static int py_security_descriptor_hash_v3_set_hash(PyObject *py_obj, PyObject *value, void *closure)
3376 : {
3377 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(py_obj);
3378 0 : if (value == NULL) {
3379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
3380 0 : return -1;
3381 : }
3382 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3383 : {
3384 : int hash_cntr_0;
3385 0 : if (ARRAY_SIZE(object->hash) != PyList_GET_SIZE(value)) {
3386 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->hash), PyList_GET_SIZE(value));
3387 0 : return -1;
3388 : }
3389 0 : for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) {
3390 0 : if (PyList_GET_ITEM(value, hash_cntr_0) == NULL) {
3391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash[hash_cntr_0]");
3392 0 : return -1;
3393 : }
3394 : {
3395 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash[hash_cntr_0]));
3396 0 : if (PyLong_Check(PyList_GET_ITEM(value, hash_cntr_0))) {
3397 : unsigned long long test_var;
3398 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, hash_cntr_0));
3399 0 : if (PyErr_Occurred() != NULL) {
3400 0 : return -1;
3401 : }
3402 0 : if (test_var > uint_max) {
3403 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3404 : PyLong_Type.tp_name, uint_max, test_var);
3405 0 : return -1;
3406 : }
3407 0 : object->hash[hash_cntr_0] = test_var;
3408 : } else {
3409 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3410 : PyLong_Type.tp_name);
3411 0 : return -1;
3412 : }
3413 : }
3414 : }
3415 : }
3416 0 : return 0;
3417 : }
3418 :
3419 : static PyGetSetDef py_security_descriptor_hash_v3_getsetters[] = {
3420 : {
3421 : .name = discard_const_p(char, "sd"),
3422 : .get = py_security_descriptor_hash_v3_get_sd,
3423 : .set = py_security_descriptor_hash_v3_set_sd,
3424 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
3425 : },
3426 : {
3427 : .name = discard_const_p(char, "hash_type"),
3428 : .get = py_security_descriptor_hash_v3_get_hash_type,
3429 : .set = py_security_descriptor_hash_v3_set_hash_type,
3430 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3431 : },
3432 : {
3433 : .name = discard_const_p(char, "hash"),
3434 : .get = py_security_descriptor_hash_v3_get_hash,
3435 : .set = py_security_descriptor_hash_v3_set_hash,
3436 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3437 : },
3438 : { .name = NULL }
3439 : };
3440 :
3441 0 : static PyObject *py_security_descriptor_hash_v3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3442 : {
3443 0 : return pytalloc_new(struct security_descriptor_hash_v3, type);
3444 : }
3445 :
3446 0 : static PyObject *py_security_descriptor_hash_v3_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3447 : {
3448 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(py_obj);
3449 0 : PyObject *ret = NULL;
3450 : DATA_BLOB blob;
3451 : enum ndr_err_code err;
3452 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3453 0 : if (tmp_ctx == NULL) {
3454 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3455 0 : return NULL;
3456 : }
3457 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_descriptor_hash_v3);
3458 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3459 0 : TALLOC_FREE(tmp_ctx);
3460 0 : PyErr_SetNdrError(err);
3461 0 : return NULL;
3462 : }
3463 :
3464 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3465 0 : TALLOC_FREE(tmp_ctx);
3466 0 : return ret;
3467 : }
3468 :
3469 0 : static PyObject *py_security_descriptor_hash_v3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3470 : {
3471 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(py_obj);
3472 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3473 0 : Py_ssize_t blob_length = 0;
3474 : enum ndr_err_code err;
3475 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3476 0 : PyObject *allow_remaining_obj = NULL;
3477 0 : bool allow_remaining = false;
3478 :
3479 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3480 : discard_const_p(char *, kwnames),
3481 : &blob.data, &blob_length,
3482 : &allow_remaining_obj)) {
3483 0 : return NULL;
3484 : }
3485 0 : blob.length = blob_length;
3486 :
3487 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3488 0 : allow_remaining = true;
3489 : }
3490 :
3491 0 : if (allow_remaining) {
3492 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor_hash_v3);
3493 : } else {
3494 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor_hash_v3);
3495 : }
3496 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3497 0 : PyErr_SetNdrError(err);
3498 0 : return NULL;
3499 : }
3500 :
3501 0 : Py_RETURN_NONE;
3502 : }
3503 :
3504 0 : static PyObject *py_security_descriptor_hash_v3_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3505 : {
3506 0 : struct security_descriptor_hash_v3 *object = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(py_obj);
3507 : PyObject *ret;
3508 : char *retstr;
3509 :
3510 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_descriptor_hash_v3, "security_descriptor_hash_v3", object);
3511 0 : ret = PyUnicode_FromString(retstr);
3512 0 : talloc_free(retstr);
3513 :
3514 0 : return ret;
3515 : }
3516 :
3517 : static PyMethodDef py_security_descriptor_hash_v3_methods[] = {
3518 : { "__ndr_pack__", (PyCFunction)py_security_descriptor_hash_v3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3519 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_descriptor_hash_v3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3520 : { "__ndr_print__", (PyCFunction)py_security_descriptor_hash_v3_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3521 : { NULL, NULL, 0, NULL }
3522 : };
3523 :
3524 :
3525 : static PyTypeObject security_descriptor_hash_v3_Type = {
3526 : PyVarObject_HEAD_INIT(NULL, 0)
3527 : .tp_name = "xattr.security_descriptor_hash_v3",
3528 : .tp_getset = py_security_descriptor_hash_v3_getsetters,
3529 : .tp_methods = py_security_descriptor_hash_v3_methods,
3530 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3531 : .tp_new = py_security_descriptor_hash_v3_new,
3532 : };
3533 :
3534 :
3535 1 : static PyObject *py_security_descriptor_hash_v4_get_sd(PyObject *obj, void *closure)
3536 : {
3537 1 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(obj);
3538 : PyObject *py_sd;
3539 1 : if (object->sd == NULL) {
3540 0 : Py_RETURN_NONE;
3541 : }
3542 1 : if (object->sd == NULL) {
3543 0 : py_sd = Py_None;
3544 0 : Py_INCREF(py_sd);
3545 : } else {
3546 1 : py_sd = pytalloc_reference_ex(security_descriptor_Type, object->sd, object->sd);
3547 : }
3548 1 : return py_sd;
3549 : }
3550 :
3551 0 : static int py_security_descriptor_hash_v4_set_sd(PyObject *py_obj, PyObject *value, void *closure)
3552 : {
3553 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3554 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sd));
3555 0 : if (value == NULL) {
3556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd");
3557 0 : return -1;
3558 : }
3559 0 : if (value == Py_None) {
3560 0 : object->sd = NULL;
3561 : } else {
3562 0 : object->sd = NULL;
3563 0 : PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
3564 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3565 0 : PyErr_NoMemory();
3566 0 : return -1;
3567 : }
3568 0 : object->sd = (struct security_descriptor *)pytalloc_get_ptr(value);
3569 : }
3570 0 : return 0;
3571 : }
3572 :
3573 0 : static PyObject *py_security_descriptor_hash_v4_get_hash_type(PyObject *obj, void *closure)
3574 : {
3575 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(obj);
3576 : PyObject *py_hash_type;
3577 0 : py_hash_type = PyLong_FromLong((uint16_t)object->hash_type);
3578 0 : return py_hash_type;
3579 : }
3580 :
3581 0 : static int py_security_descriptor_hash_v4_set_hash_type(PyObject *py_obj, PyObject *value, void *closure)
3582 : {
3583 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3584 0 : if (value == NULL) {
3585 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash_type");
3586 0 : return -1;
3587 : }
3588 : {
3589 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash_type));
3590 0 : if (PyLong_Check(value)) {
3591 : unsigned long long test_var;
3592 0 : test_var = PyLong_AsUnsignedLongLong(value);
3593 0 : if (PyErr_Occurred() != NULL) {
3594 0 : return -1;
3595 : }
3596 0 : if (test_var > uint_max) {
3597 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3598 : PyLong_Type.tp_name, uint_max, test_var);
3599 0 : return -1;
3600 : }
3601 0 : object->hash_type = test_var;
3602 : } else {
3603 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3604 : PyLong_Type.tp_name);
3605 0 : return -1;
3606 : }
3607 : }
3608 0 : return 0;
3609 : }
3610 :
3611 0 : static PyObject *py_security_descriptor_hash_v4_get_hash(PyObject *obj, void *closure)
3612 : {
3613 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(obj);
3614 : PyObject *py_hash;
3615 0 : py_hash = PyList_New(64);
3616 0 : if (py_hash == NULL) {
3617 0 : return NULL;
3618 : }
3619 : {
3620 : int hash_cntr_0;
3621 0 : for (hash_cntr_0 = 0; hash_cntr_0 < (64); hash_cntr_0++) {
3622 : PyObject *py_hash_0;
3623 0 : py_hash_0 = PyLong_FromLong((uint16_t)object->hash[hash_cntr_0]);
3624 0 : PyList_SetItem(py_hash, hash_cntr_0, py_hash_0);
3625 : }
3626 : }
3627 0 : return py_hash;
3628 : }
3629 :
3630 0 : static int py_security_descriptor_hash_v4_set_hash(PyObject *py_obj, PyObject *value, void *closure)
3631 : {
3632 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3633 0 : if (value == NULL) {
3634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
3635 0 : return -1;
3636 : }
3637 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3638 : {
3639 : int hash_cntr_0;
3640 0 : if (ARRAY_SIZE(object->hash) != PyList_GET_SIZE(value)) {
3641 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->hash), PyList_GET_SIZE(value));
3642 0 : return -1;
3643 : }
3644 0 : for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) {
3645 0 : if (PyList_GET_ITEM(value, hash_cntr_0) == NULL) {
3646 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash[hash_cntr_0]");
3647 0 : return -1;
3648 : }
3649 : {
3650 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash[hash_cntr_0]));
3651 0 : if (PyLong_Check(PyList_GET_ITEM(value, hash_cntr_0))) {
3652 : unsigned long long test_var;
3653 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, hash_cntr_0));
3654 0 : if (PyErr_Occurred() != NULL) {
3655 0 : return -1;
3656 : }
3657 0 : if (test_var > uint_max) {
3658 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3659 : PyLong_Type.tp_name, uint_max, test_var);
3660 0 : return -1;
3661 : }
3662 0 : object->hash[hash_cntr_0] = test_var;
3663 : } else {
3664 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3665 : PyLong_Type.tp_name);
3666 0 : return -1;
3667 : }
3668 : }
3669 : }
3670 : }
3671 0 : return 0;
3672 : }
3673 :
3674 0 : static PyObject *py_security_descriptor_hash_v4_get_description(PyObject *obj, void *closure)
3675 : {
3676 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(obj);
3677 : PyObject *py_description;
3678 0 : py_description = PyString_FromStringOrNULL(object->description);
3679 0 : return py_description;
3680 : }
3681 :
3682 0 : static int py_security_descriptor_hash_v4_set_description(PyObject *py_obj, PyObject *value, void *closure)
3683 : {
3684 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3685 0 : if (value == NULL) {
3686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
3687 0 : return -1;
3688 : }
3689 : {
3690 : const char *test_str;
3691 : const char *talloc_str;
3692 0 : PyObject *unicode = NULL;
3693 0 : if (PyUnicode_Check(value)) {
3694 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3695 0 : if (unicode == NULL) {
3696 0 : PyErr_NoMemory();
3697 0 : return -1;
3698 : }
3699 0 : test_str = PyBytes_AS_STRING(unicode);
3700 0 : } else if (PyBytes_Check(value)) {
3701 0 : test_str = PyBytes_AS_STRING(value);
3702 : } else {
3703 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3704 0 : return -1;
3705 : }
3706 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3707 0 : if (unicode != NULL) {
3708 0 : Py_DECREF(unicode);
3709 : }
3710 0 : if (talloc_str == NULL) {
3711 0 : PyErr_NoMemory();
3712 0 : return -1;
3713 : }
3714 0 : object->description = talloc_str;
3715 : }
3716 0 : return 0;
3717 : }
3718 :
3719 0 : static PyObject *py_security_descriptor_hash_v4_get_time(PyObject *obj, void *closure)
3720 : {
3721 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(obj);
3722 : PyObject *py_time;
3723 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
3724 0 : return py_time;
3725 : }
3726 :
3727 0 : static int py_security_descriptor_hash_v4_set_time(PyObject *py_obj, PyObject *value, void *closure)
3728 : {
3729 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3730 0 : if (value == NULL) {
3731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
3732 0 : return -1;
3733 : }
3734 : {
3735 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
3736 0 : if (PyLong_Check(value)) {
3737 : unsigned long long test_var;
3738 0 : test_var = PyLong_AsUnsignedLongLong(value);
3739 0 : if (PyErr_Occurred() != NULL) {
3740 0 : return -1;
3741 : }
3742 0 : if (test_var > uint_max) {
3743 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3744 : PyLong_Type.tp_name, uint_max, test_var);
3745 0 : return -1;
3746 : }
3747 0 : object->time = test_var;
3748 : } else {
3749 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3750 : PyLong_Type.tp_name);
3751 0 : return -1;
3752 : }
3753 : }
3754 0 : return 0;
3755 : }
3756 :
3757 0 : static PyObject *py_security_descriptor_hash_v4_get_sys_acl_hash(PyObject *obj, void *closure)
3758 : {
3759 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(obj);
3760 : PyObject *py_sys_acl_hash;
3761 0 : py_sys_acl_hash = PyList_New(64);
3762 0 : if (py_sys_acl_hash == NULL) {
3763 0 : return NULL;
3764 : }
3765 : {
3766 : int sys_acl_hash_cntr_0;
3767 0 : for (sys_acl_hash_cntr_0 = 0; sys_acl_hash_cntr_0 < (64); sys_acl_hash_cntr_0++) {
3768 : PyObject *py_sys_acl_hash_0;
3769 0 : py_sys_acl_hash_0 = PyLong_FromLong((uint16_t)object->sys_acl_hash[sys_acl_hash_cntr_0]);
3770 0 : PyList_SetItem(py_sys_acl_hash, sys_acl_hash_cntr_0, py_sys_acl_hash_0);
3771 : }
3772 : }
3773 0 : return py_sys_acl_hash;
3774 : }
3775 :
3776 0 : static int py_security_descriptor_hash_v4_set_sys_acl_hash(PyObject *py_obj, PyObject *value, void *closure)
3777 : {
3778 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3779 0 : if (value == NULL) {
3780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sys_acl_hash");
3781 0 : return -1;
3782 : }
3783 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3784 : {
3785 : int sys_acl_hash_cntr_0;
3786 0 : if (ARRAY_SIZE(object->sys_acl_hash) != PyList_GET_SIZE(value)) {
3787 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->sys_acl_hash), PyList_GET_SIZE(value));
3788 0 : return -1;
3789 : }
3790 0 : for (sys_acl_hash_cntr_0 = 0; sys_acl_hash_cntr_0 < PyList_GET_SIZE(value); sys_acl_hash_cntr_0++) {
3791 0 : if (PyList_GET_ITEM(value, sys_acl_hash_cntr_0) == NULL) {
3792 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sys_acl_hash[sys_acl_hash_cntr_0]");
3793 0 : return -1;
3794 : }
3795 : {
3796 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sys_acl_hash[sys_acl_hash_cntr_0]));
3797 0 : if (PyLong_Check(PyList_GET_ITEM(value, sys_acl_hash_cntr_0))) {
3798 : unsigned long long test_var;
3799 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, sys_acl_hash_cntr_0));
3800 0 : if (PyErr_Occurred() != NULL) {
3801 0 : return -1;
3802 : }
3803 0 : if (test_var > uint_max) {
3804 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3805 : PyLong_Type.tp_name, uint_max, test_var);
3806 0 : return -1;
3807 : }
3808 0 : object->sys_acl_hash[sys_acl_hash_cntr_0] = test_var;
3809 : } else {
3810 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3811 : PyLong_Type.tp_name);
3812 0 : return -1;
3813 : }
3814 : }
3815 : }
3816 : }
3817 0 : return 0;
3818 : }
3819 :
3820 : static PyGetSetDef py_security_descriptor_hash_v4_getsetters[] = {
3821 : {
3822 : .name = discard_const_p(char, "sd"),
3823 : .get = py_security_descriptor_hash_v4_get_sd,
3824 : .set = py_security_descriptor_hash_v4_set_sd,
3825 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
3826 : },
3827 : {
3828 : .name = discard_const_p(char, "hash_type"),
3829 : .get = py_security_descriptor_hash_v4_get_hash_type,
3830 : .set = py_security_descriptor_hash_v4_set_hash_type,
3831 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3832 : },
3833 : {
3834 : .name = discard_const_p(char, "hash"),
3835 : .get = py_security_descriptor_hash_v4_get_hash,
3836 : .set = py_security_descriptor_hash_v4_set_hash,
3837 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3838 : },
3839 : {
3840 : .name = discard_const_p(char, "description"),
3841 : .get = py_security_descriptor_hash_v4_get_description,
3842 : .set = py_security_descriptor_hash_v4_set_description,
3843 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
3844 : },
3845 : {
3846 : .name = discard_const_p(char, "time"),
3847 : .get = py_security_descriptor_hash_v4_get_time,
3848 : .set = py_security_descriptor_hash_v4_set_time,
3849 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3850 : },
3851 : {
3852 : .name = discard_const_p(char, "sys_acl_hash"),
3853 : .get = py_security_descriptor_hash_v4_get_sys_acl_hash,
3854 : .set = py_security_descriptor_hash_v4_set_sys_acl_hash,
3855 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3856 : },
3857 : { .name = NULL }
3858 : };
3859 :
3860 0 : static PyObject *py_security_descriptor_hash_v4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3861 : {
3862 0 : return pytalloc_new(struct security_descriptor_hash_v4, type);
3863 : }
3864 :
3865 0 : static PyObject *py_security_descriptor_hash_v4_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3866 : {
3867 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3868 0 : PyObject *ret = NULL;
3869 : DATA_BLOB blob;
3870 : enum ndr_err_code err;
3871 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3872 0 : if (tmp_ctx == NULL) {
3873 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3874 0 : return NULL;
3875 : }
3876 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_descriptor_hash_v4);
3877 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3878 0 : TALLOC_FREE(tmp_ctx);
3879 0 : PyErr_SetNdrError(err);
3880 0 : return NULL;
3881 : }
3882 :
3883 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3884 0 : TALLOC_FREE(tmp_ctx);
3885 0 : return ret;
3886 : }
3887 :
3888 0 : static PyObject *py_security_descriptor_hash_v4_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3889 : {
3890 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3891 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3892 0 : Py_ssize_t blob_length = 0;
3893 : enum ndr_err_code err;
3894 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3895 0 : PyObject *allow_remaining_obj = NULL;
3896 0 : bool allow_remaining = false;
3897 :
3898 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3899 : discard_const_p(char *, kwnames),
3900 : &blob.data, &blob_length,
3901 : &allow_remaining_obj)) {
3902 0 : return NULL;
3903 : }
3904 0 : blob.length = blob_length;
3905 :
3906 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3907 0 : allow_remaining = true;
3908 : }
3909 :
3910 0 : if (allow_remaining) {
3911 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor_hash_v4);
3912 : } else {
3913 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor_hash_v4);
3914 : }
3915 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3916 0 : PyErr_SetNdrError(err);
3917 0 : return NULL;
3918 : }
3919 :
3920 0 : Py_RETURN_NONE;
3921 : }
3922 :
3923 0 : static PyObject *py_security_descriptor_hash_v4_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3924 : {
3925 0 : struct security_descriptor_hash_v4 *object = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(py_obj);
3926 : PyObject *ret;
3927 : char *retstr;
3928 :
3929 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_descriptor_hash_v4, "security_descriptor_hash_v4", object);
3930 0 : ret = PyUnicode_FromString(retstr);
3931 0 : talloc_free(retstr);
3932 :
3933 0 : return ret;
3934 : }
3935 :
3936 : static PyMethodDef py_security_descriptor_hash_v4_methods[] = {
3937 : { "__ndr_pack__", (PyCFunction)py_security_descriptor_hash_v4_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3938 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_descriptor_hash_v4_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3939 : { "__ndr_print__", (PyCFunction)py_security_descriptor_hash_v4_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3940 : { NULL, NULL, 0, NULL }
3941 : };
3942 :
3943 :
3944 : static PyTypeObject security_descriptor_hash_v4_Type = {
3945 : PyVarObject_HEAD_INIT(NULL, 0)
3946 : .tp_name = "xattr.security_descriptor_hash_v4",
3947 : .tp_getset = py_security_descriptor_hash_v4_getsetters,
3948 : .tp_methods = py_security_descriptor_hash_v4_methods,
3949 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3950 : .tp_new = py_security_descriptor_hash_v4_new,
3951 : };
3952 :
3953 7 : static PyObject *py_import_xattr_NTACL_Info(TALLOC_CTX *mem_ctx, int level, union xattr_NTACL_Info *in)
3954 : {
3955 : PyObject *ret;
3956 :
3957 7 : switch (level) {
3958 6 : case 1:
3959 6 : if (in->sd == NULL) {
3960 0 : ret = Py_None;
3961 0 : Py_INCREF(ret);
3962 : } else {
3963 6 : ret = pytalloc_reference_ex(security_descriptor_Type, in->sd, in->sd);
3964 : }
3965 6 : return ret;
3966 :
3967 0 : case 2:
3968 0 : if (in->sd_hs2 == NULL) {
3969 0 : ret = Py_None;
3970 0 : Py_INCREF(ret);
3971 : } else {
3972 0 : ret = pytalloc_reference_ex(&security_descriptor_hash_v2_Type, in->sd_hs2, in->sd_hs2);
3973 : }
3974 0 : return ret;
3975 :
3976 0 : case 3:
3977 0 : if (in->sd_hs3 == NULL) {
3978 0 : ret = Py_None;
3979 0 : Py_INCREF(ret);
3980 : } else {
3981 0 : ret = pytalloc_reference_ex(&security_descriptor_hash_v3_Type, in->sd_hs3, in->sd_hs3);
3982 : }
3983 0 : return ret;
3984 :
3985 1 : case 4:
3986 1 : if (in->sd_hs4 == NULL) {
3987 0 : ret = Py_None;
3988 0 : Py_INCREF(ret);
3989 : } else {
3990 1 : ret = pytalloc_reference_ex(&security_descriptor_hash_v4_Type, in->sd_hs4, in->sd_hs4);
3991 : }
3992 1 : return ret;
3993 :
3994 : }
3995 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
3996 0 : return NULL;
3997 : }
3998 :
3999 570 : static union xattr_NTACL_Info *py_export_xattr_NTACL_Info(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4000 : {
4001 570 : union xattr_NTACL_Info *ret = talloc_zero(mem_ctx, union xattr_NTACL_Info);
4002 570 : switch (level) {
4003 570 : case 1:
4004 570 : if (in == NULL) {
4005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sd");
4006 0 : talloc_free(ret); return NULL;
4007 : }
4008 570 : if (in == Py_None) {
4009 0 : ret->sd = NULL;
4010 : } else {
4011 570 : ret->sd = NULL;
4012 570 : PY_CHECK_TYPE(security_descriptor_Type, in, talloc_free(ret); return NULL;);
4013 570 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4014 0 : PyErr_NoMemory();
4015 0 : talloc_free(ret); return NULL;
4016 : }
4017 570 : ret->sd = (struct security_descriptor *)pytalloc_get_ptr(in);
4018 : }
4019 570 : break;
4020 :
4021 0 : case 2:
4022 0 : if (in == NULL) {
4023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sd_hs2");
4024 0 : talloc_free(ret); return NULL;
4025 : }
4026 0 : if (in == Py_None) {
4027 0 : ret->sd_hs2 = NULL;
4028 : } else {
4029 0 : ret->sd_hs2 = NULL;
4030 0 : PY_CHECK_TYPE(&security_descriptor_hash_v2_Type, in, talloc_free(ret); return NULL;);
4031 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4032 0 : PyErr_NoMemory();
4033 0 : talloc_free(ret); return NULL;
4034 : }
4035 0 : ret->sd_hs2 = (struct security_descriptor_hash_v2 *)pytalloc_get_ptr(in);
4036 : }
4037 0 : break;
4038 :
4039 0 : case 3:
4040 0 : if (in == NULL) {
4041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sd_hs3");
4042 0 : talloc_free(ret); return NULL;
4043 : }
4044 0 : if (in == Py_None) {
4045 0 : ret->sd_hs3 = NULL;
4046 : } else {
4047 0 : ret->sd_hs3 = NULL;
4048 0 : PY_CHECK_TYPE(&security_descriptor_hash_v3_Type, in, talloc_free(ret); return NULL;);
4049 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4050 0 : PyErr_NoMemory();
4051 0 : talloc_free(ret); return NULL;
4052 : }
4053 0 : ret->sd_hs3 = (struct security_descriptor_hash_v3 *)pytalloc_get_ptr(in);
4054 : }
4055 0 : break;
4056 :
4057 0 : case 4:
4058 0 : if (in == NULL) {
4059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sd_hs4");
4060 0 : talloc_free(ret); return NULL;
4061 : }
4062 0 : if (in == Py_None) {
4063 0 : ret->sd_hs4 = NULL;
4064 : } else {
4065 0 : ret->sd_hs4 = NULL;
4066 0 : PY_CHECK_TYPE(&security_descriptor_hash_v4_Type, in, talloc_free(ret); return NULL;);
4067 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4068 0 : PyErr_NoMemory();
4069 0 : talloc_free(ret); return NULL;
4070 : }
4071 0 : ret->sd_hs4 = (struct security_descriptor_hash_v4 *)pytalloc_get_ptr(in);
4072 : }
4073 0 : break;
4074 :
4075 0 : default:
4076 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4077 0 : talloc_free(ret);
4078 0 : ret = NULL;
4079 : }
4080 :
4081 570 : return ret;
4082 : }
4083 :
4084 7 : static PyObject *py_xattr_NTACL_Info_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4085 : {
4086 7 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4087 7 : PyObject *mem_ctx_obj = NULL;
4088 7 : TALLOC_CTX *mem_ctx = NULL;
4089 7 : int level = 0;
4090 7 : PyObject *in_obj = NULL;
4091 7 : union xattr_NTACL_Info *in = NULL;
4092 :
4093 7 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4094 : discard_const_p(char *, kwnames),
4095 : &mem_ctx_obj,
4096 : &level,
4097 : &in_obj)) {
4098 0 : return NULL;
4099 : }
4100 7 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4101 7 : if (mem_ctx == NULL) {
4102 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4103 0 : return NULL;
4104 : }
4105 7 : in = (union xattr_NTACL_Info *)pytalloc_get_ptr(in_obj);
4106 7 : if (in == NULL) {
4107 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union xattr_NTACL_Info!");
4108 0 : return NULL;
4109 : }
4110 :
4111 7 : return py_import_xattr_NTACL_Info(mem_ctx, level, in);
4112 : }
4113 :
4114 570 : static PyObject *py_xattr_NTACL_Info_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4115 : {
4116 570 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4117 570 : PyObject *mem_ctx_obj = NULL;
4118 570 : TALLOC_CTX *mem_ctx = NULL;
4119 570 : int level = 0;
4120 570 : PyObject *in = NULL;
4121 570 : union xattr_NTACL_Info *out = NULL;
4122 :
4123 570 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4124 : discard_const_p(char *, kwnames),
4125 : &mem_ctx_obj,
4126 : &level,
4127 : &in)) {
4128 0 : return NULL;
4129 : }
4130 570 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4131 570 : if (mem_ctx == NULL) {
4132 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4133 0 : return NULL;
4134 : }
4135 :
4136 570 : out = py_export_xattr_NTACL_Info(mem_ctx, level, in);
4137 570 : if (out == NULL) {
4138 0 : return NULL;
4139 : }
4140 :
4141 570 : return pytalloc_GenericObject_reference(out);
4142 : }
4143 :
4144 : static PyMethodDef py_xattr_NTACL_Info_methods[] = {
4145 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_NTACL_Info_import),
4146 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4147 : "T.__import__(mem_ctx, level, in) => ret." },
4148 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_NTACL_Info_export),
4149 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4150 : "T.__export__(mem_ctx, level, in) => ret." },
4151 : { NULL, NULL, 0, NULL }
4152 : };
4153 :
4154 0 : static PyObject *py_xattr_NTACL_Info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4155 : {
4156 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4157 0 : return NULL;
4158 : }
4159 :
4160 :
4161 : static PyTypeObject xattr_NTACL_Info_Type = {
4162 : PyVarObject_HEAD_INIT(NULL, 0)
4163 : .tp_name = "xattr.NTACL_Info",
4164 : .tp_getset = NULL,
4165 : .tp_methods = py_xattr_NTACL_Info_methods,
4166 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4167 : .tp_new = py_xattr_NTACL_Info_new,
4168 : };
4169 :
4170 :
4171 10 : static PyObject *py_xattr_NTACL_get_version(PyObject *obj, void *closure)
4172 : {
4173 10 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(obj);
4174 : PyObject *py_version;
4175 10 : py_version = PyLong_FromLong((uint16_t)object->version);
4176 10 : return py_version;
4177 : }
4178 :
4179 570 : static int py_xattr_NTACL_set_version(PyObject *py_obj, PyObject *value, void *closure)
4180 : {
4181 570 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(py_obj);
4182 570 : if (value == NULL) {
4183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
4184 0 : return -1;
4185 : }
4186 : {
4187 570 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
4188 570 : if (PyLong_Check(value)) {
4189 : unsigned long long test_var;
4190 570 : test_var = PyLong_AsUnsignedLongLong(value);
4191 570 : if (PyErr_Occurred() != NULL) {
4192 0 : return -1;
4193 : }
4194 570 : if (test_var > uint_max) {
4195 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4196 : PyLong_Type.tp_name, uint_max, test_var);
4197 0 : return -1;
4198 : }
4199 570 : object->version = test_var;
4200 : } else {
4201 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4202 : PyLong_Type.tp_name);
4203 0 : return -1;
4204 : }
4205 : }
4206 570 : return 0;
4207 : }
4208 :
4209 7 : static PyObject *py_xattr_NTACL_get_info(PyObject *obj, void *closure)
4210 : {
4211 7 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(obj);
4212 : PyObject *py_info;
4213 7 : py_info = pyrpc_import_union(&xattr_NTACL_Info_Type, pytalloc_get_mem_ctx(obj), object->version, &object->info, "union xattr_NTACL_Info");
4214 7 : if (py_info == NULL) {
4215 0 : return NULL;
4216 : }
4217 7 : return py_info;
4218 : }
4219 :
4220 570 : static int py_xattr_NTACL_set_info(PyObject *py_obj, PyObject *value, void *closure)
4221 : {
4222 570 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(py_obj);
4223 570 : if (value == NULL) {
4224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
4225 0 : return -1;
4226 : }
4227 : {
4228 : union xattr_NTACL_Info *info_switch_0;
4229 570 : info_switch_0 = (union xattr_NTACL_Info *)pyrpc_export_union(&xattr_NTACL_Info_Type, pytalloc_get_mem_ctx(py_obj), object->version, value, "union xattr_NTACL_Info");
4230 570 : if (info_switch_0 == NULL) {
4231 0 : return -1;
4232 : }
4233 570 : object->info = *info_switch_0;
4234 : }
4235 570 : return 0;
4236 : }
4237 :
4238 : static PyGetSetDef py_xattr_NTACL_getsetters[] = {
4239 : {
4240 : .name = discard_const_p(char, "version"),
4241 : .get = py_xattr_NTACL_get_version,
4242 : .set = py_xattr_NTACL_set_version,
4243 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4244 : },
4245 : {
4246 : .name = discard_const_p(char, "info"),
4247 : .get = py_xattr_NTACL_get_info,
4248 : .set = py_xattr_NTACL_set_info,
4249 : .doc = discard_const_p(char, "PIDL-generated element of base type xattr_NTACL_Info")
4250 : },
4251 : { .name = NULL }
4252 : };
4253 :
4254 577 : static PyObject *py_xattr_NTACL_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4255 : {
4256 577 : return pytalloc_new(struct xattr_NTACL, type);
4257 : }
4258 :
4259 570 : static PyObject *py_xattr_NTACL_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4260 : {
4261 570 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(py_obj);
4262 570 : PyObject *ret = NULL;
4263 : DATA_BLOB blob;
4264 : enum ndr_err_code err;
4265 570 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4266 570 : if (tmp_ctx == NULL) {
4267 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4268 0 : return NULL;
4269 : }
4270 570 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_xattr_NTACL);
4271 570 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4272 0 : TALLOC_FREE(tmp_ctx);
4273 0 : PyErr_SetNdrError(err);
4274 0 : return NULL;
4275 : }
4276 :
4277 570 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4278 570 : TALLOC_FREE(tmp_ctx);
4279 570 : return ret;
4280 : }
4281 :
4282 7 : static PyObject *py_xattr_NTACL_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4283 : {
4284 7 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(py_obj);
4285 7 : DATA_BLOB blob = {.data = NULL, .length = 0};
4286 7 : Py_ssize_t blob_length = 0;
4287 : enum ndr_err_code err;
4288 7 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4289 7 : PyObject *allow_remaining_obj = NULL;
4290 7 : bool allow_remaining = false;
4291 :
4292 7 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4293 : discard_const_p(char *, kwnames),
4294 : &blob.data, &blob_length,
4295 : &allow_remaining_obj)) {
4296 0 : return NULL;
4297 : }
4298 7 : blob.length = blob_length;
4299 :
4300 7 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4301 0 : allow_remaining = true;
4302 : }
4303 :
4304 7 : if (allow_remaining) {
4305 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_NTACL);
4306 : } else {
4307 7 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_xattr_NTACL);
4308 : }
4309 7 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4310 0 : PyErr_SetNdrError(err);
4311 0 : return NULL;
4312 : }
4313 :
4314 7 : Py_RETURN_NONE;
4315 : }
4316 :
4317 0 : static PyObject *py_xattr_NTACL_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4318 : {
4319 0 : struct xattr_NTACL *object = (struct xattr_NTACL *)pytalloc_get_ptr(py_obj);
4320 : PyObject *ret;
4321 : char *retstr;
4322 :
4323 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_xattr_NTACL, "xattr_NTACL", object);
4324 0 : ret = PyUnicode_FromString(retstr);
4325 0 : talloc_free(retstr);
4326 :
4327 0 : return ret;
4328 : }
4329 :
4330 : static PyMethodDef py_xattr_NTACL_methods[] = {
4331 : { "__ndr_pack__", (PyCFunction)py_xattr_NTACL_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4332 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_xattr_NTACL_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4333 : { "__ndr_print__", (PyCFunction)py_xattr_NTACL_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4334 : { NULL, NULL, 0, NULL }
4335 : };
4336 :
4337 :
4338 : static PyTypeObject xattr_NTACL_Type = {
4339 : PyVarObject_HEAD_INIT(NULL, 0)
4340 : .tp_name = "xattr.NTACL",
4341 : .tp_getset = py_xattr_NTACL_getsetters,
4342 : .tp_methods = py_xattr_NTACL_methods,
4343 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4344 : .tp_new = py_xattr_NTACL_new,
4345 : };
4346 :
4347 :
4348 0 : static PyObject *py_xattr_sys_acl_hash_wrapper_get_acl_as_blob(PyObject *obj, void *closure)
4349 : {
4350 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(obj);
4351 : PyObject *py_acl_as_blob;
4352 0 : py_acl_as_blob = PyBytes_FromStringAndSize((char *)(object->acl_as_blob).data, (object->acl_as_blob).length);
4353 0 : return py_acl_as_blob;
4354 : }
4355 :
4356 0 : static int py_xattr_sys_acl_hash_wrapper_set_acl_as_blob(PyObject *py_obj, PyObject *value, void *closure)
4357 : {
4358 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(py_obj);
4359 0 : if (value == NULL) {
4360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acl_as_blob");
4361 0 : return -1;
4362 : }
4363 0 : object->acl_as_blob = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
4364 0 : return 0;
4365 : }
4366 :
4367 0 : static PyObject *py_xattr_sys_acl_hash_wrapper_get_owner(PyObject *obj, void *closure)
4368 : {
4369 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(obj);
4370 : PyObject *py_owner;
4371 0 : py_owner = PyLong_FromUnsignedLongLong(object->owner);
4372 0 : return py_owner;
4373 : }
4374 :
4375 0 : static int py_xattr_sys_acl_hash_wrapper_set_owner(PyObject *py_obj, PyObject *value, void *closure)
4376 : {
4377 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(py_obj);
4378 0 : if (value == NULL) {
4379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->owner");
4380 0 : return -1;
4381 : }
4382 : {
4383 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->owner));
4384 0 : if (PyLong_Check(value)) {
4385 : unsigned long long test_var;
4386 0 : test_var = PyLong_AsUnsignedLongLong(value);
4387 0 : if (PyErr_Occurred() != NULL) {
4388 0 : return -1;
4389 : }
4390 0 : if (test_var > uint_max) {
4391 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4392 : PyLong_Type.tp_name, uint_max, test_var);
4393 0 : return -1;
4394 : }
4395 0 : object->owner = test_var;
4396 : } else {
4397 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4398 : PyLong_Type.tp_name);
4399 0 : return -1;
4400 : }
4401 : }
4402 0 : return 0;
4403 : }
4404 :
4405 0 : static PyObject *py_xattr_sys_acl_hash_wrapper_get_group(PyObject *obj, void *closure)
4406 : {
4407 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(obj);
4408 : PyObject *py_group;
4409 0 : py_group = PyLong_FromUnsignedLongLong(object->group);
4410 0 : return py_group;
4411 : }
4412 :
4413 0 : static int py_xattr_sys_acl_hash_wrapper_set_group(PyObject *py_obj, PyObject *value, void *closure)
4414 : {
4415 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(py_obj);
4416 0 : if (value == NULL) {
4417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group");
4418 0 : return -1;
4419 : }
4420 : {
4421 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->group));
4422 0 : if (PyLong_Check(value)) {
4423 : unsigned long long test_var;
4424 0 : test_var = PyLong_AsUnsignedLongLong(value);
4425 0 : if (PyErr_Occurred() != NULL) {
4426 0 : return -1;
4427 : }
4428 0 : if (test_var > uint_max) {
4429 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4430 : PyLong_Type.tp_name, uint_max, test_var);
4431 0 : return -1;
4432 : }
4433 0 : object->group = test_var;
4434 : } else {
4435 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4436 : PyLong_Type.tp_name);
4437 0 : return -1;
4438 : }
4439 : }
4440 0 : return 0;
4441 : }
4442 :
4443 0 : static PyObject *py_xattr_sys_acl_hash_wrapper_get_mode(PyObject *obj, void *closure)
4444 : {
4445 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(obj);
4446 : PyObject *py_mode;
4447 0 : py_mode = PyLong_FromUnsignedLongLong((uint32_t)object->mode);
4448 0 : return py_mode;
4449 : }
4450 :
4451 0 : static int py_xattr_sys_acl_hash_wrapper_set_mode(PyObject *py_obj, PyObject *value, void *closure)
4452 : {
4453 0 : struct xattr_sys_acl_hash_wrapper *object = (struct xattr_sys_acl_hash_wrapper *)pytalloc_get_ptr(py_obj);
4454 0 : if (value == NULL) {
4455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->mode");
4456 0 : return -1;
4457 : }
4458 : {
4459 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mode));
4460 0 : if (PyLong_Check(value)) {
4461 : unsigned long long test_var;
4462 0 : test_var = PyLong_AsUnsignedLongLong(value);
4463 0 : if (PyErr_Occurred() != NULL) {
4464 0 : return -1;
4465 : }
4466 0 : if (test_var > uint_max) {
4467 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4468 : PyLong_Type.tp_name, uint_max, test_var);
4469 0 : return -1;
4470 : }
4471 0 : object->mode = test_var;
4472 : } else {
4473 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4474 : PyLong_Type.tp_name);
4475 0 : return -1;
4476 : }
4477 : }
4478 0 : return 0;
4479 : }
4480 :
4481 : static PyGetSetDef py_xattr_sys_acl_hash_wrapper_getsetters[] = {
4482 : {
4483 : .name = discard_const_p(char, "acl_as_blob"),
4484 : .get = py_xattr_sys_acl_hash_wrapper_get_acl_as_blob,
4485 : .set = py_xattr_sys_acl_hash_wrapper_set_acl_as_blob,
4486 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
4487 : },
4488 : {
4489 : .name = discard_const_p(char, "owner"),
4490 : .get = py_xattr_sys_acl_hash_wrapper_get_owner,
4491 : .set = py_xattr_sys_acl_hash_wrapper_set_owner,
4492 : .doc = discard_const_p(char, "PIDL-generated element of base type uid_t")
4493 : },
4494 : {
4495 : .name = discard_const_p(char, "group"),
4496 : .get = py_xattr_sys_acl_hash_wrapper_get_group,
4497 : .set = py_xattr_sys_acl_hash_wrapper_set_group,
4498 : .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
4499 : },
4500 : {
4501 : .name = discard_const_p(char, "mode"),
4502 : .get = py_xattr_sys_acl_hash_wrapper_get_mode,
4503 : .set = py_xattr_sys_acl_hash_wrapper_set_mode,
4504 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4505 : },
4506 : { .name = NULL }
4507 : };
4508 :
4509 0 : static PyObject *py_xattr_sys_acl_hash_wrapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4510 : {
4511 0 : return pytalloc_new(struct xattr_sys_acl_hash_wrapper, type);
4512 : }
4513 :
4514 :
4515 : static PyTypeObject xattr_sys_acl_hash_wrapper_Type = {
4516 : PyVarObject_HEAD_INIT(NULL, 0)
4517 : .tp_name = "xattr.sys_acl_hash_wrapper",
4518 : .tp_getset = py_xattr_sys_acl_hash_wrapper_getsetters,
4519 : .tp_methods = NULL,
4520 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4521 : .tp_new = py_xattr_sys_acl_hash_wrapper_new,
4522 : };
4523 :
4524 : static PyMethodDef xattr_methods[] = {
4525 : { NULL, NULL, 0, NULL }
4526 : };
4527 :
4528 : static struct PyModuleDef moduledef = {
4529 : PyModuleDef_HEAD_INIT,
4530 : .m_name = "xattr",
4531 : .m_doc = "xattr DCE/RPC",
4532 : .m_size = -1,
4533 : .m_methods = xattr_methods,
4534 : };
4535 1184 : MODULE_INIT_FUNC(xattr)
4536 : {
4537 1184 : PyObject *m = NULL;
4538 1184 : PyObject *dep_samba_dcerpc_security = NULL;
4539 1184 : PyObject *dep_talloc = NULL;
4540 :
4541 1184 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
4542 1184 : if (dep_samba_dcerpc_security == NULL)
4543 0 : goto out;
4544 :
4545 1184 : dep_talloc = PyImport_ImportModule("talloc");
4546 1184 : if (dep_talloc == NULL)
4547 0 : goto out;
4548 :
4549 1184 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
4550 1184 : if (BaseObject_Type == NULL)
4551 0 : goto out;
4552 :
4553 1184 : security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
4554 1184 : if (security_descriptor_Type == NULL)
4555 0 : goto out;
4556 :
4557 1184 : xattr_DosInfoFFFFCompat_Type.tp_base = BaseObject_Type;
4558 1184 : xattr_DosInfoFFFFCompat_Type.tp_basicsize = pytalloc_BaseObject_size();
4559 :
4560 1184 : xattr_DosInfo1_Type.tp_base = BaseObject_Type;
4561 1184 : xattr_DosInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();
4562 :
4563 1184 : xattr_DosInfo2Old_Type.tp_base = BaseObject_Type;
4564 1184 : xattr_DosInfo2Old_Type.tp_basicsize = pytalloc_BaseObject_size();
4565 :
4566 1184 : xattr_DosInfo3_Type.tp_base = BaseObject_Type;
4567 1184 : xattr_DosInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();
4568 :
4569 1184 : xattr_DosInfo4_Type.tp_base = BaseObject_Type;
4570 1184 : xattr_DosInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();
4571 :
4572 1184 : xattr_DosInfo5_Type.tp_base = BaseObject_Type;
4573 1184 : xattr_DosInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();
4574 :
4575 1184 : xattr_DosInfo_Type.tp_base = BaseObject_Type;
4576 1184 : xattr_DosInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
4577 :
4578 1184 : xattr_DosAttrib_Type.tp_base = BaseObject_Type;
4579 1184 : xattr_DosAttrib_Type.tp_basicsize = pytalloc_BaseObject_size();
4580 :
4581 1184 : xattr_DOSATTRIB_Type.tp_base = BaseObject_Type;
4582 1184 : xattr_DOSATTRIB_Type.tp_basicsize = pytalloc_BaseObject_size();
4583 :
4584 1184 : xattr_EA_Type.tp_base = BaseObject_Type;
4585 1184 : xattr_EA_Type.tp_basicsize = pytalloc_BaseObject_size();
4586 :
4587 1184 : xattr_DosEAs_Type.tp_base = BaseObject_Type;
4588 1184 : xattr_DosEAs_Type.tp_basicsize = pytalloc_BaseObject_size();
4589 :
4590 1184 : tdb_xattrs_Type.tp_base = BaseObject_Type;
4591 1184 : tdb_xattrs_Type.tp_basicsize = pytalloc_BaseObject_size();
4592 :
4593 1184 : xattr_DosStream_Type.tp_base = BaseObject_Type;
4594 1184 : xattr_DosStream_Type.tp_basicsize = pytalloc_BaseObject_size();
4595 :
4596 1184 : xattr_DosStreams_Type.tp_base = BaseObject_Type;
4597 1184 : xattr_DosStreams_Type.tp_basicsize = pytalloc_BaseObject_size();
4598 :
4599 1184 : security_descriptor_hash_v2_Type.tp_base = BaseObject_Type;
4600 1184 : security_descriptor_hash_v2_Type.tp_basicsize = pytalloc_BaseObject_size();
4601 :
4602 1184 : security_descriptor_hash_v3_Type.tp_base = BaseObject_Type;
4603 1184 : security_descriptor_hash_v3_Type.tp_basicsize = pytalloc_BaseObject_size();
4604 :
4605 1184 : security_descriptor_hash_v4_Type.tp_base = BaseObject_Type;
4606 1184 : security_descriptor_hash_v4_Type.tp_basicsize = pytalloc_BaseObject_size();
4607 :
4608 1184 : xattr_NTACL_Info_Type.tp_base = BaseObject_Type;
4609 1184 : xattr_NTACL_Info_Type.tp_basicsize = pytalloc_BaseObject_size();
4610 :
4611 1184 : xattr_NTACL_Type.tp_base = BaseObject_Type;
4612 1184 : xattr_NTACL_Type.tp_basicsize = pytalloc_BaseObject_size();
4613 :
4614 1184 : xattr_sys_acl_hash_wrapper_Type.tp_base = BaseObject_Type;
4615 1184 : xattr_sys_acl_hash_wrapper_Type.tp_basicsize = pytalloc_BaseObject_size();
4616 :
4617 1184 : if (PyType_Ready(&xattr_DosInfoFFFFCompat_Type) < 0)
4618 0 : goto out;
4619 1184 : if (PyType_Ready(&xattr_DosInfo1_Type) < 0)
4620 0 : goto out;
4621 1184 : if (PyType_Ready(&xattr_DosInfo2Old_Type) < 0)
4622 0 : goto out;
4623 1184 : if (PyType_Ready(&xattr_DosInfo3_Type) < 0)
4624 0 : goto out;
4625 1184 : if (PyType_Ready(&xattr_DosInfo4_Type) < 0)
4626 0 : goto out;
4627 1184 : if (PyType_Ready(&xattr_DosInfo5_Type) < 0)
4628 0 : goto out;
4629 1184 : if (PyType_Ready(&xattr_DosInfo_Type) < 0)
4630 0 : goto out;
4631 1184 : if (PyType_Ready(&xattr_DosAttrib_Type) < 0)
4632 0 : goto out;
4633 1184 : if (PyType_Ready(&xattr_DOSATTRIB_Type) < 0)
4634 0 : goto out;
4635 1184 : if (PyType_Ready(&xattr_EA_Type) < 0)
4636 0 : goto out;
4637 1184 : if (PyType_Ready(&xattr_DosEAs_Type) < 0)
4638 0 : goto out;
4639 1184 : if (PyType_Ready(&tdb_xattrs_Type) < 0)
4640 0 : goto out;
4641 1184 : if (PyType_Ready(&xattr_DosStream_Type) < 0)
4642 0 : goto out;
4643 1184 : if (PyType_Ready(&xattr_DosStreams_Type) < 0)
4644 0 : goto out;
4645 1184 : if (PyType_Ready(&security_descriptor_hash_v2_Type) < 0)
4646 0 : goto out;
4647 1184 : if (PyType_Ready(&security_descriptor_hash_v3_Type) < 0)
4648 0 : goto out;
4649 1184 : if (PyType_Ready(&security_descriptor_hash_v4_Type) < 0)
4650 0 : goto out;
4651 1184 : if (PyType_Ready(&xattr_NTACL_Info_Type) < 0)
4652 0 : goto out;
4653 1184 : if (PyType_Ready(&xattr_NTACL_Type) < 0)
4654 0 : goto out;
4655 1184 : if (PyType_Ready(&xattr_sys_acl_hash_wrapper_Type) < 0)
4656 0 : goto out;
4657 : #ifdef PY_DOSINFOFFFFCOMPAT_PATCH
4658 : PY_DOSINFOFFFFCOMPAT_PATCH(&xattr_DosInfoFFFFCompat_Type);
4659 : #endif
4660 : #ifdef PY_DOSINFO1_PATCH
4661 : PY_DOSINFO1_PATCH(&xattr_DosInfo1_Type);
4662 : #endif
4663 : #ifdef PY_DOSINFO2OLD_PATCH
4664 : PY_DOSINFO2OLD_PATCH(&xattr_DosInfo2Old_Type);
4665 : #endif
4666 : #ifdef PY_DOSINFO3_PATCH
4667 : PY_DOSINFO3_PATCH(&xattr_DosInfo3_Type);
4668 : #endif
4669 : #ifdef PY_DOSINFO4_PATCH
4670 : PY_DOSINFO4_PATCH(&xattr_DosInfo4_Type);
4671 : #endif
4672 : #ifdef PY_DOSINFO5_PATCH
4673 : PY_DOSINFO5_PATCH(&xattr_DosInfo5_Type);
4674 : #endif
4675 : #ifdef PY_DOSINFO_PATCH
4676 : PY_DOSINFO_PATCH(&xattr_DosInfo_Type);
4677 : #endif
4678 : #ifdef PY_DOSATTRIB_PATCH
4679 : PY_DOSATTRIB_PATCH(&xattr_DosAttrib_Type);
4680 : #endif
4681 : #ifdef PY_DOSATTRIB_PATCH
4682 : PY_DOSATTRIB_PATCH(&xattr_DOSATTRIB_Type);
4683 : #endif
4684 : #ifdef PY_EA_PATCH
4685 : PY_EA_PATCH(&xattr_EA_Type);
4686 : #endif
4687 : #ifdef PY_DOSEAS_PATCH
4688 : PY_DOSEAS_PATCH(&xattr_DosEAs_Type);
4689 : #endif
4690 : #ifdef PY_TDB_XATTRS_PATCH
4691 : PY_TDB_XATTRS_PATCH(&tdb_xattrs_Type);
4692 : #endif
4693 : #ifdef PY_DOSSTREAM_PATCH
4694 : PY_DOSSTREAM_PATCH(&xattr_DosStream_Type);
4695 : #endif
4696 : #ifdef PY_DOSSTREAMS_PATCH
4697 : PY_DOSSTREAMS_PATCH(&xattr_DosStreams_Type);
4698 : #endif
4699 : #ifdef PY_SECURITY_DESCRIPTOR_HASH_V2_PATCH
4700 : PY_SECURITY_DESCRIPTOR_HASH_V2_PATCH(&security_descriptor_hash_v2_Type);
4701 : #endif
4702 : #ifdef PY_SECURITY_DESCRIPTOR_HASH_V3_PATCH
4703 : PY_SECURITY_DESCRIPTOR_HASH_V3_PATCH(&security_descriptor_hash_v3_Type);
4704 : #endif
4705 : #ifdef PY_SECURITY_DESCRIPTOR_HASH_V4_PATCH
4706 : PY_SECURITY_DESCRIPTOR_HASH_V4_PATCH(&security_descriptor_hash_v4_Type);
4707 : #endif
4708 : #ifdef PY_NTACL_INFO_PATCH
4709 : PY_NTACL_INFO_PATCH(&xattr_NTACL_Info_Type);
4710 : #endif
4711 : #ifdef PY_NTACL_PATCH
4712 1184 : PY_NTACL_PATCH(&xattr_NTACL_Type);
4713 : #endif
4714 : #ifdef PY_SYS_ACL_HASH_WRAPPER_PATCH
4715 : PY_SYS_ACL_HASH_WRAPPER_PATCH(&xattr_sys_acl_hash_wrapper_Type);
4716 : #endif
4717 :
4718 1184 : m = PyModule_Create(&moduledef);
4719 1184 : if (m == NULL)
4720 0 : goto out;
4721 :
4722 1184 : PyModule_AddObject(m, "XATTR_DOSATTRIB_NAME", PyUnicode_FromString("user.DosAttrib"));
4723 1184 : PyModule_AddObject(m, "XATTR_DOSATTRIB_NAME_S3", PyUnicode_FromString("user.DOSATTRIB"));
4724 1184 : PyModule_AddObject(m, "XATTR_DOSATTRIB_ESTIMATED_SIZE", PyLong_FromUnsignedLongLong(64));
4725 1184 : PyModule_AddObject(m, "XATTR_DOSEAS_NAME", PyUnicode_FromString("user.DosEAs"));
4726 1184 : PyModule_AddObject(m, "XATTR_DOSSTREAMS_NAME", PyUnicode_FromString("user.DosStreams"));
4727 1184 : PyModule_AddObject(m, "XATTR_STREAM_FLAG_INTERNAL", PyLong_FromUnsignedLongLong(0x00000001));
4728 1184 : PyModule_AddObject(m, "XATTR_DOSSTREAM_PREFIX", PyUnicode_FromString("user.DosStream."));
4729 1184 : PyModule_AddObject(m, "XATTR_MAX_STREAM_SIZE", PyLong_FromUnsignedLongLong(0x4000));
4730 1184 : PyModule_AddObject(m, "XATTR_MAX_STREAM_SIZE_TDB", PyLong_FromUnsignedLongLong(0x100000));
4731 1184 : PyModule_AddObject(m, "XATTR_NTACL_NAME", PyUnicode_FromString("security.NTACL"));
4732 1184 : PyModule_AddObject(m, "XATTR_SD_HASH_SIZE", PyLong_FromUnsignedLongLong(64));
4733 1184 : PyModule_AddObject(m, "XATTR_SD_HASH_TYPE_NONE", PyLong_FromUnsignedLongLong(0x0));
4734 1184 : PyModule_AddObject(m, "XATTR_SD_HASH_TYPE_SHA256", PyLong_FromUnsignedLongLong(0x1));
4735 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_ATTRIB", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_ATTRIB));
4736 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_EA_SIZE", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_EA_SIZE));
4737 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_SIZE", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_SIZE));
4738 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_ALLOC_SIZE", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_ALLOC_SIZE));
4739 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_CREATE_TIME", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_CREATE_TIME));
4740 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_CHANGE_TIME", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_CHANGE_TIME));
4741 1184 : PyModule_AddObject(m, "XATTR_DOSINFO_ITIME", PyLong_FromUnsignedLongLong((uint32_t)XATTR_DOSINFO_ITIME));
4742 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfoFFFFCompat_Type);
4743 1184 : PyModule_AddObject(m, "DosInfoFFFFCompat", (PyObject *)(void *)&xattr_DosInfoFFFFCompat_Type);
4744 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfo1_Type);
4745 1184 : PyModule_AddObject(m, "DosInfo1", (PyObject *)(void *)&xattr_DosInfo1_Type);
4746 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfo2Old_Type);
4747 1184 : PyModule_AddObject(m, "DosInfo2Old", (PyObject *)(void *)&xattr_DosInfo2Old_Type);
4748 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfo3_Type);
4749 1184 : PyModule_AddObject(m, "DosInfo3", (PyObject *)(void *)&xattr_DosInfo3_Type);
4750 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfo4_Type);
4751 1184 : PyModule_AddObject(m, "DosInfo4", (PyObject *)(void *)&xattr_DosInfo4_Type);
4752 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfo5_Type);
4753 1184 : PyModule_AddObject(m, "DosInfo5", (PyObject *)(void *)&xattr_DosInfo5_Type);
4754 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosInfo_Type);
4755 1184 : PyModule_AddObject(m, "DosInfo", (PyObject *)(void *)&xattr_DosInfo_Type);
4756 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosAttrib_Type);
4757 1184 : PyModule_AddObject(m, "DosAttrib", (PyObject *)(void *)&xattr_DosAttrib_Type);
4758 1184 : Py_INCREF((PyObject *)(void *)&xattr_DOSATTRIB_Type);
4759 1184 : PyModule_AddObject(m, "DOSATTRIB", (PyObject *)(void *)&xattr_DOSATTRIB_Type);
4760 1184 : Py_INCREF((PyObject *)(void *)&xattr_EA_Type);
4761 1184 : PyModule_AddObject(m, "EA", (PyObject *)(void *)&xattr_EA_Type);
4762 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosEAs_Type);
4763 1184 : PyModule_AddObject(m, "DosEAs", (PyObject *)(void *)&xattr_DosEAs_Type);
4764 1184 : Py_INCREF((PyObject *)(void *)&tdb_xattrs_Type);
4765 1184 : PyModule_AddObject(m, "tdb_xattrs", (PyObject *)(void *)&tdb_xattrs_Type);
4766 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosStream_Type);
4767 1184 : PyModule_AddObject(m, "DosStream", (PyObject *)(void *)&xattr_DosStream_Type);
4768 1184 : Py_INCREF((PyObject *)(void *)&xattr_DosStreams_Type);
4769 1184 : PyModule_AddObject(m, "DosStreams", (PyObject *)(void *)&xattr_DosStreams_Type);
4770 1184 : Py_INCREF((PyObject *)(void *)&security_descriptor_hash_v2_Type);
4771 1184 : PyModule_AddObject(m, "security_descriptor_hash_v2", (PyObject *)(void *)&security_descriptor_hash_v2_Type);
4772 1184 : Py_INCREF((PyObject *)(void *)&security_descriptor_hash_v3_Type);
4773 1184 : PyModule_AddObject(m, "security_descriptor_hash_v3", (PyObject *)(void *)&security_descriptor_hash_v3_Type);
4774 1184 : Py_INCREF((PyObject *)(void *)&security_descriptor_hash_v4_Type);
4775 1184 : PyModule_AddObject(m, "security_descriptor_hash_v4", (PyObject *)(void *)&security_descriptor_hash_v4_Type);
4776 1184 : Py_INCREF((PyObject *)(void *)&xattr_NTACL_Info_Type);
4777 1184 : PyModule_AddObject(m, "NTACL_Info", (PyObject *)(void *)&xattr_NTACL_Info_Type);
4778 1184 : Py_INCREF((PyObject *)(void *)&xattr_NTACL_Type);
4779 1184 : PyModule_AddObject(m, "NTACL", (PyObject *)(void *)&xattr_NTACL_Type);
4780 1184 : Py_INCREF((PyObject *)(void *)&xattr_sys_acl_hash_wrapper_Type);
4781 1184 : PyModule_AddObject(m, "sys_acl_hash_wrapper", (PyObject *)(void *)&xattr_sys_acl_hash_wrapper_Type);
4782 : #ifdef PY_MOD_XATTR_PATCH
4783 : PY_MOD_XATTR_PATCH(m);
4784 : #endif
4785 1184 : out:
4786 1184 : Py_XDECREF(dep_samba_dcerpc_security);
4787 1184 : Py_XDECREF(dep_talloc);
4788 1184 : return m;
4789 :
4790 : }
|