Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/librpc/gen_ndr/ndr_unixinfo.h"
5 :
6 : #include "librpc/gen_ndr/ndr_security.h"
7 2560 : static enum ndr_err_code ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct unixinfo_GetPWUidInfo *r)
8 : {
9 2560 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
10 2560 : if (ndr_flags & NDR_SCALARS) {
11 2560 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
12 2560 : NDR_CHECK(ndr_push_align(ndr, 4));
13 2560 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
14 2560 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
15 2560 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
16 2560 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
17 2560 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
18 2560 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
19 2560 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
20 2560 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
21 2560 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
22 : }
23 2560 : if (ndr_flags & NDR_BUFFERS) {
24 0 : }
25 2560 : return NDR_ERR_SUCCESS;
26 : }
27 :
28 2048 : static enum ndr_err_code ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct unixinfo_GetPWUidInfo *r)
29 : {
30 2048 : uint32_t size_homedir_0 = 0;
31 2048 : uint32_t length_homedir_0 = 0;
32 2048 : uint32_t size_shell_0 = 0;
33 2048 : uint32_t length_shell_0 = 0;
34 2048 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
35 2048 : if (ndr_flags & NDR_SCALARS) {
36 2048 : NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
37 2048 : NDR_CHECK(ndr_pull_align(ndr, 4));
38 2048 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
39 2048 : NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
40 2048 : NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
41 2048 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->homedir, &size_homedir_0));
42 2048 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->homedir, &length_homedir_0));
43 2048 : if (length_homedir_0 > size_homedir_0) {
44 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_homedir_0, length_homedir_0);
45 : }
46 2048 : NDR_CHECK(ndr_check_string_terminator(ndr, length_homedir_0, sizeof(uint8_t)));
47 2048 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, length_homedir_0, sizeof(uint8_t), CH_UTF8));
48 2048 : NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
49 2048 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->shell, &size_shell_0));
50 2048 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->shell, &length_shell_0));
51 2048 : if (length_shell_0 > size_shell_0) {
52 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_shell_0, length_shell_0);
53 : }
54 2048 : NDR_CHECK(ndr_check_string_terminator(ndr, length_shell_0, sizeof(uint8_t)));
55 2048 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, length_shell_0, sizeof(uint8_t), CH_UTF8));
56 2048 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
57 : }
58 2048 : if (ndr_flags & NDR_BUFFERS) {
59 0 : }
60 2048 : return NDR_ERR_SUCCESS;
61 : }
62 :
63 1024 : _PUBLIC_ void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r)
64 : {
65 1024 : ndr_print_struct(ndr, name, "unixinfo_GetPWUidInfo");
66 1024 : if (r == NULL) { ndr_print_null(ndr); return; }
67 1024 : ndr->depth++;
68 1024 : ndr_print_NTSTATUS(ndr, "status", r->status);
69 1024 : ndr_print_string(ndr, "homedir", r->homedir);
70 1024 : ndr_print_string(ndr, "shell", r->shell);
71 1024 : ndr->depth--;
72 : }
73 :
74 9 : static enum ndr_err_code ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, ndr_flags_type flags, const struct unixinfo_SidToUid *r)
75 : {
76 9 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
77 9 : if (flags & NDR_IN) {
78 4 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
79 : }
80 9 : if (flags & NDR_OUT) {
81 5 : if (r->out.uid == NULL) {
82 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
83 : }
84 5 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
85 5 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
86 : }
87 9 : return NDR_ERR_SUCCESS;
88 : }
89 :
90 8 : static enum ndr_err_code ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, ndr_flags_type flags, struct unixinfo_SidToUid *r)
91 : {
92 8 : TALLOC_CTX *_mem_save_uid_0 = NULL;
93 8 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
94 8 : if (flags & NDR_IN) {
95 4 : NDR_ZERO_STRUCT(r->out);
96 :
97 4 : NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
98 4 : NDR_PULL_ALLOC(ndr, r->out.uid);
99 4 : NDR_ZERO_STRUCTP(r->out.uid);
100 : }
101 8 : if (flags & NDR_OUT) {
102 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
103 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
104 4 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
105 1 : NDR_PULL_ALLOC(ndr, r->out.uid);
106 : }
107 4 : _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
108 4 : NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
109 4 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
110 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
111 4 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
112 : }
113 8 : return NDR_ERR_SUCCESS;
114 : }
115 :
116 2 : _PUBLIC_ void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct unixinfo_SidToUid *r)
117 : {
118 2 : ndr_print_struct(ndr, name, "unixinfo_SidToUid");
119 2 : if (r == NULL) { ndr_print_null(ndr); return; }
120 2 : ndr->depth++;
121 2 : if (flags & NDR_SET_VALUES) {
122 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
123 : }
124 2 : if (flags & NDR_IN) {
125 0 : ndr_print_struct(ndr, "in", "unixinfo_SidToUid");
126 0 : ndr->depth++;
127 0 : ndr_print_dom_sid(ndr, "sid", &r->in.sid);
128 0 : ndr->depth--;
129 : }
130 2 : if (flags & NDR_OUT) {
131 2 : ndr_print_struct(ndr, "out", "unixinfo_SidToUid");
132 2 : ndr->depth++;
133 2 : ndr_print_ptr(ndr, "uid", r->out.uid);
134 2 : ndr->depth++;
135 2 : ndr_print_hyper(ndr, "uid", *r->out.uid);
136 2 : ndr->depth--;
137 2 : ndr_print_NTSTATUS(ndr, "result", r->out.result);
138 2 : ndr->depth--;
139 : }
140 2 : ndr->depth--;
141 : }
142 :
143 9 : static enum ndr_err_code ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, ndr_flags_type flags, const struct unixinfo_UidToSid *r)
144 : {
145 9 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
146 9 : if (flags & NDR_IN) {
147 4 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
148 : }
149 9 : if (flags & NDR_OUT) {
150 5 : if (r->out.sid == NULL) {
151 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
152 : }
153 5 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
154 5 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
155 : }
156 9 : return NDR_ERR_SUCCESS;
157 : }
158 :
159 8 : static enum ndr_err_code ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, ndr_flags_type flags, struct unixinfo_UidToSid *r)
160 : {
161 8 : TALLOC_CTX *_mem_save_sid_0 = NULL;
162 8 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
163 8 : if (flags & NDR_IN) {
164 4 : NDR_ZERO_STRUCT(r->out);
165 :
166 4 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
167 4 : NDR_PULL_ALLOC(ndr, r->out.sid);
168 4 : NDR_ZERO_STRUCTP(r->out.sid);
169 : }
170 8 : if (flags & NDR_OUT) {
171 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
172 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
173 4 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
174 1 : NDR_PULL_ALLOC(ndr, r->out.sid);
175 : }
176 4 : _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
177 4 : NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
178 4 : NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
179 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
180 4 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
181 : }
182 8 : return NDR_ERR_SUCCESS;
183 : }
184 :
185 2 : _PUBLIC_ void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct unixinfo_UidToSid *r)
186 : {
187 2 : ndr_print_struct(ndr, name, "unixinfo_UidToSid");
188 2 : if (r == NULL) { ndr_print_null(ndr); return; }
189 2 : ndr->depth++;
190 2 : if (flags & NDR_SET_VALUES) {
191 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
192 : }
193 2 : if (flags & NDR_IN) {
194 0 : ndr_print_struct(ndr, "in", "unixinfo_UidToSid");
195 0 : ndr->depth++;
196 0 : ndr_print_hyper(ndr, "uid", r->in.uid);
197 0 : ndr->depth--;
198 : }
199 2 : if (flags & NDR_OUT) {
200 2 : ndr_print_struct(ndr, "out", "unixinfo_UidToSid");
201 2 : ndr->depth++;
202 2 : ndr_print_ptr(ndr, "sid", r->out.sid);
203 2 : ndr->depth++;
204 2 : ndr_print_dom_sid(ndr, "sid", r->out.sid);
205 2 : ndr->depth--;
206 2 : ndr_print_NTSTATUS(ndr, "result", r->out.result);
207 2 : ndr->depth--;
208 : }
209 2 : ndr->depth--;
210 : }
211 :
212 9 : static enum ndr_err_code ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, ndr_flags_type flags, const struct unixinfo_SidToGid *r)
213 : {
214 9 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
215 9 : if (flags & NDR_IN) {
216 4 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
217 : }
218 9 : if (flags & NDR_OUT) {
219 5 : if (r->out.gid == NULL) {
220 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
221 : }
222 5 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
223 5 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
224 : }
225 9 : return NDR_ERR_SUCCESS;
226 : }
227 :
228 8 : static enum ndr_err_code ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, ndr_flags_type flags, struct unixinfo_SidToGid *r)
229 : {
230 8 : TALLOC_CTX *_mem_save_gid_0 = NULL;
231 8 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
232 8 : if (flags & NDR_IN) {
233 4 : NDR_ZERO_STRUCT(r->out);
234 :
235 4 : NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
236 4 : NDR_PULL_ALLOC(ndr, r->out.gid);
237 4 : NDR_ZERO_STRUCTP(r->out.gid);
238 : }
239 8 : if (flags & NDR_OUT) {
240 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
241 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
242 4 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
243 1 : NDR_PULL_ALLOC(ndr, r->out.gid);
244 : }
245 4 : _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
246 4 : NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
247 4 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
248 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
249 4 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
250 : }
251 8 : return NDR_ERR_SUCCESS;
252 : }
253 :
254 2 : _PUBLIC_ void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct unixinfo_SidToGid *r)
255 : {
256 2 : ndr_print_struct(ndr, name, "unixinfo_SidToGid");
257 2 : if (r == NULL) { ndr_print_null(ndr); return; }
258 2 : ndr->depth++;
259 2 : if (flags & NDR_SET_VALUES) {
260 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
261 : }
262 2 : if (flags & NDR_IN) {
263 0 : ndr_print_struct(ndr, "in", "unixinfo_SidToGid");
264 0 : ndr->depth++;
265 0 : ndr_print_dom_sid(ndr, "sid", &r->in.sid);
266 0 : ndr->depth--;
267 : }
268 2 : if (flags & NDR_OUT) {
269 2 : ndr_print_struct(ndr, "out", "unixinfo_SidToGid");
270 2 : ndr->depth++;
271 2 : ndr_print_ptr(ndr, "gid", r->out.gid);
272 2 : ndr->depth++;
273 2 : ndr_print_hyper(ndr, "gid", *r->out.gid);
274 2 : ndr->depth--;
275 2 : ndr_print_NTSTATUS(ndr, "result", r->out.result);
276 2 : ndr->depth--;
277 : }
278 2 : ndr->depth--;
279 : }
280 :
281 9 : static enum ndr_err_code ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, ndr_flags_type flags, const struct unixinfo_GidToSid *r)
282 : {
283 9 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
284 9 : if (flags & NDR_IN) {
285 4 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
286 : }
287 9 : if (flags & NDR_OUT) {
288 5 : if (r->out.sid == NULL) {
289 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
290 : }
291 5 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
292 5 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
293 : }
294 9 : return NDR_ERR_SUCCESS;
295 : }
296 :
297 8 : static enum ndr_err_code ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, ndr_flags_type flags, struct unixinfo_GidToSid *r)
298 : {
299 8 : TALLOC_CTX *_mem_save_sid_0 = NULL;
300 8 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
301 8 : if (flags & NDR_IN) {
302 4 : NDR_ZERO_STRUCT(r->out);
303 :
304 4 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
305 4 : NDR_PULL_ALLOC(ndr, r->out.sid);
306 4 : NDR_ZERO_STRUCTP(r->out.sid);
307 : }
308 8 : if (flags & NDR_OUT) {
309 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
310 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
311 4 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
312 1 : NDR_PULL_ALLOC(ndr, r->out.sid);
313 : }
314 4 : _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
315 4 : NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
316 4 : NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
317 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
318 4 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
319 : }
320 8 : return NDR_ERR_SUCCESS;
321 : }
322 :
323 2 : _PUBLIC_ void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct unixinfo_GidToSid *r)
324 : {
325 2 : ndr_print_struct(ndr, name, "unixinfo_GidToSid");
326 2 : if (r == NULL) { ndr_print_null(ndr); return; }
327 2 : ndr->depth++;
328 2 : if (flags & NDR_SET_VALUES) {
329 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
330 : }
331 2 : if (flags & NDR_IN) {
332 0 : ndr_print_struct(ndr, "in", "unixinfo_GidToSid");
333 0 : ndr->depth++;
334 0 : ndr_print_hyper(ndr, "gid", r->in.gid);
335 0 : ndr->depth--;
336 : }
337 2 : if (flags & NDR_OUT) {
338 2 : ndr_print_struct(ndr, "out", "unixinfo_GidToSid");
339 2 : ndr->depth++;
340 2 : ndr_print_ptr(ndr, "sid", r->out.sid);
341 2 : ndr->depth++;
342 2 : ndr_print_dom_sid(ndr, "sid", r->out.sid);
343 2 : ndr->depth--;
344 2 : ndr_print_NTSTATUS(ndr, "result", r->out.result);
345 2 : ndr->depth--;
346 : }
347 2 : ndr->depth--;
348 : }
349 :
350 9 : static enum ndr_err_code ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, ndr_flags_type flags, const struct unixinfo_GetPWUid *r)
351 : {
352 0 : uint32_t cntr_uids_0;
353 0 : uint32_t cntr_infos_0;
354 9 : NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
355 9 : if (flags & NDR_IN) {
356 4 : if (r->in.count == NULL) {
357 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
358 : }
359 4 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
360 4 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, *r->in.count));
361 2052 : for (cntr_uids_0 = 0; cntr_uids_0 < (*r->in.count); cntr_uids_0++) {
362 2048 : NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uids[cntr_uids_0]));
363 : }
364 : }
365 9 : if (flags & NDR_OUT) {
366 5 : if (r->out.count == NULL) {
367 0 : return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
368 : }
369 5 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
370 5 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, *r->out.count));
371 2565 : for (cntr_infos_0 = 0; cntr_infos_0 < (*r->out.count); cntr_infos_0++) {
372 2560 : NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0]));
373 : }
374 5 : NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
375 : }
376 9 : return NDR_ERR_SUCCESS;
377 : }
378 :
379 8 : static enum ndr_err_code ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, ndr_flags_type flags, struct unixinfo_GetPWUid *r)
380 : {
381 8 : uint32_t size_uids_0 = 0;
382 0 : uint32_t cntr_uids_0;
383 8 : uint32_t size_infos_0 = 0;
384 0 : uint32_t cntr_infos_0;
385 8 : TALLOC_CTX *_mem_save_count_0 = NULL;
386 8 : TALLOC_CTX *_mem_save_uids_0 = NULL;
387 8 : TALLOC_CTX *_mem_save_infos_0 = NULL;
388 8 : NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
389 8 : if (flags & NDR_IN) {
390 4 : NDR_ZERO_STRUCT(r->out);
391 :
392 4 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
393 4 : NDR_PULL_ALLOC(ndr, r->in.count);
394 : }
395 4 : _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
396 4 : NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
397 4 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
398 4 : if (*r->in.count > 1023) {
399 0 : return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(*r->in.count), (uint32_t)(0), (uint32_t)(1023));
400 : }
401 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
402 4 : NDR_CHECK(ndr_pull_array_size(ndr, &r->in.uids));
403 4 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.uids, &size_uids_0));
404 4 : NDR_PULL_ALLOC_N(ndr, r->in.uids, size_uids_0);
405 4 : _mem_save_uids_0 = NDR_PULL_GET_MEM_CTX(ndr);
406 4 : NDR_PULL_SET_MEM_CTX(ndr, r->in.uids, 0);
407 2052 : for (cntr_uids_0 = 0; cntr_uids_0 < (size_uids_0); cntr_uids_0++) {
408 2048 : NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uids[cntr_uids_0]));
409 : }
410 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uids_0, 0);
411 4 : NDR_PULL_ALLOC(ndr, r->out.count);
412 4 : *r->out.count = *r->in.count;
413 4 : if (r->in.uids) {
414 4 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.uids, *r->in.count));
415 : }
416 : }
417 8 : if (flags & NDR_OUT) {
418 : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
419 : if (r->in.count == NULL) {
420 : NDR_PULL_ALLOC(ndr, r->in.count);
421 : NDR_ZERO_STRUCTP(r->in.count);
422 : }
423 : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
424 4 : if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
425 1 : NDR_PULL_ALLOC(ndr, r->out.count);
426 : }
427 4 : _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
428 4 : NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
429 4 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
430 4 : if (*r->out.count > 1023) {
431 0 : return ndr_pull_error(ndr, NDR_ERR_RANGE, "value (%"PRIu32") out of range (%"PRIu32" - %"PRIu32")", (uint32_t)(*r->out.count), (uint32_t)(0), (uint32_t)(1023));
432 : }
433 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
434 4 : NDR_CHECK(ndr_pull_array_size(ndr, &r->out.infos));
435 4 : NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.infos, &size_infos_0));
436 4 : NDR_PULL_ALLOC_N(ndr, r->out.infos, size_infos_0);
437 4 : _mem_save_infos_0 = NDR_PULL_GET_MEM_CTX(ndr);
438 4 : NDR_PULL_SET_MEM_CTX(ndr, r->out.infos, 0);
439 2052 : for (cntr_infos_0 = 0; cntr_infos_0 < (size_infos_0); cntr_infos_0++) {
440 2048 : NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0]));
441 : }
442 4 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_0, 0);
443 4 : NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
444 4 : if (r->out.infos) {
445 4 : NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.infos, *r->out.count));
446 : }
447 : }
448 8 : return NDR_ERR_SUCCESS;
449 : }
450 :
451 2 : _PUBLIC_ void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct unixinfo_GetPWUid *r)
452 : {
453 0 : uint32_t cntr_uids_0;
454 0 : uint32_t cntr_infos_0;
455 2 : ndr_print_struct(ndr, name, "unixinfo_GetPWUid");
456 2 : if (r == NULL) { ndr_print_null(ndr); return; }
457 2 : ndr->depth++;
458 2 : if (flags & NDR_SET_VALUES) {
459 0 : ndr->flags |= LIBNDR_PRINT_SET_VALUES;
460 : }
461 2 : if (flags & NDR_IN) {
462 0 : ndr_print_struct(ndr, "in", "unixinfo_GetPWUid");
463 0 : ndr->depth++;
464 0 : ndr_print_ptr(ndr, "count", r->in.count);
465 0 : ndr->depth++;
466 0 : ndr_print_uint32(ndr, "count", *r->in.count);
467 0 : ndr->depth--;
468 0 : ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "uids", (uint32_t)(*r->in.count));
469 0 : ndr->depth++;
470 0 : for (cntr_uids_0 = 0; cntr_uids_0 < (*r->in.count); cntr_uids_0++) {
471 0 : ndr_print_hyper(ndr, "uids", r->in.uids[cntr_uids_0]);
472 : }
473 0 : ndr->depth--;
474 0 : ndr->depth--;
475 : }
476 2 : if (flags & NDR_OUT) {
477 2 : ndr_print_struct(ndr, "out", "unixinfo_GetPWUid");
478 2 : ndr->depth++;
479 2 : ndr_print_ptr(ndr, "count", r->out.count);
480 2 : ndr->depth++;
481 2 : ndr_print_uint32(ndr, "count", *r->out.count);
482 2 : ndr->depth--;
483 2 : ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "infos", (uint32_t)(*r->out.count));
484 2 : ndr->depth++;
485 1026 : for (cntr_infos_0 = 0; cntr_infos_0 < (*r->out.count); cntr_infos_0++) {
486 1024 : ndr_print_unixinfo_GetPWUidInfo(ndr, "infos", &r->out.infos[cntr_infos_0]);
487 : }
488 2 : ndr->depth--;
489 2 : ndr_print_NTSTATUS(ndr, "result", r->out.result);
490 2 : ndr->depth--;
491 : }
492 2 : ndr->depth--;
493 : }
494 :
495 : #ifndef SKIP_NDR_TABLE_unixinfo
496 : static const struct ndr_interface_public_struct unixinfo_public_structs[] = {
497 : { .name = NULL }
498 : };
499 :
500 : static const struct ndr_interface_call unixinfo_calls[] = {
501 : {
502 : "unixinfo_SidToUid",
503 : sizeof(struct unixinfo_SidToUid),
504 : (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToUid,
505 : (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToUid,
506 : (ndr_print_function_t) ndr_print_unixinfo_SidToUid,
507 : { 0, NULL },
508 : { 0, NULL },
509 : },
510 : {
511 : "unixinfo_UidToSid",
512 : sizeof(struct unixinfo_UidToSid),
513 : (ndr_push_flags_fn_t) ndr_push_unixinfo_UidToSid,
514 : (ndr_pull_flags_fn_t) ndr_pull_unixinfo_UidToSid,
515 : (ndr_print_function_t) ndr_print_unixinfo_UidToSid,
516 : { 0, NULL },
517 : { 0, NULL },
518 : },
519 : {
520 : "unixinfo_SidToGid",
521 : sizeof(struct unixinfo_SidToGid),
522 : (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToGid,
523 : (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToGid,
524 : (ndr_print_function_t) ndr_print_unixinfo_SidToGid,
525 : { 0, NULL },
526 : { 0, NULL },
527 : },
528 : {
529 : "unixinfo_GidToSid",
530 : sizeof(struct unixinfo_GidToSid),
531 : (ndr_push_flags_fn_t) ndr_push_unixinfo_GidToSid,
532 : (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GidToSid,
533 : (ndr_print_function_t) ndr_print_unixinfo_GidToSid,
534 : { 0, NULL },
535 : { 0, NULL },
536 : },
537 : {
538 : "unixinfo_GetPWUid",
539 : sizeof(struct unixinfo_GetPWUid),
540 : (ndr_push_flags_fn_t) ndr_push_unixinfo_GetPWUid,
541 : (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GetPWUid,
542 : (ndr_print_function_t) ndr_print_unixinfo_GetPWUid,
543 : { 0, NULL },
544 : { 0, NULL },
545 : },
546 : { .name = NULL }
547 : };
548 :
549 : static const char * const unixinfo_endpoint_strings[] = {
550 : "ncacn_np:[\\pipe\\unixinfo]",
551 : "ncacn_ip_tcp:",
552 : "ncalrpc:",
553 : };
554 :
555 : static const struct ndr_interface_string_array unixinfo_endpoints = {
556 : .count = 3,
557 : .names = unixinfo_endpoint_strings
558 : };
559 :
560 : static const char * const unixinfo_authservice_strings[] = {
561 : "host",
562 : };
563 :
564 : static const struct ndr_interface_string_array unixinfo_authservices = {
565 : .count = 1,
566 : .names = unixinfo_authservice_strings
567 : };
568 :
569 :
570 : const struct ndr_interface_table ndr_table_unixinfo = {
571 : .name = "unixinfo",
572 : .syntax_id = {
573 : {0x9c54e310,0xa955,0x4885,{0xbd,0x31},{0x78,0x78,0x71,0x47,0xdf,0xa6}},
574 : NDR_UNIXINFO_VERSION
575 : },
576 : .helpstring = NDR_UNIXINFO_HELPSTRING,
577 : .num_calls = 5,
578 : .calls = unixinfo_calls,
579 : .num_public_structs = 0,
580 : .public_structs = unixinfo_public_structs,
581 : .endpoints = &unixinfo_endpoints,
582 : .authservices = &unixinfo_authservices
583 : };
584 :
585 : #endif /* SKIP_NDR_TABLE_unixinfo */
|