1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | * server auto-generated by pidl. DO NOT MODIFY!
|
---|
4 | */
|
---|
5 |
|
---|
6 | #include "includes.h"
|
---|
7 | #include "ntdomain.h"
|
---|
8 | #include "librpc/gen_ndr/srv_libnetapi.h"
|
---|
9 |
|
---|
10 | static bool api_NetJoinDomain(struct pipes_struct *p)
|
---|
11 | {
|
---|
12 | const struct ndr_interface_call *call;
|
---|
13 | struct ndr_pull *pull;
|
---|
14 | struct ndr_push *push;
|
---|
15 | enum ndr_err_code ndr_err;
|
---|
16 | struct NetJoinDomain *r;
|
---|
17 |
|
---|
18 | call = &ndr_table_libnetapi.calls[NDR_NETJOINDOMAIN];
|
---|
19 |
|
---|
20 | r = talloc(talloc_tos(), struct NetJoinDomain);
|
---|
21 | if (r == NULL) {
|
---|
22 | return false;
|
---|
23 | }
|
---|
24 |
|
---|
25 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
26 | if (pull == NULL) {
|
---|
27 | talloc_free(r);
|
---|
28 | return false;
|
---|
29 | }
|
---|
30 |
|
---|
31 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
32 | if (p->endian) {
|
---|
33 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
34 | }
|
---|
35 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
36 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
37 | talloc_free(r);
|
---|
38 | return false;
|
---|
39 | }
|
---|
40 |
|
---|
41 | if (DEBUGLEVEL >= 10) {
|
---|
42 | NDR_PRINT_FUNCTION_DEBUG(NetJoinDomain, NDR_IN, r);
|
---|
43 | }
|
---|
44 |
|
---|
45 | r->out.result = _NetJoinDomain(p, r);
|
---|
46 |
|
---|
47 | if (p->rng_fault_state) {
|
---|
48 | talloc_free(r);
|
---|
49 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
50 | return true;
|
---|
51 | }
|
---|
52 |
|
---|
53 | if (DEBUGLEVEL >= 10) {
|
---|
54 | NDR_PRINT_FUNCTION_DEBUG(NetJoinDomain, NDR_OUT | NDR_SET_VALUES, r);
|
---|
55 | }
|
---|
56 |
|
---|
57 | push = ndr_push_init_ctx(r);
|
---|
58 | if (push == NULL) {
|
---|
59 | talloc_free(r);
|
---|
60 | return false;
|
---|
61 | }
|
---|
62 |
|
---|
63 | /*
|
---|
64 | * carry over the pointer count to the reply in case we are
|
---|
65 | * using full pointer. See NDR specification for full pointers
|
---|
66 | */
|
---|
67 | push->ptr_count = pull->ptr_count;
|
---|
68 |
|
---|
69 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
70 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
71 | talloc_free(r);
|
---|
72 | return false;
|
---|
73 | }
|
---|
74 |
|
---|
75 | p->out_data.rdata = ndr_push_blob(push);
|
---|
76 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
77 |
|
---|
78 | talloc_free(r);
|
---|
79 |
|
---|
80 | return true;
|
---|
81 | }
|
---|
82 |
|
---|
83 | static bool api_NetUnjoinDomain(struct pipes_struct *p)
|
---|
84 | {
|
---|
85 | const struct ndr_interface_call *call;
|
---|
86 | struct ndr_pull *pull;
|
---|
87 | struct ndr_push *push;
|
---|
88 | enum ndr_err_code ndr_err;
|
---|
89 | struct NetUnjoinDomain *r;
|
---|
90 |
|
---|
91 | call = &ndr_table_libnetapi.calls[NDR_NETUNJOINDOMAIN];
|
---|
92 |
|
---|
93 | r = talloc(talloc_tos(), struct NetUnjoinDomain);
|
---|
94 | if (r == NULL) {
|
---|
95 | return false;
|
---|
96 | }
|
---|
97 |
|
---|
98 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
99 | if (pull == NULL) {
|
---|
100 | talloc_free(r);
|
---|
101 | return false;
|
---|
102 | }
|
---|
103 |
|
---|
104 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
105 | if (p->endian) {
|
---|
106 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
107 | }
|
---|
108 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
109 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
110 | talloc_free(r);
|
---|
111 | return false;
|
---|
112 | }
|
---|
113 |
|
---|
114 | if (DEBUGLEVEL >= 10) {
|
---|
115 | NDR_PRINT_FUNCTION_DEBUG(NetUnjoinDomain, NDR_IN, r);
|
---|
116 | }
|
---|
117 |
|
---|
118 | r->out.result = _NetUnjoinDomain(p, r);
|
---|
119 |
|
---|
120 | if (p->rng_fault_state) {
|
---|
121 | talloc_free(r);
|
---|
122 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
123 | return true;
|
---|
124 | }
|
---|
125 |
|
---|
126 | if (DEBUGLEVEL >= 10) {
|
---|
127 | NDR_PRINT_FUNCTION_DEBUG(NetUnjoinDomain, NDR_OUT | NDR_SET_VALUES, r);
|
---|
128 | }
|
---|
129 |
|
---|
130 | push = ndr_push_init_ctx(r);
|
---|
131 | if (push == NULL) {
|
---|
132 | talloc_free(r);
|
---|
133 | return false;
|
---|
134 | }
|
---|
135 |
|
---|
136 | /*
|
---|
137 | * carry over the pointer count to the reply in case we are
|
---|
138 | * using full pointer. See NDR specification for full pointers
|
---|
139 | */
|
---|
140 | push->ptr_count = pull->ptr_count;
|
---|
141 |
|
---|
142 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
143 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
144 | talloc_free(r);
|
---|
145 | return false;
|
---|
146 | }
|
---|
147 |
|
---|
148 | p->out_data.rdata = ndr_push_blob(push);
|
---|
149 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
150 |
|
---|
151 | talloc_free(r);
|
---|
152 |
|
---|
153 | return true;
|
---|
154 | }
|
---|
155 |
|
---|
156 | static bool api_NetGetJoinInformation(struct pipes_struct *p)
|
---|
157 | {
|
---|
158 | const struct ndr_interface_call *call;
|
---|
159 | struct ndr_pull *pull;
|
---|
160 | struct ndr_push *push;
|
---|
161 | enum ndr_err_code ndr_err;
|
---|
162 | struct NetGetJoinInformation *r;
|
---|
163 |
|
---|
164 | call = &ndr_table_libnetapi.calls[NDR_NETGETJOININFORMATION];
|
---|
165 |
|
---|
166 | r = talloc(talloc_tos(), struct NetGetJoinInformation);
|
---|
167 | if (r == NULL) {
|
---|
168 | return false;
|
---|
169 | }
|
---|
170 |
|
---|
171 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
172 | if (pull == NULL) {
|
---|
173 | talloc_free(r);
|
---|
174 | return false;
|
---|
175 | }
|
---|
176 |
|
---|
177 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
178 | if (p->endian) {
|
---|
179 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
180 | }
|
---|
181 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
182 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
183 | talloc_free(r);
|
---|
184 | return false;
|
---|
185 | }
|
---|
186 |
|
---|
187 | if (DEBUGLEVEL >= 10) {
|
---|
188 | NDR_PRINT_FUNCTION_DEBUG(NetGetJoinInformation, NDR_IN, r);
|
---|
189 | }
|
---|
190 |
|
---|
191 | ZERO_STRUCT(r->out);
|
---|
192 | r->out.name_buffer = talloc_zero(r, const char *);
|
---|
193 | if (r->out.name_buffer == NULL) {
|
---|
194 | talloc_free(r);
|
---|
195 | return false;
|
---|
196 | }
|
---|
197 |
|
---|
198 | r->out.name_type = talloc_zero(r, uint16_t);
|
---|
199 | if (r->out.name_type == NULL) {
|
---|
200 | talloc_free(r);
|
---|
201 | return false;
|
---|
202 | }
|
---|
203 |
|
---|
204 | r->out.result = _NetGetJoinInformation(p, r);
|
---|
205 |
|
---|
206 | if (p->rng_fault_state) {
|
---|
207 | talloc_free(r);
|
---|
208 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
209 | return true;
|
---|
210 | }
|
---|
211 |
|
---|
212 | if (DEBUGLEVEL >= 10) {
|
---|
213 | NDR_PRINT_FUNCTION_DEBUG(NetGetJoinInformation, NDR_OUT | NDR_SET_VALUES, r);
|
---|
214 | }
|
---|
215 |
|
---|
216 | push = ndr_push_init_ctx(r);
|
---|
217 | if (push == NULL) {
|
---|
218 | talloc_free(r);
|
---|
219 | return false;
|
---|
220 | }
|
---|
221 |
|
---|
222 | /*
|
---|
223 | * carry over the pointer count to the reply in case we are
|
---|
224 | * using full pointer. See NDR specification for full pointers
|
---|
225 | */
|
---|
226 | push->ptr_count = pull->ptr_count;
|
---|
227 |
|
---|
228 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
229 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
230 | talloc_free(r);
|
---|
231 | return false;
|
---|
232 | }
|
---|
233 |
|
---|
234 | p->out_data.rdata = ndr_push_blob(push);
|
---|
235 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
236 |
|
---|
237 | talloc_free(r);
|
---|
238 |
|
---|
239 | return true;
|
---|
240 | }
|
---|
241 |
|
---|
242 | static bool api_NetGetJoinableOUs(struct pipes_struct *p)
|
---|
243 | {
|
---|
244 | const struct ndr_interface_call *call;
|
---|
245 | struct ndr_pull *pull;
|
---|
246 | struct ndr_push *push;
|
---|
247 | enum ndr_err_code ndr_err;
|
---|
248 | struct NetGetJoinableOUs *r;
|
---|
249 |
|
---|
250 | call = &ndr_table_libnetapi.calls[NDR_NETGETJOINABLEOUS];
|
---|
251 |
|
---|
252 | r = talloc(talloc_tos(), struct NetGetJoinableOUs);
|
---|
253 | if (r == NULL) {
|
---|
254 | return false;
|
---|
255 | }
|
---|
256 |
|
---|
257 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
258 | if (pull == NULL) {
|
---|
259 | talloc_free(r);
|
---|
260 | return false;
|
---|
261 | }
|
---|
262 |
|
---|
263 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
264 | if (p->endian) {
|
---|
265 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
266 | }
|
---|
267 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
268 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
269 | talloc_free(r);
|
---|
270 | return false;
|
---|
271 | }
|
---|
272 |
|
---|
273 | if (DEBUGLEVEL >= 10) {
|
---|
274 | NDR_PRINT_FUNCTION_DEBUG(NetGetJoinableOUs, NDR_IN, r);
|
---|
275 | }
|
---|
276 |
|
---|
277 | ZERO_STRUCT(r->out);
|
---|
278 | r->out.ou_count = talloc_zero(r, uint32_t);
|
---|
279 | if (r->out.ou_count == NULL) {
|
---|
280 | talloc_free(r);
|
---|
281 | return false;
|
---|
282 | }
|
---|
283 |
|
---|
284 | r->out.ous = talloc_zero(r, const char * *);
|
---|
285 | if (r->out.ous == NULL) {
|
---|
286 | talloc_free(r);
|
---|
287 | return false;
|
---|
288 | }
|
---|
289 |
|
---|
290 | r->out.result = _NetGetJoinableOUs(p, r);
|
---|
291 |
|
---|
292 | if (p->rng_fault_state) {
|
---|
293 | talloc_free(r);
|
---|
294 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
295 | return true;
|
---|
296 | }
|
---|
297 |
|
---|
298 | if (DEBUGLEVEL >= 10) {
|
---|
299 | NDR_PRINT_FUNCTION_DEBUG(NetGetJoinableOUs, NDR_OUT | NDR_SET_VALUES, r);
|
---|
300 | }
|
---|
301 |
|
---|
302 | push = ndr_push_init_ctx(r);
|
---|
303 | if (push == NULL) {
|
---|
304 | talloc_free(r);
|
---|
305 | return false;
|
---|
306 | }
|
---|
307 |
|
---|
308 | /*
|
---|
309 | * carry over the pointer count to the reply in case we are
|
---|
310 | * using full pointer. See NDR specification for full pointers
|
---|
311 | */
|
---|
312 | push->ptr_count = pull->ptr_count;
|
---|
313 |
|
---|
314 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
315 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
316 | talloc_free(r);
|
---|
317 | return false;
|
---|
318 | }
|
---|
319 |
|
---|
320 | p->out_data.rdata = ndr_push_blob(push);
|
---|
321 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
322 |
|
---|
323 | talloc_free(r);
|
---|
324 |
|
---|
325 | return true;
|
---|
326 | }
|
---|
327 |
|
---|
328 | static bool api_NetRenameMachineInDomain(struct pipes_struct *p)
|
---|
329 | {
|
---|
330 | const struct ndr_interface_call *call;
|
---|
331 | struct ndr_pull *pull;
|
---|
332 | struct ndr_push *push;
|
---|
333 | enum ndr_err_code ndr_err;
|
---|
334 | struct NetRenameMachineInDomain *r;
|
---|
335 |
|
---|
336 | call = &ndr_table_libnetapi.calls[NDR_NETRENAMEMACHINEINDOMAIN];
|
---|
337 |
|
---|
338 | r = talloc(talloc_tos(), struct NetRenameMachineInDomain);
|
---|
339 | if (r == NULL) {
|
---|
340 | return false;
|
---|
341 | }
|
---|
342 |
|
---|
343 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
344 | if (pull == NULL) {
|
---|
345 | talloc_free(r);
|
---|
346 | return false;
|
---|
347 | }
|
---|
348 |
|
---|
349 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
350 | if (p->endian) {
|
---|
351 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
352 | }
|
---|
353 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
354 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
355 | talloc_free(r);
|
---|
356 | return false;
|
---|
357 | }
|
---|
358 |
|
---|
359 | if (DEBUGLEVEL >= 10) {
|
---|
360 | NDR_PRINT_FUNCTION_DEBUG(NetRenameMachineInDomain, NDR_IN, r);
|
---|
361 | }
|
---|
362 |
|
---|
363 | r->out.result = _NetRenameMachineInDomain(p, r);
|
---|
364 |
|
---|
365 | if (p->rng_fault_state) {
|
---|
366 | talloc_free(r);
|
---|
367 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
368 | return true;
|
---|
369 | }
|
---|
370 |
|
---|
371 | if (DEBUGLEVEL >= 10) {
|
---|
372 | NDR_PRINT_FUNCTION_DEBUG(NetRenameMachineInDomain, NDR_OUT | NDR_SET_VALUES, r);
|
---|
373 | }
|
---|
374 |
|
---|
375 | push = ndr_push_init_ctx(r);
|
---|
376 | if (push == NULL) {
|
---|
377 | talloc_free(r);
|
---|
378 | return false;
|
---|
379 | }
|
---|
380 |
|
---|
381 | /*
|
---|
382 | * carry over the pointer count to the reply in case we are
|
---|
383 | * using full pointer. See NDR specification for full pointers
|
---|
384 | */
|
---|
385 | push->ptr_count = pull->ptr_count;
|
---|
386 |
|
---|
387 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
388 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
389 | talloc_free(r);
|
---|
390 | return false;
|
---|
391 | }
|
---|
392 |
|
---|
393 | p->out_data.rdata = ndr_push_blob(push);
|
---|
394 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
395 |
|
---|
396 | talloc_free(r);
|
---|
397 |
|
---|
398 | return true;
|
---|
399 | }
|
---|
400 |
|
---|
401 | static bool api_NetServerGetInfo(struct pipes_struct *p)
|
---|
402 | {
|
---|
403 | const struct ndr_interface_call *call;
|
---|
404 | struct ndr_pull *pull;
|
---|
405 | struct ndr_push *push;
|
---|
406 | enum ndr_err_code ndr_err;
|
---|
407 | struct NetServerGetInfo *r;
|
---|
408 |
|
---|
409 | call = &ndr_table_libnetapi.calls[NDR_NETSERVERGETINFO];
|
---|
410 |
|
---|
411 | r = talloc(talloc_tos(), struct NetServerGetInfo);
|
---|
412 | if (r == NULL) {
|
---|
413 | return false;
|
---|
414 | }
|
---|
415 |
|
---|
416 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
417 | if (pull == NULL) {
|
---|
418 | talloc_free(r);
|
---|
419 | return false;
|
---|
420 | }
|
---|
421 |
|
---|
422 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
423 | if (p->endian) {
|
---|
424 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
425 | }
|
---|
426 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
427 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
428 | talloc_free(r);
|
---|
429 | return false;
|
---|
430 | }
|
---|
431 |
|
---|
432 | if (DEBUGLEVEL >= 10) {
|
---|
433 | NDR_PRINT_FUNCTION_DEBUG(NetServerGetInfo, NDR_IN, r);
|
---|
434 | }
|
---|
435 |
|
---|
436 | ZERO_STRUCT(r->out);
|
---|
437 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
438 | if (r->out.buffer == NULL) {
|
---|
439 | talloc_free(r);
|
---|
440 | return false;
|
---|
441 | }
|
---|
442 |
|
---|
443 | r->out.result = _NetServerGetInfo(p, r);
|
---|
444 |
|
---|
445 | if (p->rng_fault_state) {
|
---|
446 | talloc_free(r);
|
---|
447 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
448 | return true;
|
---|
449 | }
|
---|
450 |
|
---|
451 | if (DEBUGLEVEL >= 10) {
|
---|
452 | NDR_PRINT_FUNCTION_DEBUG(NetServerGetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
453 | }
|
---|
454 |
|
---|
455 | push = ndr_push_init_ctx(r);
|
---|
456 | if (push == NULL) {
|
---|
457 | talloc_free(r);
|
---|
458 | return false;
|
---|
459 | }
|
---|
460 |
|
---|
461 | /*
|
---|
462 | * carry over the pointer count to the reply in case we are
|
---|
463 | * using full pointer. See NDR specification for full pointers
|
---|
464 | */
|
---|
465 | push->ptr_count = pull->ptr_count;
|
---|
466 |
|
---|
467 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
468 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
469 | talloc_free(r);
|
---|
470 | return false;
|
---|
471 | }
|
---|
472 |
|
---|
473 | p->out_data.rdata = ndr_push_blob(push);
|
---|
474 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
475 |
|
---|
476 | talloc_free(r);
|
---|
477 |
|
---|
478 | return true;
|
---|
479 | }
|
---|
480 |
|
---|
481 | static bool api_NetServerSetInfo(struct pipes_struct *p)
|
---|
482 | {
|
---|
483 | const struct ndr_interface_call *call;
|
---|
484 | struct ndr_pull *pull;
|
---|
485 | struct ndr_push *push;
|
---|
486 | enum ndr_err_code ndr_err;
|
---|
487 | struct NetServerSetInfo *r;
|
---|
488 |
|
---|
489 | call = &ndr_table_libnetapi.calls[NDR_NETSERVERSETINFO];
|
---|
490 |
|
---|
491 | r = talloc(talloc_tos(), struct NetServerSetInfo);
|
---|
492 | if (r == NULL) {
|
---|
493 | return false;
|
---|
494 | }
|
---|
495 |
|
---|
496 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
497 | if (pull == NULL) {
|
---|
498 | talloc_free(r);
|
---|
499 | return false;
|
---|
500 | }
|
---|
501 |
|
---|
502 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
503 | if (p->endian) {
|
---|
504 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
505 | }
|
---|
506 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
507 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
508 | talloc_free(r);
|
---|
509 | return false;
|
---|
510 | }
|
---|
511 |
|
---|
512 | if (DEBUGLEVEL >= 10) {
|
---|
513 | NDR_PRINT_FUNCTION_DEBUG(NetServerSetInfo, NDR_IN, r);
|
---|
514 | }
|
---|
515 |
|
---|
516 | ZERO_STRUCT(r->out);
|
---|
517 | r->out.parm_error = talloc_zero(r, uint32_t);
|
---|
518 | if (r->out.parm_error == NULL) {
|
---|
519 | talloc_free(r);
|
---|
520 | return false;
|
---|
521 | }
|
---|
522 |
|
---|
523 | r->out.result = _NetServerSetInfo(p, r);
|
---|
524 |
|
---|
525 | if (p->rng_fault_state) {
|
---|
526 | talloc_free(r);
|
---|
527 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
528 | return true;
|
---|
529 | }
|
---|
530 |
|
---|
531 | if (DEBUGLEVEL >= 10) {
|
---|
532 | NDR_PRINT_FUNCTION_DEBUG(NetServerSetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
533 | }
|
---|
534 |
|
---|
535 | push = ndr_push_init_ctx(r);
|
---|
536 | if (push == NULL) {
|
---|
537 | talloc_free(r);
|
---|
538 | return false;
|
---|
539 | }
|
---|
540 |
|
---|
541 | /*
|
---|
542 | * carry over the pointer count to the reply in case we are
|
---|
543 | * using full pointer. See NDR specification for full pointers
|
---|
544 | */
|
---|
545 | push->ptr_count = pull->ptr_count;
|
---|
546 |
|
---|
547 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
548 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
549 | talloc_free(r);
|
---|
550 | return false;
|
---|
551 | }
|
---|
552 |
|
---|
553 | p->out_data.rdata = ndr_push_blob(push);
|
---|
554 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
555 |
|
---|
556 | talloc_free(r);
|
---|
557 |
|
---|
558 | return true;
|
---|
559 | }
|
---|
560 |
|
---|
561 | static bool api_NetGetDCName(struct pipes_struct *p)
|
---|
562 | {
|
---|
563 | const struct ndr_interface_call *call;
|
---|
564 | struct ndr_pull *pull;
|
---|
565 | struct ndr_push *push;
|
---|
566 | enum ndr_err_code ndr_err;
|
---|
567 | struct NetGetDCName *r;
|
---|
568 |
|
---|
569 | call = &ndr_table_libnetapi.calls[NDR_NETGETDCNAME];
|
---|
570 |
|
---|
571 | r = talloc(talloc_tos(), struct NetGetDCName);
|
---|
572 | if (r == NULL) {
|
---|
573 | return false;
|
---|
574 | }
|
---|
575 |
|
---|
576 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
577 | if (pull == NULL) {
|
---|
578 | talloc_free(r);
|
---|
579 | return false;
|
---|
580 | }
|
---|
581 |
|
---|
582 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
583 | if (p->endian) {
|
---|
584 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
585 | }
|
---|
586 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
587 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
588 | talloc_free(r);
|
---|
589 | return false;
|
---|
590 | }
|
---|
591 |
|
---|
592 | if (DEBUGLEVEL >= 10) {
|
---|
593 | NDR_PRINT_FUNCTION_DEBUG(NetGetDCName, NDR_IN, r);
|
---|
594 | }
|
---|
595 |
|
---|
596 | ZERO_STRUCT(r->out);
|
---|
597 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
598 | if (r->out.buffer == NULL) {
|
---|
599 | talloc_free(r);
|
---|
600 | return false;
|
---|
601 | }
|
---|
602 |
|
---|
603 | r->out.result = _NetGetDCName(p, r);
|
---|
604 |
|
---|
605 | if (p->rng_fault_state) {
|
---|
606 | talloc_free(r);
|
---|
607 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
608 | return true;
|
---|
609 | }
|
---|
610 |
|
---|
611 | if (DEBUGLEVEL >= 10) {
|
---|
612 | NDR_PRINT_FUNCTION_DEBUG(NetGetDCName, NDR_OUT | NDR_SET_VALUES, r);
|
---|
613 | }
|
---|
614 |
|
---|
615 | push = ndr_push_init_ctx(r);
|
---|
616 | if (push == NULL) {
|
---|
617 | talloc_free(r);
|
---|
618 | return false;
|
---|
619 | }
|
---|
620 |
|
---|
621 | /*
|
---|
622 | * carry over the pointer count to the reply in case we are
|
---|
623 | * using full pointer. See NDR specification for full pointers
|
---|
624 | */
|
---|
625 | push->ptr_count = pull->ptr_count;
|
---|
626 |
|
---|
627 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
628 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
629 | talloc_free(r);
|
---|
630 | return false;
|
---|
631 | }
|
---|
632 |
|
---|
633 | p->out_data.rdata = ndr_push_blob(push);
|
---|
634 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
635 |
|
---|
636 | talloc_free(r);
|
---|
637 |
|
---|
638 | return true;
|
---|
639 | }
|
---|
640 |
|
---|
641 | static bool api_NetGetAnyDCName(struct pipes_struct *p)
|
---|
642 | {
|
---|
643 | const struct ndr_interface_call *call;
|
---|
644 | struct ndr_pull *pull;
|
---|
645 | struct ndr_push *push;
|
---|
646 | enum ndr_err_code ndr_err;
|
---|
647 | struct NetGetAnyDCName *r;
|
---|
648 |
|
---|
649 | call = &ndr_table_libnetapi.calls[NDR_NETGETANYDCNAME];
|
---|
650 |
|
---|
651 | r = talloc(talloc_tos(), struct NetGetAnyDCName);
|
---|
652 | if (r == NULL) {
|
---|
653 | return false;
|
---|
654 | }
|
---|
655 |
|
---|
656 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
657 | if (pull == NULL) {
|
---|
658 | talloc_free(r);
|
---|
659 | return false;
|
---|
660 | }
|
---|
661 |
|
---|
662 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
663 | if (p->endian) {
|
---|
664 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
665 | }
|
---|
666 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
667 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
668 | talloc_free(r);
|
---|
669 | return false;
|
---|
670 | }
|
---|
671 |
|
---|
672 | if (DEBUGLEVEL >= 10) {
|
---|
673 | NDR_PRINT_FUNCTION_DEBUG(NetGetAnyDCName, NDR_IN, r);
|
---|
674 | }
|
---|
675 |
|
---|
676 | ZERO_STRUCT(r->out);
|
---|
677 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
678 | if (r->out.buffer == NULL) {
|
---|
679 | talloc_free(r);
|
---|
680 | return false;
|
---|
681 | }
|
---|
682 |
|
---|
683 | r->out.result = _NetGetAnyDCName(p, r);
|
---|
684 |
|
---|
685 | if (p->rng_fault_state) {
|
---|
686 | talloc_free(r);
|
---|
687 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
688 | return true;
|
---|
689 | }
|
---|
690 |
|
---|
691 | if (DEBUGLEVEL >= 10) {
|
---|
692 | NDR_PRINT_FUNCTION_DEBUG(NetGetAnyDCName, NDR_OUT | NDR_SET_VALUES, r);
|
---|
693 | }
|
---|
694 |
|
---|
695 | push = ndr_push_init_ctx(r);
|
---|
696 | if (push == NULL) {
|
---|
697 | talloc_free(r);
|
---|
698 | return false;
|
---|
699 | }
|
---|
700 |
|
---|
701 | /*
|
---|
702 | * carry over the pointer count to the reply in case we are
|
---|
703 | * using full pointer. See NDR specification for full pointers
|
---|
704 | */
|
---|
705 | push->ptr_count = pull->ptr_count;
|
---|
706 |
|
---|
707 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
708 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
709 | talloc_free(r);
|
---|
710 | return false;
|
---|
711 | }
|
---|
712 |
|
---|
713 | p->out_data.rdata = ndr_push_blob(push);
|
---|
714 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
715 |
|
---|
716 | talloc_free(r);
|
---|
717 |
|
---|
718 | return true;
|
---|
719 | }
|
---|
720 |
|
---|
721 | static bool api_DsGetDcName(struct pipes_struct *p)
|
---|
722 | {
|
---|
723 | const struct ndr_interface_call *call;
|
---|
724 | struct ndr_pull *pull;
|
---|
725 | struct ndr_push *push;
|
---|
726 | enum ndr_err_code ndr_err;
|
---|
727 | struct DsGetDcName *r;
|
---|
728 |
|
---|
729 | call = &ndr_table_libnetapi.calls[NDR_DSGETDCNAME];
|
---|
730 |
|
---|
731 | r = talloc(talloc_tos(), struct DsGetDcName);
|
---|
732 | if (r == NULL) {
|
---|
733 | return false;
|
---|
734 | }
|
---|
735 |
|
---|
736 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
737 | if (pull == NULL) {
|
---|
738 | talloc_free(r);
|
---|
739 | return false;
|
---|
740 | }
|
---|
741 |
|
---|
742 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
743 | if (p->endian) {
|
---|
744 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
745 | }
|
---|
746 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
747 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
748 | talloc_free(r);
|
---|
749 | return false;
|
---|
750 | }
|
---|
751 |
|
---|
752 | if (DEBUGLEVEL >= 10) {
|
---|
753 | NDR_PRINT_FUNCTION_DEBUG(DsGetDcName, NDR_IN, r);
|
---|
754 | }
|
---|
755 |
|
---|
756 | ZERO_STRUCT(r->out);
|
---|
757 | r->out.dc_info = talloc_zero(r, struct DOMAIN_CONTROLLER_INFO *);
|
---|
758 | if (r->out.dc_info == NULL) {
|
---|
759 | talloc_free(r);
|
---|
760 | return false;
|
---|
761 | }
|
---|
762 |
|
---|
763 | r->out.result = _DsGetDcName(p, r);
|
---|
764 |
|
---|
765 | if (p->rng_fault_state) {
|
---|
766 | talloc_free(r);
|
---|
767 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
768 | return true;
|
---|
769 | }
|
---|
770 |
|
---|
771 | if (DEBUGLEVEL >= 10) {
|
---|
772 | NDR_PRINT_FUNCTION_DEBUG(DsGetDcName, NDR_OUT | NDR_SET_VALUES, r);
|
---|
773 | }
|
---|
774 |
|
---|
775 | push = ndr_push_init_ctx(r);
|
---|
776 | if (push == NULL) {
|
---|
777 | talloc_free(r);
|
---|
778 | return false;
|
---|
779 | }
|
---|
780 |
|
---|
781 | /*
|
---|
782 | * carry over the pointer count to the reply in case we are
|
---|
783 | * using full pointer. See NDR specification for full pointers
|
---|
784 | */
|
---|
785 | push->ptr_count = pull->ptr_count;
|
---|
786 |
|
---|
787 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
788 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
789 | talloc_free(r);
|
---|
790 | return false;
|
---|
791 | }
|
---|
792 |
|
---|
793 | p->out_data.rdata = ndr_push_blob(push);
|
---|
794 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
795 |
|
---|
796 | talloc_free(r);
|
---|
797 |
|
---|
798 | return true;
|
---|
799 | }
|
---|
800 |
|
---|
801 | static bool api_NetUserAdd(struct pipes_struct *p)
|
---|
802 | {
|
---|
803 | const struct ndr_interface_call *call;
|
---|
804 | struct ndr_pull *pull;
|
---|
805 | struct ndr_push *push;
|
---|
806 | enum ndr_err_code ndr_err;
|
---|
807 | struct NetUserAdd *r;
|
---|
808 |
|
---|
809 | call = &ndr_table_libnetapi.calls[NDR_NETUSERADD];
|
---|
810 |
|
---|
811 | r = talloc(talloc_tos(), struct NetUserAdd);
|
---|
812 | if (r == NULL) {
|
---|
813 | return false;
|
---|
814 | }
|
---|
815 |
|
---|
816 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
817 | if (pull == NULL) {
|
---|
818 | talloc_free(r);
|
---|
819 | return false;
|
---|
820 | }
|
---|
821 |
|
---|
822 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
823 | if (p->endian) {
|
---|
824 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
825 | }
|
---|
826 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
827 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
828 | talloc_free(r);
|
---|
829 | return false;
|
---|
830 | }
|
---|
831 |
|
---|
832 | if (DEBUGLEVEL >= 10) {
|
---|
833 | NDR_PRINT_FUNCTION_DEBUG(NetUserAdd, NDR_IN, r);
|
---|
834 | }
|
---|
835 |
|
---|
836 | ZERO_STRUCT(r->out);
|
---|
837 | r->out.parm_error = talloc_zero(r, uint32_t);
|
---|
838 | if (r->out.parm_error == NULL) {
|
---|
839 | talloc_free(r);
|
---|
840 | return false;
|
---|
841 | }
|
---|
842 |
|
---|
843 | r->out.result = _NetUserAdd(p, r);
|
---|
844 |
|
---|
845 | if (p->rng_fault_state) {
|
---|
846 | talloc_free(r);
|
---|
847 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
848 | return true;
|
---|
849 | }
|
---|
850 |
|
---|
851 | if (DEBUGLEVEL >= 10) {
|
---|
852 | NDR_PRINT_FUNCTION_DEBUG(NetUserAdd, NDR_OUT | NDR_SET_VALUES, r);
|
---|
853 | }
|
---|
854 |
|
---|
855 | push = ndr_push_init_ctx(r);
|
---|
856 | if (push == NULL) {
|
---|
857 | talloc_free(r);
|
---|
858 | return false;
|
---|
859 | }
|
---|
860 |
|
---|
861 | /*
|
---|
862 | * carry over the pointer count to the reply in case we are
|
---|
863 | * using full pointer. See NDR specification for full pointers
|
---|
864 | */
|
---|
865 | push->ptr_count = pull->ptr_count;
|
---|
866 |
|
---|
867 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
868 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
869 | talloc_free(r);
|
---|
870 | return false;
|
---|
871 | }
|
---|
872 |
|
---|
873 | p->out_data.rdata = ndr_push_blob(push);
|
---|
874 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
875 |
|
---|
876 | talloc_free(r);
|
---|
877 |
|
---|
878 | return true;
|
---|
879 | }
|
---|
880 |
|
---|
881 | static bool api_NetUserDel(struct pipes_struct *p)
|
---|
882 | {
|
---|
883 | const struct ndr_interface_call *call;
|
---|
884 | struct ndr_pull *pull;
|
---|
885 | struct ndr_push *push;
|
---|
886 | enum ndr_err_code ndr_err;
|
---|
887 | struct NetUserDel *r;
|
---|
888 |
|
---|
889 | call = &ndr_table_libnetapi.calls[NDR_NETUSERDEL];
|
---|
890 |
|
---|
891 | r = talloc(talloc_tos(), struct NetUserDel);
|
---|
892 | if (r == NULL) {
|
---|
893 | return false;
|
---|
894 | }
|
---|
895 |
|
---|
896 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
897 | if (pull == NULL) {
|
---|
898 | talloc_free(r);
|
---|
899 | return false;
|
---|
900 | }
|
---|
901 |
|
---|
902 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
903 | if (p->endian) {
|
---|
904 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
905 | }
|
---|
906 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
907 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
908 | talloc_free(r);
|
---|
909 | return false;
|
---|
910 | }
|
---|
911 |
|
---|
912 | if (DEBUGLEVEL >= 10) {
|
---|
913 | NDR_PRINT_FUNCTION_DEBUG(NetUserDel, NDR_IN, r);
|
---|
914 | }
|
---|
915 |
|
---|
916 | r->out.result = _NetUserDel(p, r);
|
---|
917 |
|
---|
918 | if (p->rng_fault_state) {
|
---|
919 | talloc_free(r);
|
---|
920 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
921 | return true;
|
---|
922 | }
|
---|
923 |
|
---|
924 | if (DEBUGLEVEL >= 10) {
|
---|
925 | NDR_PRINT_FUNCTION_DEBUG(NetUserDel, NDR_OUT | NDR_SET_VALUES, r);
|
---|
926 | }
|
---|
927 |
|
---|
928 | push = ndr_push_init_ctx(r);
|
---|
929 | if (push == NULL) {
|
---|
930 | talloc_free(r);
|
---|
931 | return false;
|
---|
932 | }
|
---|
933 |
|
---|
934 | /*
|
---|
935 | * carry over the pointer count to the reply in case we are
|
---|
936 | * using full pointer. See NDR specification for full pointers
|
---|
937 | */
|
---|
938 | push->ptr_count = pull->ptr_count;
|
---|
939 |
|
---|
940 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
941 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
942 | talloc_free(r);
|
---|
943 | return false;
|
---|
944 | }
|
---|
945 |
|
---|
946 | p->out_data.rdata = ndr_push_blob(push);
|
---|
947 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
948 |
|
---|
949 | talloc_free(r);
|
---|
950 |
|
---|
951 | return true;
|
---|
952 | }
|
---|
953 |
|
---|
954 | static bool api_NetUserEnum(struct pipes_struct *p)
|
---|
955 | {
|
---|
956 | const struct ndr_interface_call *call;
|
---|
957 | struct ndr_pull *pull;
|
---|
958 | struct ndr_push *push;
|
---|
959 | enum ndr_err_code ndr_err;
|
---|
960 | struct NetUserEnum *r;
|
---|
961 |
|
---|
962 | call = &ndr_table_libnetapi.calls[NDR_NETUSERENUM];
|
---|
963 |
|
---|
964 | r = talloc(talloc_tos(), struct NetUserEnum);
|
---|
965 | if (r == NULL) {
|
---|
966 | return false;
|
---|
967 | }
|
---|
968 |
|
---|
969 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
970 | if (pull == NULL) {
|
---|
971 | talloc_free(r);
|
---|
972 | return false;
|
---|
973 | }
|
---|
974 |
|
---|
975 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
976 | if (p->endian) {
|
---|
977 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
978 | }
|
---|
979 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
980 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
981 | talloc_free(r);
|
---|
982 | return false;
|
---|
983 | }
|
---|
984 |
|
---|
985 | if (DEBUGLEVEL >= 10) {
|
---|
986 | NDR_PRINT_FUNCTION_DEBUG(NetUserEnum, NDR_IN, r);
|
---|
987 | }
|
---|
988 |
|
---|
989 | ZERO_STRUCT(r->out);
|
---|
990 | r->out.resume_handle = r->in.resume_handle;
|
---|
991 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
992 | if (r->out.buffer == NULL) {
|
---|
993 | talloc_free(r);
|
---|
994 | return false;
|
---|
995 | }
|
---|
996 |
|
---|
997 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
998 | if (r->out.entries_read == NULL) {
|
---|
999 | talloc_free(r);
|
---|
1000 | return false;
|
---|
1001 | }
|
---|
1002 |
|
---|
1003 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
1004 | if (r->out.total_entries == NULL) {
|
---|
1005 | talloc_free(r);
|
---|
1006 | return false;
|
---|
1007 | }
|
---|
1008 |
|
---|
1009 | r->out.result = _NetUserEnum(p, r);
|
---|
1010 |
|
---|
1011 | if (p->rng_fault_state) {
|
---|
1012 | talloc_free(r);
|
---|
1013 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1014 | return true;
|
---|
1015 | }
|
---|
1016 |
|
---|
1017 | if (DEBUGLEVEL >= 10) {
|
---|
1018 | NDR_PRINT_FUNCTION_DEBUG(NetUserEnum, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1019 | }
|
---|
1020 |
|
---|
1021 | push = ndr_push_init_ctx(r);
|
---|
1022 | if (push == NULL) {
|
---|
1023 | talloc_free(r);
|
---|
1024 | return false;
|
---|
1025 | }
|
---|
1026 |
|
---|
1027 | /*
|
---|
1028 | * carry over the pointer count to the reply in case we are
|
---|
1029 | * using full pointer. See NDR specification for full pointers
|
---|
1030 | */
|
---|
1031 | push->ptr_count = pull->ptr_count;
|
---|
1032 |
|
---|
1033 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1034 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1035 | talloc_free(r);
|
---|
1036 | return false;
|
---|
1037 | }
|
---|
1038 |
|
---|
1039 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1040 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1041 |
|
---|
1042 | talloc_free(r);
|
---|
1043 |
|
---|
1044 | return true;
|
---|
1045 | }
|
---|
1046 |
|
---|
1047 | static bool api_NetUserChangePassword(struct pipes_struct *p)
|
---|
1048 | {
|
---|
1049 | const struct ndr_interface_call *call;
|
---|
1050 | struct ndr_pull *pull;
|
---|
1051 | struct ndr_push *push;
|
---|
1052 | enum ndr_err_code ndr_err;
|
---|
1053 | struct NetUserChangePassword *r;
|
---|
1054 |
|
---|
1055 | call = &ndr_table_libnetapi.calls[NDR_NETUSERCHANGEPASSWORD];
|
---|
1056 |
|
---|
1057 | r = talloc(talloc_tos(), struct NetUserChangePassword);
|
---|
1058 | if (r == NULL) {
|
---|
1059 | return false;
|
---|
1060 | }
|
---|
1061 |
|
---|
1062 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1063 | if (pull == NULL) {
|
---|
1064 | talloc_free(r);
|
---|
1065 | return false;
|
---|
1066 | }
|
---|
1067 |
|
---|
1068 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1069 | if (p->endian) {
|
---|
1070 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1071 | }
|
---|
1072 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1073 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1074 | talloc_free(r);
|
---|
1075 | return false;
|
---|
1076 | }
|
---|
1077 |
|
---|
1078 | if (DEBUGLEVEL >= 10) {
|
---|
1079 | NDR_PRINT_FUNCTION_DEBUG(NetUserChangePassword, NDR_IN, r);
|
---|
1080 | }
|
---|
1081 |
|
---|
1082 | r->out.result = _NetUserChangePassword(p, r);
|
---|
1083 |
|
---|
1084 | if (p->rng_fault_state) {
|
---|
1085 | talloc_free(r);
|
---|
1086 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1087 | return true;
|
---|
1088 | }
|
---|
1089 |
|
---|
1090 | if (DEBUGLEVEL >= 10) {
|
---|
1091 | NDR_PRINT_FUNCTION_DEBUG(NetUserChangePassword, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1092 | }
|
---|
1093 |
|
---|
1094 | push = ndr_push_init_ctx(r);
|
---|
1095 | if (push == NULL) {
|
---|
1096 | talloc_free(r);
|
---|
1097 | return false;
|
---|
1098 | }
|
---|
1099 |
|
---|
1100 | /*
|
---|
1101 | * carry over the pointer count to the reply in case we are
|
---|
1102 | * using full pointer. See NDR specification for full pointers
|
---|
1103 | */
|
---|
1104 | push->ptr_count = pull->ptr_count;
|
---|
1105 |
|
---|
1106 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1107 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1108 | talloc_free(r);
|
---|
1109 | return false;
|
---|
1110 | }
|
---|
1111 |
|
---|
1112 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1113 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1114 |
|
---|
1115 | talloc_free(r);
|
---|
1116 |
|
---|
1117 | return true;
|
---|
1118 | }
|
---|
1119 |
|
---|
1120 | static bool api_NetUserGetInfo(struct pipes_struct *p)
|
---|
1121 | {
|
---|
1122 | const struct ndr_interface_call *call;
|
---|
1123 | struct ndr_pull *pull;
|
---|
1124 | struct ndr_push *push;
|
---|
1125 | enum ndr_err_code ndr_err;
|
---|
1126 | struct NetUserGetInfo *r;
|
---|
1127 |
|
---|
1128 | call = &ndr_table_libnetapi.calls[NDR_NETUSERGETINFO];
|
---|
1129 |
|
---|
1130 | r = talloc(talloc_tos(), struct NetUserGetInfo);
|
---|
1131 | if (r == NULL) {
|
---|
1132 | return false;
|
---|
1133 | }
|
---|
1134 |
|
---|
1135 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1136 | if (pull == NULL) {
|
---|
1137 | talloc_free(r);
|
---|
1138 | return false;
|
---|
1139 | }
|
---|
1140 |
|
---|
1141 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1142 | if (p->endian) {
|
---|
1143 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1144 | }
|
---|
1145 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1146 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1147 | talloc_free(r);
|
---|
1148 | return false;
|
---|
1149 | }
|
---|
1150 |
|
---|
1151 | if (DEBUGLEVEL >= 10) {
|
---|
1152 | NDR_PRINT_FUNCTION_DEBUG(NetUserGetInfo, NDR_IN, r);
|
---|
1153 | }
|
---|
1154 |
|
---|
1155 | ZERO_STRUCT(r->out);
|
---|
1156 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
1157 | if (r->out.buffer == NULL) {
|
---|
1158 | talloc_free(r);
|
---|
1159 | return false;
|
---|
1160 | }
|
---|
1161 |
|
---|
1162 | r->out.result = _NetUserGetInfo(p, r);
|
---|
1163 |
|
---|
1164 | if (p->rng_fault_state) {
|
---|
1165 | talloc_free(r);
|
---|
1166 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1167 | return true;
|
---|
1168 | }
|
---|
1169 |
|
---|
1170 | if (DEBUGLEVEL >= 10) {
|
---|
1171 | NDR_PRINT_FUNCTION_DEBUG(NetUserGetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1172 | }
|
---|
1173 |
|
---|
1174 | push = ndr_push_init_ctx(r);
|
---|
1175 | if (push == NULL) {
|
---|
1176 | talloc_free(r);
|
---|
1177 | return false;
|
---|
1178 | }
|
---|
1179 |
|
---|
1180 | /*
|
---|
1181 | * carry over the pointer count to the reply in case we are
|
---|
1182 | * using full pointer. See NDR specification for full pointers
|
---|
1183 | */
|
---|
1184 | push->ptr_count = pull->ptr_count;
|
---|
1185 |
|
---|
1186 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1187 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1188 | talloc_free(r);
|
---|
1189 | return false;
|
---|
1190 | }
|
---|
1191 |
|
---|
1192 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1193 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1194 |
|
---|
1195 | talloc_free(r);
|
---|
1196 |
|
---|
1197 | return true;
|
---|
1198 | }
|
---|
1199 |
|
---|
1200 | static bool api_NetUserSetInfo(struct pipes_struct *p)
|
---|
1201 | {
|
---|
1202 | const struct ndr_interface_call *call;
|
---|
1203 | struct ndr_pull *pull;
|
---|
1204 | struct ndr_push *push;
|
---|
1205 | enum ndr_err_code ndr_err;
|
---|
1206 | struct NetUserSetInfo *r;
|
---|
1207 |
|
---|
1208 | call = &ndr_table_libnetapi.calls[NDR_NETUSERSETINFO];
|
---|
1209 |
|
---|
1210 | r = talloc(talloc_tos(), struct NetUserSetInfo);
|
---|
1211 | if (r == NULL) {
|
---|
1212 | return false;
|
---|
1213 | }
|
---|
1214 |
|
---|
1215 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1216 | if (pull == NULL) {
|
---|
1217 | talloc_free(r);
|
---|
1218 | return false;
|
---|
1219 | }
|
---|
1220 |
|
---|
1221 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1222 | if (p->endian) {
|
---|
1223 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1224 | }
|
---|
1225 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1226 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1227 | talloc_free(r);
|
---|
1228 | return false;
|
---|
1229 | }
|
---|
1230 |
|
---|
1231 | if (DEBUGLEVEL >= 10) {
|
---|
1232 | NDR_PRINT_FUNCTION_DEBUG(NetUserSetInfo, NDR_IN, r);
|
---|
1233 | }
|
---|
1234 |
|
---|
1235 | ZERO_STRUCT(r->out);
|
---|
1236 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
1237 | if (r->out.parm_err == NULL) {
|
---|
1238 | talloc_free(r);
|
---|
1239 | return false;
|
---|
1240 | }
|
---|
1241 |
|
---|
1242 | r->out.result = _NetUserSetInfo(p, r);
|
---|
1243 |
|
---|
1244 | if (p->rng_fault_state) {
|
---|
1245 | talloc_free(r);
|
---|
1246 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1247 | return true;
|
---|
1248 | }
|
---|
1249 |
|
---|
1250 | if (DEBUGLEVEL >= 10) {
|
---|
1251 | NDR_PRINT_FUNCTION_DEBUG(NetUserSetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1252 | }
|
---|
1253 |
|
---|
1254 | push = ndr_push_init_ctx(r);
|
---|
1255 | if (push == NULL) {
|
---|
1256 | talloc_free(r);
|
---|
1257 | return false;
|
---|
1258 | }
|
---|
1259 |
|
---|
1260 | /*
|
---|
1261 | * carry over the pointer count to the reply in case we are
|
---|
1262 | * using full pointer. See NDR specification for full pointers
|
---|
1263 | */
|
---|
1264 | push->ptr_count = pull->ptr_count;
|
---|
1265 |
|
---|
1266 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1267 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1268 | talloc_free(r);
|
---|
1269 | return false;
|
---|
1270 | }
|
---|
1271 |
|
---|
1272 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1273 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1274 |
|
---|
1275 | talloc_free(r);
|
---|
1276 |
|
---|
1277 | return true;
|
---|
1278 | }
|
---|
1279 |
|
---|
1280 | static bool api_NetUserGetGroups(struct pipes_struct *p)
|
---|
1281 | {
|
---|
1282 | const struct ndr_interface_call *call;
|
---|
1283 | struct ndr_pull *pull;
|
---|
1284 | struct ndr_push *push;
|
---|
1285 | enum ndr_err_code ndr_err;
|
---|
1286 | struct NetUserGetGroups *r;
|
---|
1287 |
|
---|
1288 | call = &ndr_table_libnetapi.calls[NDR_NETUSERGETGROUPS];
|
---|
1289 |
|
---|
1290 | r = talloc(talloc_tos(), struct NetUserGetGroups);
|
---|
1291 | if (r == NULL) {
|
---|
1292 | return false;
|
---|
1293 | }
|
---|
1294 |
|
---|
1295 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1296 | if (pull == NULL) {
|
---|
1297 | talloc_free(r);
|
---|
1298 | return false;
|
---|
1299 | }
|
---|
1300 |
|
---|
1301 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1302 | if (p->endian) {
|
---|
1303 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1304 | }
|
---|
1305 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1306 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1307 | talloc_free(r);
|
---|
1308 | return false;
|
---|
1309 | }
|
---|
1310 |
|
---|
1311 | if (DEBUGLEVEL >= 10) {
|
---|
1312 | NDR_PRINT_FUNCTION_DEBUG(NetUserGetGroups, NDR_IN, r);
|
---|
1313 | }
|
---|
1314 |
|
---|
1315 | ZERO_STRUCT(r->out);
|
---|
1316 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
1317 | if (r->out.buffer == NULL) {
|
---|
1318 | talloc_free(r);
|
---|
1319 | return false;
|
---|
1320 | }
|
---|
1321 |
|
---|
1322 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
1323 | if (r->out.entries_read == NULL) {
|
---|
1324 | talloc_free(r);
|
---|
1325 | return false;
|
---|
1326 | }
|
---|
1327 |
|
---|
1328 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
1329 | if (r->out.total_entries == NULL) {
|
---|
1330 | talloc_free(r);
|
---|
1331 | return false;
|
---|
1332 | }
|
---|
1333 |
|
---|
1334 | r->out.result = _NetUserGetGroups(p, r);
|
---|
1335 |
|
---|
1336 | if (p->rng_fault_state) {
|
---|
1337 | talloc_free(r);
|
---|
1338 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1339 | return true;
|
---|
1340 | }
|
---|
1341 |
|
---|
1342 | if (DEBUGLEVEL >= 10) {
|
---|
1343 | NDR_PRINT_FUNCTION_DEBUG(NetUserGetGroups, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1344 | }
|
---|
1345 |
|
---|
1346 | push = ndr_push_init_ctx(r);
|
---|
1347 | if (push == NULL) {
|
---|
1348 | talloc_free(r);
|
---|
1349 | return false;
|
---|
1350 | }
|
---|
1351 |
|
---|
1352 | /*
|
---|
1353 | * carry over the pointer count to the reply in case we are
|
---|
1354 | * using full pointer. See NDR specification for full pointers
|
---|
1355 | */
|
---|
1356 | push->ptr_count = pull->ptr_count;
|
---|
1357 |
|
---|
1358 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1359 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1360 | talloc_free(r);
|
---|
1361 | return false;
|
---|
1362 | }
|
---|
1363 |
|
---|
1364 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1365 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1366 |
|
---|
1367 | talloc_free(r);
|
---|
1368 |
|
---|
1369 | return true;
|
---|
1370 | }
|
---|
1371 |
|
---|
1372 | static bool api_NetUserSetGroups(struct pipes_struct *p)
|
---|
1373 | {
|
---|
1374 | const struct ndr_interface_call *call;
|
---|
1375 | struct ndr_pull *pull;
|
---|
1376 | struct ndr_push *push;
|
---|
1377 | enum ndr_err_code ndr_err;
|
---|
1378 | struct NetUserSetGroups *r;
|
---|
1379 |
|
---|
1380 | call = &ndr_table_libnetapi.calls[NDR_NETUSERSETGROUPS];
|
---|
1381 |
|
---|
1382 | r = talloc(talloc_tos(), struct NetUserSetGroups);
|
---|
1383 | if (r == NULL) {
|
---|
1384 | return false;
|
---|
1385 | }
|
---|
1386 |
|
---|
1387 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1388 | if (pull == NULL) {
|
---|
1389 | talloc_free(r);
|
---|
1390 | return false;
|
---|
1391 | }
|
---|
1392 |
|
---|
1393 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1394 | if (p->endian) {
|
---|
1395 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1396 | }
|
---|
1397 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1398 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1399 | talloc_free(r);
|
---|
1400 | return false;
|
---|
1401 | }
|
---|
1402 |
|
---|
1403 | if (DEBUGLEVEL >= 10) {
|
---|
1404 | NDR_PRINT_FUNCTION_DEBUG(NetUserSetGroups, NDR_IN, r);
|
---|
1405 | }
|
---|
1406 |
|
---|
1407 | r->out.result = _NetUserSetGroups(p, r);
|
---|
1408 |
|
---|
1409 | if (p->rng_fault_state) {
|
---|
1410 | talloc_free(r);
|
---|
1411 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1412 | return true;
|
---|
1413 | }
|
---|
1414 |
|
---|
1415 | if (DEBUGLEVEL >= 10) {
|
---|
1416 | NDR_PRINT_FUNCTION_DEBUG(NetUserSetGroups, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1417 | }
|
---|
1418 |
|
---|
1419 | push = ndr_push_init_ctx(r);
|
---|
1420 | if (push == NULL) {
|
---|
1421 | talloc_free(r);
|
---|
1422 | return false;
|
---|
1423 | }
|
---|
1424 |
|
---|
1425 | /*
|
---|
1426 | * carry over the pointer count to the reply in case we are
|
---|
1427 | * using full pointer. See NDR specification for full pointers
|
---|
1428 | */
|
---|
1429 | push->ptr_count = pull->ptr_count;
|
---|
1430 |
|
---|
1431 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1432 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1433 | talloc_free(r);
|
---|
1434 | return false;
|
---|
1435 | }
|
---|
1436 |
|
---|
1437 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1438 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1439 |
|
---|
1440 | talloc_free(r);
|
---|
1441 |
|
---|
1442 | return true;
|
---|
1443 | }
|
---|
1444 |
|
---|
1445 | static bool api_NetUserGetLocalGroups(struct pipes_struct *p)
|
---|
1446 | {
|
---|
1447 | const struct ndr_interface_call *call;
|
---|
1448 | struct ndr_pull *pull;
|
---|
1449 | struct ndr_push *push;
|
---|
1450 | enum ndr_err_code ndr_err;
|
---|
1451 | struct NetUserGetLocalGroups *r;
|
---|
1452 |
|
---|
1453 | call = &ndr_table_libnetapi.calls[NDR_NETUSERGETLOCALGROUPS];
|
---|
1454 |
|
---|
1455 | r = talloc(talloc_tos(), struct NetUserGetLocalGroups);
|
---|
1456 | if (r == NULL) {
|
---|
1457 | return false;
|
---|
1458 | }
|
---|
1459 |
|
---|
1460 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1461 | if (pull == NULL) {
|
---|
1462 | talloc_free(r);
|
---|
1463 | return false;
|
---|
1464 | }
|
---|
1465 |
|
---|
1466 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1467 | if (p->endian) {
|
---|
1468 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1469 | }
|
---|
1470 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1471 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1472 | talloc_free(r);
|
---|
1473 | return false;
|
---|
1474 | }
|
---|
1475 |
|
---|
1476 | if (DEBUGLEVEL >= 10) {
|
---|
1477 | NDR_PRINT_FUNCTION_DEBUG(NetUserGetLocalGroups, NDR_IN, r);
|
---|
1478 | }
|
---|
1479 |
|
---|
1480 | ZERO_STRUCT(r->out);
|
---|
1481 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
1482 | if (r->out.buffer == NULL) {
|
---|
1483 | talloc_free(r);
|
---|
1484 | return false;
|
---|
1485 | }
|
---|
1486 |
|
---|
1487 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
1488 | if (r->out.entries_read == NULL) {
|
---|
1489 | talloc_free(r);
|
---|
1490 | return false;
|
---|
1491 | }
|
---|
1492 |
|
---|
1493 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
1494 | if (r->out.total_entries == NULL) {
|
---|
1495 | talloc_free(r);
|
---|
1496 | return false;
|
---|
1497 | }
|
---|
1498 |
|
---|
1499 | r->out.result = _NetUserGetLocalGroups(p, r);
|
---|
1500 |
|
---|
1501 | if (p->rng_fault_state) {
|
---|
1502 | talloc_free(r);
|
---|
1503 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1504 | return true;
|
---|
1505 | }
|
---|
1506 |
|
---|
1507 | if (DEBUGLEVEL >= 10) {
|
---|
1508 | NDR_PRINT_FUNCTION_DEBUG(NetUserGetLocalGroups, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1509 | }
|
---|
1510 |
|
---|
1511 | push = ndr_push_init_ctx(r);
|
---|
1512 | if (push == NULL) {
|
---|
1513 | talloc_free(r);
|
---|
1514 | return false;
|
---|
1515 | }
|
---|
1516 |
|
---|
1517 | /*
|
---|
1518 | * carry over the pointer count to the reply in case we are
|
---|
1519 | * using full pointer. See NDR specification for full pointers
|
---|
1520 | */
|
---|
1521 | push->ptr_count = pull->ptr_count;
|
---|
1522 |
|
---|
1523 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1524 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1525 | talloc_free(r);
|
---|
1526 | return false;
|
---|
1527 | }
|
---|
1528 |
|
---|
1529 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1530 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1531 |
|
---|
1532 | talloc_free(r);
|
---|
1533 |
|
---|
1534 | return true;
|
---|
1535 | }
|
---|
1536 |
|
---|
1537 | static bool api_NetUserModalsGet(struct pipes_struct *p)
|
---|
1538 | {
|
---|
1539 | const struct ndr_interface_call *call;
|
---|
1540 | struct ndr_pull *pull;
|
---|
1541 | struct ndr_push *push;
|
---|
1542 | enum ndr_err_code ndr_err;
|
---|
1543 | struct NetUserModalsGet *r;
|
---|
1544 |
|
---|
1545 | call = &ndr_table_libnetapi.calls[NDR_NETUSERMODALSGET];
|
---|
1546 |
|
---|
1547 | r = talloc(talloc_tos(), struct NetUserModalsGet);
|
---|
1548 | if (r == NULL) {
|
---|
1549 | return false;
|
---|
1550 | }
|
---|
1551 |
|
---|
1552 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1553 | if (pull == NULL) {
|
---|
1554 | talloc_free(r);
|
---|
1555 | return false;
|
---|
1556 | }
|
---|
1557 |
|
---|
1558 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1559 | if (p->endian) {
|
---|
1560 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1561 | }
|
---|
1562 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1563 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1564 | talloc_free(r);
|
---|
1565 | return false;
|
---|
1566 | }
|
---|
1567 |
|
---|
1568 | if (DEBUGLEVEL >= 10) {
|
---|
1569 | NDR_PRINT_FUNCTION_DEBUG(NetUserModalsGet, NDR_IN, r);
|
---|
1570 | }
|
---|
1571 |
|
---|
1572 | ZERO_STRUCT(r->out);
|
---|
1573 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
1574 | if (r->out.buffer == NULL) {
|
---|
1575 | talloc_free(r);
|
---|
1576 | return false;
|
---|
1577 | }
|
---|
1578 |
|
---|
1579 | r->out.result = _NetUserModalsGet(p, r);
|
---|
1580 |
|
---|
1581 | if (p->rng_fault_state) {
|
---|
1582 | talloc_free(r);
|
---|
1583 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1584 | return true;
|
---|
1585 | }
|
---|
1586 |
|
---|
1587 | if (DEBUGLEVEL >= 10) {
|
---|
1588 | NDR_PRINT_FUNCTION_DEBUG(NetUserModalsGet, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1589 | }
|
---|
1590 |
|
---|
1591 | push = ndr_push_init_ctx(r);
|
---|
1592 | if (push == NULL) {
|
---|
1593 | talloc_free(r);
|
---|
1594 | return false;
|
---|
1595 | }
|
---|
1596 |
|
---|
1597 | /*
|
---|
1598 | * carry over the pointer count to the reply in case we are
|
---|
1599 | * using full pointer. See NDR specification for full pointers
|
---|
1600 | */
|
---|
1601 | push->ptr_count = pull->ptr_count;
|
---|
1602 |
|
---|
1603 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1604 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1605 | talloc_free(r);
|
---|
1606 | return false;
|
---|
1607 | }
|
---|
1608 |
|
---|
1609 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1610 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1611 |
|
---|
1612 | talloc_free(r);
|
---|
1613 |
|
---|
1614 | return true;
|
---|
1615 | }
|
---|
1616 |
|
---|
1617 | static bool api_NetUserModalsSet(struct pipes_struct *p)
|
---|
1618 | {
|
---|
1619 | const struct ndr_interface_call *call;
|
---|
1620 | struct ndr_pull *pull;
|
---|
1621 | struct ndr_push *push;
|
---|
1622 | enum ndr_err_code ndr_err;
|
---|
1623 | struct NetUserModalsSet *r;
|
---|
1624 |
|
---|
1625 | call = &ndr_table_libnetapi.calls[NDR_NETUSERMODALSSET];
|
---|
1626 |
|
---|
1627 | r = talloc(talloc_tos(), struct NetUserModalsSet);
|
---|
1628 | if (r == NULL) {
|
---|
1629 | return false;
|
---|
1630 | }
|
---|
1631 |
|
---|
1632 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1633 | if (pull == NULL) {
|
---|
1634 | talloc_free(r);
|
---|
1635 | return false;
|
---|
1636 | }
|
---|
1637 |
|
---|
1638 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1639 | if (p->endian) {
|
---|
1640 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1641 | }
|
---|
1642 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1643 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1644 | talloc_free(r);
|
---|
1645 | return false;
|
---|
1646 | }
|
---|
1647 |
|
---|
1648 | if (DEBUGLEVEL >= 10) {
|
---|
1649 | NDR_PRINT_FUNCTION_DEBUG(NetUserModalsSet, NDR_IN, r);
|
---|
1650 | }
|
---|
1651 |
|
---|
1652 | ZERO_STRUCT(r->out);
|
---|
1653 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
1654 | if (r->out.parm_err == NULL) {
|
---|
1655 | talloc_free(r);
|
---|
1656 | return false;
|
---|
1657 | }
|
---|
1658 |
|
---|
1659 | r->out.result = _NetUserModalsSet(p, r);
|
---|
1660 |
|
---|
1661 | if (p->rng_fault_state) {
|
---|
1662 | talloc_free(r);
|
---|
1663 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1664 | return true;
|
---|
1665 | }
|
---|
1666 |
|
---|
1667 | if (DEBUGLEVEL >= 10) {
|
---|
1668 | NDR_PRINT_FUNCTION_DEBUG(NetUserModalsSet, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1669 | }
|
---|
1670 |
|
---|
1671 | push = ndr_push_init_ctx(r);
|
---|
1672 | if (push == NULL) {
|
---|
1673 | talloc_free(r);
|
---|
1674 | return false;
|
---|
1675 | }
|
---|
1676 |
|
---|
1677 | /*
|
---|
1678 | * carry over the pointer count to the reply in case we are
|
---|
1679 | * using full pointer. See NDR specification for full pointers
|
---|
1680 | */
|
---|
1681 | push->ptr_count = pull->ptr_count;
|
---|
1682 |
|
---|
1683 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1684 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1685 | talloc_free(r);
|
---|
1686 | return false;
|
---|
1687 | }
|
---|
1688 |
|
---|
1689 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1690 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1691 |
|
---|
1692 | talloc_free(r);
|
---|
1693 |
|
---|
1694 | return true;
|
---|
1695 | }
|
---|
1696 |
|
---|
1697 | static bool api_NetQueryDisplayInformation(struct pipes_struct *p)
|
---|
1698 | {
|
---|
1699 | const struct ndr_interface_call *call;
|
---|
1700 | struct ndr_pull *pull;
|
---|
1701 | struct ndr_push *push;
|
---|
1702 | enum ndr_err_code ndr_err;
|
---|
1703 | struct NetQueryDisplayInformation *r;
|
---|
1704 |
|
---|
1705 | call = &ndr_table_libnetapi.calls[NDR_NETQUERYDISPLAYINFORMATION];
|
---|
1706 |
|
---|
1707 | r = talloc(talloc_tos(), struct NetQueryDisplayInformation);
|
---|
1708 | if (r == NULL) {
|
---|
1709 | return false;
|
---|
1710 | }
|
---|
1711 |
|
---|
1712 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1713 | if (pull == NULL) {
|
---|
1714 | talloc_free(r);
|
---|
1715 | return false;
|
---|
1716 | }
|
---|
1717 |
|
---|
1718 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1719 | if (p->endian) {
|
---|
1720 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1721 | }
|
---|
1722 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1723 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1724 | talloc_free(r);
|
---|
1725 | return false;
|
---|
1726 | }
|
---|
1727 |
|
---|
1728 | if (DEBUGLEVEL >= 10) {
|
---|
1729 | NDR_PRINT_FUNCTION_DEBUG(NetQueryDisplayInformation, NDR_IN, r);
|
---|
1730 | }
|
---|
1731 |
|
---|
1732 | ZERO_STRUCT(r->out);
|
---|
1733 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
1734 | if (r->out.entries_read == NULL) {
|
---|
1735 | talloc_free(r);
|
---|
1736 | return false;
|
---|
1737 | }
|
---|
1738 |
|
---|
1739 | r->out.buffer = talloc_zero(r, void *);
|
---|
1740 | if (r->out.buffer == NULL) {
|
---|
1741 | talloc_free(r);
|
---|
1742 | return false;
|
---|
1743 | }
|
---|
1744 |
|
---|
1745 | r->out.result = _NetQueryDisplayInformation(p, r);
|
---|
1746 |
|
---|
1747 | if (p->rng_fault_state) {
|
---|
1748 | talloc_free(r);
|
---|
1749 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1750 | return true;
|
---|
1751 | }
|
---|
1752 |
|
---|
1753 | if (DEBUGLEVEL >= 10) {
|
---|
1754 | NDR_PRINT_FUNCTION_DEBUG(NetQueryDisplayInformation, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1755 | }
|
---|
1756 |
|
---|
1757 | push = ndr_push_init_ctx(r);
|
---|
1758 | if (push == NULL) {
|
---|
1759 | talloc_free(r);
|
---|
1760 | return false;
|
---|
1761 | }
|
---|
1762 |
|
---|
1763 | /*
|
---|
1764 | * carry over the pointer count to the reply in case we are
|
---|
1765 | * using full pointer. See NDR specification for full pointers
|
---|
1766 | */
|
---|
1767 | push->ptr_count = pull->ptr_count;
|
---|
1768 |
|
---|
1769 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1770 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1771 | talloc_free(r);
|
---|
1772 | return false;
|
---|
1773 | }
|
---|
1774 |
|
---|
1775 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1776 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1777 |
|
---|
1778 | talloc_free(r);
|
---|
1779 |
|
---|
1780 | return true;
|
---|
1781 | }
|
---|
1782 |
|
---|
1783 | static bool api_NetGroupAdd(struct pipes_struct *p)
|
---|
1784 | {
|
---|
1785 | const struct ndr_interface_call *call;
|
---|
1786 | struct ndr_pull *pull;
|
---|
1787 | struct ndr_push *push;
|
---|
1788 | enum ndr_err_code ndr_err;
|
---|
1789 | struct NetGroupAdd *r;
|
---|
1790 |
|
---|
1791 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPADD];
|
---|
1792 |
|
---|
1793 | r = talloc(talloc_tos(), struct NetGroupAdd);
|
---|
1794 | if (r == NULL) {
|
---|
1795 | return false;
|
---|
1796 | }
|
---|
1797 |
|
---|
1798 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1799 | if (pull == NULL) {
|
---|
1800 | talloc_free(r);
|
---|
1801 | return false;
|
---|
1802 | }
|
---|
1803 |
|
---|
1804 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1805 | if (p->endian) {
|
---|
1806 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1807 | }
|
---|
1808 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1809 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1810 | talloc_free(r);
|
---|
1811 | return false;
|
---|
1812 | }
|
---|
1813 |
|
---|
1814 | if (DEBUGLEVEL >= 10) {
|
---|
1815 | NDR_PRINT_FUNCTION_DEBUG(NetGroupAdd, NDR_IN, r);
|
---|
1816 | }
|
---|
1817 |
|
---|
1818 | ZERO_STRUCT(r->out);
|
---|
1819 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
1820 | if (r->out.parm_err == NULL) {
|
---|
1821 | talloc_free(r);
|
---|
1822 | return false;
|
---|
1823 | }
|
---|
1824 |
|
---|
1825 | r->out.result = _NetGroupAdd(p, r);
|
---|
1826 |
|
---|
1827 | if (p->rng_fault_state) {
|
---|
1828 | talloc_free(r);
|
---|
1829 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1830 | return true;
|
---|
1831 | }
|
---|
1832 |
|
---|
1833 | if (DEBUGLEVEL >= 10) {
|
---|
1834 | NDR_PRINT_FUNCTION_DEBUG(NetGroupAdd, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1835 | }
|
---|
1836 |
|
---|
1837 | push = ndr_push_init_ctx(r);
|
---|
1838 | if (push == NULL) {
|
---|
1839 | talloc_free(r);
|
---|
1840 | return false;
|
---|
1841 | }
|
---|
1842 |
|
---|
1843 | /*
|
---|
1844 | * carry over the pointer count to the reply in case we are
|
---|
1845 | * using full pointer. See NDR specification for full pointers
|
---|
1846 | */
|
---|
1847 | push->ptr_count = pull->ptr_count;
|
---|
1848 |
|
---|
1849 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1850 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1851 | talloc_free(r);
|
---|
1852 | return false;
|
---|
1853 | }
|
---|
1854 |
|
---|
1855 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1856 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1857 |
|
---|
1858 | talloc_free(r);
|
---|
1859 |
|
---|
1860 | return true;
|
---|
1861 | }
|
---|
1862 |
|
---|
1863 | static bool api_NetGroupDel(struct pipes_struct *p)
|
---|
1864 | {
|
---|
1865 | const struct ndr_interface_call *call;
|
---|
1866 | struct ndr_pull *pull;
|
---|
1867 | struct ndr_push *push;
|
---|
1868 | enum ndr_err_code ndr_err;
|
---|
1869 | struct NetGroupDel *r;
|
---|
1870 |
|
---|
1871 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPDEL];
|
---|
1872 |
|
---|
1873 | r = talloc(talloc_tos(), struct NetGroupDel);
|
---|
1874 | if (r == NULL) {
|
---|
1875 | return false;
|
---|
1876 | }
|
---|
1877 |
|
---|
1878 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1879 | if (pull == NULL) {
|
---|
1880 | talloc_free(r);
|
---|
1881 | return false;
|
---|
1882 | }
|
---|
1883 |
|
---|
1884 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1885 | if (p->endian) {
|
---|
1886 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1887 | }
|
---|
1888 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1889 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1890 | talloc_free(r);
|
---|
1891 | return false;
|
---|
1892 | }
|
---|
1893 |
|
---|
1894 | if (DEBUGLEVEL >= 10) {
|
---|
1895 | NDR_PRINT_FUNCTION_DEBUG(NetGroupDel, NDR_IN, r);
|
---|
1896 | }
|
---|
1897 |
|
---|
1898 | r->out.result = _NetGroupDel(p, r);
|
---|
1899 |
|
---|
1900 | if (p->rng_fault_state) {
|
---|
1901 | talloc_free(r);
|
---|
1902 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1903 | return true;
|
---|
1904 | }
|
---|
1905 |
|
---|
1906 | if (DEBUGLEVEL >= 10) {
|
---|
1907 | NDR_PRINT_FUNCTION_DEBUG(NetGroupDel, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1908 | }
|
---|
1909 |
|
---|
1910 | push = ndr_push_init_ctx(r);
|
---|
1911 | if (push == NULL) {
|
---|
1912 | talloc_free(r);
|
---|
1913 | return false;
|
---|
1914 | }
|
---|
1915 |
|
---|
1916 | /*
|
---|
1917 | * carry over the pointer count to the reply in case we are
|
---|
1918 | * using full pointer. See NDR specification for full pointers
|
---|
1919 | */
|
---|
1920 | push->ptr_count = pull->ptr_count;
|
---|
1921 |
|
---|
1922 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1923 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1924 | talloc_free(r);
|
---|
1925 | return false;
|
---|
1926 | }
|
---|
1927 |
|
---|
1928 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1929 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1930 |
|
---|
1931 | talloc_free(r);
|
---|
1932 |
|
---|
1933 | return true;
|
---|
1934 | }
|
---|
1935 |
|
---|
1936 | static bool api_NetGroupEnum(struct pipes_struct *p)
|
---|
1937 | {
|
---|
1938 | const struct ndr_interface_call *call;
|
---|
1939 | struct ndr_pull *pull;
|
---|
1940 | struct ndr_push *push;
|
---|
1941 | enum ndr_err_code ndr_err;
|
---|
1942 | struct NetGroupEnum *r;
|
---|
1943 |
|
---|
1944 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPENUM];
|
---|
1945 |
|
---|
1946 | r = talloc(talloc_tos(), struct NetGroupEnum);
|
---|
1947 | if (r == NULL) {
|
---|
1948 | return false;
|
---|
1949 | }
|
---|
1950 |
|
---|
1951 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1952 | if (pull == NULL) {
|
---|
1953 | talloc_free(r);
|
---|
1954 | return false;
|
---|
1955 | }
|
---|
1956 |
|
---|
1957 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1958 | if (p->endian) {
|
---|
1959 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1960 | }
|
---|
1961 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1962 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1963 | talloc_free(r);
|
---|
1964 | return false;
|
---|
1965 | }
|
---|
1966 |
|
---|
1967 | if (DEBUGLEVEL >= 10) {
|
---|
1968 | NDR_PRINT_FUNCTION_DEBUG(NetGroupEnum, NDR_IN, r);
|
---|
1969 | }
|
---|
1970 |
|
---|
1971 | ZERO_STRUCT(r->out);
|
---|
1972 | r->out.resume_handle = r->in.resume_handle;
|
---|
1973 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
1974 | if (r->out.buffer == NULL) {
|
---|
1975 | talloc_free(r);
|
---|
1976 | return false;
|
---|
1977 | }
|
---|
1978 |
|
---|
1979 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
1980 | if (r->out.entries_read == NULL) {
|
---|
1981 | talloc_free(r);
|
---|
1982 | return false;
|
---|
1983 | }
|
---|
1984 |
|
---|
1985 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
1986 | if (r->out.total_entries == NULL) {
|
---|
1987 | talloc_free(r);
|
---|
1988 | return false;
|
---|
1989 | }
|
---|
1990 |
|
---|
1991 | r->out.result = _NetGroupEnum(p, r);
|
---|
1992 |
|
---|
1993 | if (p->rng_fault_state) {
|
---|
1994 | talloc_free(r);
|
---|
1995 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1996 | return true;
|
---|
1997 | }
|
---|
1998 |
|
---|
1999 | if (DEBUGLEVEL >= 10) {
|
---|
2000 | NDR_PRINT_FUNCTION_DEBUG(NetGroupEnum, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2001 | }
|
---|
2002 |
|
---|
2003 | push = ndr_push_init_ctx(r);
|
---|
2004 | if (push == NULL) {
|
---|
2005 | talloc_free(r);
|
---|
2006 | return false;
|
---|
2007 | }
|
---|
2008 |
|
---|
2009 | /*
|
---|
2010 | * carry over the pointer count to the reply in case we are
|
---|
2011 | * using full pointer. See NDR specification for full pointers
|
---|
2012 | */
|
---|
2013 | push->ptr_count = pull->ptr_count;
|
---|
2014 |
|
---|
2015 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2016 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2017 | talloc_free(r);
|
---|
2018 | return false;
|
---|
2019 | }
|
---|
2020 |
|
---|
2021 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2022 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2023 |
|
---|
2024 | talloc_free(r);
|
---|
2025 |
|
---|
2026 | return true;
|
---|
2027 | }
|
---|
2028 |
|
---|
2029 | static bool api_NetGroupSetInfo(struct pipes_struct *p)
|
---|
2030 | {
|
---|
2031 | const struct ndr_interface_call *call;
|
---|
2032 | struct ndr_pull *pull;
|
---|
2033 | struct ndr_push *push;
|
---|
2034 | enum ndr_err_code ndr_err;
|
---|
2035 | struct NetGroupSetInfo *r;
|
---|
2036 |
|
---|
2037 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPSETINFO];
|
---|
2038 |
|
---|
2039 | r = talloc(talloc_tos(), struct NetGroupSetInfo);
|
---|
2040 | if (r == NULL) {
|
---|
2041 | return false;
|
---|
2042 | }
|
---|
2043 |
|
---|
2044 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2045 | if (pull == NULL) {
|
---|
2046 | talloc_free(r);
|
---|
2047 | return false;
|
---|
2048 | }
|
---|
2049 |
|
---|
2050 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2051 | if (p->endian) {
|
---|
2052 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2053 | }
|
---|
2054 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2055 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2056 | talloc_free(r);
|
---|
2057 | return false;
|
---|
2058 | }
|
---|
2059 |
|
---|
2060 | if (DEBUGLEVEL >= 10) {
|
---|
2061 | NDR_PRINT_FUNCTION_DEBUG(NetGroupSetInfo, NDR_IN, r);
|
---|
2062 | }
|
---|
2063 |
|
---|
2064 | ZERO_STRUCT(r->out);
|
---|
2065 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
2066 | if (r->out.parm_err == NULL) {
|
---|
2067 | talloc_free(r);
|
---|
2068 | return false;
|
---|
2069 | }
|
---|
2070 |
|
---|
2071 | r->out.result = _NetGroupSetInfo(p, r);
|
---|
2072 |
|
---|
2073 | if (p->rng_fault_state) {
|
---|
2074 | talloc_free(r);
|
---|
2075 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2076 | return true;
|
---|
2077 | }
|
---|
2078 |
|
---|
2079 | if (DEBUGLEVEL >= 10) {
|
---|
2080 | NDR_PRINT_FUNCTION_DEBUG(NetGroupSetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2081 | }
|
---|
2082 |
|
---|
2083 | push = ndr_push_init_ctx(r);
|
---|
2084 | if (push == NULL) {
|
---|
2085 | talloc_free(r);
|
---|
2086 | return false;
|
---|
2087 | }
|
---|
2088 |
|
---|
2089 | /*
|
---|
2090 | * carry over the pointer count to the reply in case we are
|
---|
2091 | * using full pointer. See NDR specification for full pointers
|
---|
2092 | */
|
---|
2093 | push->ptr_count = pull->ptr_count;
|
---|
2094 |
|
---|
2095 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2096 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2097 | talloc_free(r);
|
---|
2098 | return false;
|
---|
2099 | }
|
---|
2100 |
|
---|
2101 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2102 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2103 |
|
---|
2104 | talloc_free(r);
|
---|
2105 |
|
---|
2106 | return true;
|
---|
2107 | }
|
---|
2108 |
|
---|
2109 | static bool api_NetGroupGetInfo(struct pipes_struct *p)
|
---|
2110 | {
|
---|
2111 | const struct ndr_interface_call *call;
|
---|
2112 | struct ndr_pull *pull;
|
---|
2113 | struct ndr_push *push;
|
---|
2114 | enum ndr_err_code ndr_err;
|
---|
2115 | struct NetGroupGetInfo *r;
|
---|
2116 |
|
---|
2117 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPGETINFO];
|
---|
2118 |
|
---|
2119 | r = talloc(talloc_tos(), struct NetGroupGetInfo);
|
---|
2120 | if (r == NULL) {
|
---|
2121 | return false;
|
---|
2122 | }
|
---|
2123 |
|
---|
2124 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2125 | if (pull == NULL) {
|
---|
2126 | talloc_free(r);
|
---|
2127 | return false;
|
---|
2128 | }
|
---|
2129 |
|
---|
2130 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2131 | if (p->endian) {
|
---|
2132 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2133 | }
|
---|
2134 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2135 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2136 | talloc_free(r);
|
---|
2137 | return false;
|
---|
2138 | }
|
---|
2139 |
|
---|
2140 | if (DEBUGLEVEL >= 10) {
|
---|
2141 | NDR_PRINT_FUNCTION_DEBUG(NetGroupGetInfo, NDR_IN, r);
|
---|
2142 | }
|
---|
2143 |
|
---|
2144 | ZERO_STRUCT(r->out);
|
---|
2145 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
2146 | if (r->out.buffer == NULL) {
|
---|
2147 | talloc_free(r);
|
---|
2148 | return false;
|
---|
2149 | }
|
---|
2150 |
|
---|
2151 | r->out.result = _NetGroupGetInfo(p, r);
|
---|
2152 |
|
---|
2153 | if (p->rng_fault_state) {
|
---|
2154 | talloc_free(r);
|
---|
2155 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2156 | return true;
|
---|
2157 | }
|
---|
2158 |
|
---|
2159 | if (DEBUGLEVEL >= 10) {
|
---|
2160 | NDR_PRINT_FUNCTION_DEBUG(NetGroupGetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2161 | }
|
---|
2162 |
|
---|
2163 | push = ndr_push_init_ctx(r);
|
---|
2164 | if (push == NULL) {
|
---|
2165 | talloc_free(r);
|
---|
2166 | return false;
|
---|
2167 | }
|
---|
2168 |
|
---|
2169 | /*
|
---|
2170 | * carry over the pointer count to the reply in case we are
|
---|
2171 | * using full pointer. See NDR specification for full pointers
|
---|
2172 | */
|
---|
2173 | push->ptr_count = pull->ptr_count;
|
---|
2174 |
|
---|
2175 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2176 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2177 | talloc_free(r);
|
---|
2178 | return false;
|
---|
2179 | }
|
---|
2180 |
|
---|
2181 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2182 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2183 |
|
---|
2184 | talloc_free(r);
|
---|
2185 |
|
---|
2186 | return true;
|
---|
2187 | }
|
---|
2188 |
|
---|
2189 | static bool api_NetGroupAddUser(struct pipes_struct *p)
|
---|
2190 | {
|
---|
2191 | const struct ndr_interface_call *call;
|
---|
2192 | struct ndr_pull *pull;
|
---|
2193 | struct ndr_push *push;
|
---|
2194 | enum ndr_err_code ndr_err;
|
---|
2195 | struct NetGroupAddUser *r;
|
---|
2196 |
|
---|
2197 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPADDUSER];
|
---|
2198 |
|
---|
2199 | r = talloc(talloc_tos(), struct NetGroupAddUser);
|
---|
2200 | if (r == NULL) {
|
---|
2201 | return false;
|
---|
2202 | }
|
---|
2203 |
|
---|
2204 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2205 | if (pull == NULL) {
|
---|
2206 | talloc_free(r);
|
---|
2207 | return false;
|
---|
2208 | }
|
---|
2209 |
|
---|
2210 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2211 | if (p->endian) {
|
---|
2212 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2213 | }
|
---|
2214 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2215 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2216 | talloc_free(r);
|
---|
2217 | return false;
|
---|
2218 | }
|
---|
2219 |
|
---|
2220 | if (DEBUGLEVEL >= 10) {
|
---|
2221 | NDR_PRINT_FUNCTION_DEBUG(NetGroupAddUser, NDR_IN, r);
|
---|
2222 | }
|
---|
2223 |
|
---|
2224 | r->out.result = _NetGroupAddUser(p, r);
|
---|
2225 |
|
---|
2226 | if (p->rng_fault_state) {
|
---|
2227 | talloc_free(r);
|
---|
2228 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2229 | return true;
|
---|
2230 | }
|
---|
2231 |
|
---|
2232 | if (DEBUGLEVEL >= 10) {
|
---|
2233 | NDR_PRINT_FUNCTION_DEBUG(NetGroupAddUser, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2234 | }
|
---|
2235 |
|
---|
2236 | push = ndr_push_init_ctx(r);
|
---|
2237 | if (push == NULL) {
|
---|
2238 | talloc_free(r);
|
---|
2239 | return false;
|
---|
2240 | }
|
---|
2241 |
|
---|
2242 | /*
|
---|
2243 | * carry over the pointer count to the reply in case we are
|
---|
2244 | * using full pointer. See NDR specification for full pointers
|
---|
2245 | */
|
---|
2246 | push->ptr_count = pull->ptr_count;
|
---|
2247 |
|
---|
2248 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2249 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2250 | talloc_free(r);
|
---|
2251 | return false;
|
---|
2252 | }
|
---|
2253 |
|
---|
2254 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2255 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2256 |
|
---|
2257 | talloc_free(r);
|
---|
2258 |
|
---|
2259 | return true;
|
---|
2260 | }
|
---|
2261 |
|
---|
2262 | static bool api_NetGroupDelUser(struct pipes_struct *p)
|
---|
2263 | {
|
---|
2264 | const struct ndr_interface_call *call;
|
---|
2265 | struct ndr_pull *pull;
|
---|
2266 | struct ndr_push *push;
|
---|
2267 | enum ndr_err_code ndr_err;
|
---|
2268 | struct NetGroupDelUser *r;
|
---|
2269 |
|
---|
2270 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPDELUSER];
|
---|
2271 |
|
---|
2272 | r = talloc(talloc_tos(), struct NetGroupDelUser);
|
---|
2273 | if (r == NULL) {
|
---|
2274 | return false;
|
---|
2275 | }
|
---|
2276 |
|
---|
2277 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2278 | if (pull == NULL) {
|
---|
2279 | talloc_free(r);
|
---|
2280 | return false;
|
---|
2281 | }
|
---|
2282 |
|
---|
2283 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2284 | if (p->endian) {
|
---|
2285 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2286 | }
|
---|
2287 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2288 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2289 | talloc_free(r);
|
---|
2290 | return false;
|
---|
2291 | }
|
---|
2292 |
|
---|
2293 | if (DEBUGLEVEL >= 10) {
|
---|
2294 | NDR_PRINT_FUNCTION_DEBUG(NetGroupDelUser, NDR_IN, r);
|
---|
2295 | }
|
---|
2296 |
|
---|
2297 | r->out.result = _NetGroupDelUser(p, r);
|
---|
2298 |
|
---|
2299 | if (p->rng_fault_state) {
|
---|
2300 | talloc_free(r);
|
---|
2301 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2302 | return true;
|
---|
2303 | }
|
---|
2304 |
|
---|
2305 | if (DEBUGLEVEL >= 10) {
|
---|
2306 | NDR_PRINT_FUNCTION_DEBUG(NetGroupDelUser, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2307 | }
|
---|
2308 |
|
---|
2309 | push = ndr_push_init_ctx(r);
|
---|
2310 | if (push == NULL) {
|
---|
2311 | talloc_free(r);
|
---|
2312 | return false;
|
---|
2313 | }
|
---|
2314 |
|
---|
2315 | /*
|
---|
2316 | * carry over the pointer count to the reply in case we are
|
---|
2317 | * using full pointer. See NDR specification for full pointers
|
---|
2318 | */
|
---|
2319 | push->ptr_count = pull->ptr_count;
|
---|
2320 |
|
---|
2321 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2322 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2323 | talloc_free(r);
|
---|
2324 | return false;
|
---|
2325 | }
|
---|
2326 |
|
---|
2327 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2328 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2329 |
|
---|
2330 | talloc_free(r);
|
---|
2331 |
|
---|
2332 | return true;
|
---|
2333 | }
|
---|
2334 |
|
---|
2335 | static bool api_NetGroupGetUsers(struct pipes_struct *p)
|
---|
2336 | {
|
---|
2337 | const struct ndr_interface_call *call;
|
---|
2338 | struct ndr_pull *pull;
|
---|
2339 | struct ndr_push *push;
|
---|
2340 | enum ndr_err_code ndr_err;
|
---|
2341 | struct NetGroupGetUsers *r;
|
---|
2342 |
|
---|
2343 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPGETUSERS];
|
---|
2344 |
|
---|
2345 | r = talloc(talloc_tos(), struct NetGroupGetUsers);
|
---|
2346 | if (r == NULL) {
|
---|
2347 | return false;
|
---|
2348 | }
|
---|
2349 |
|
---|
2350 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2351 | if (pull == NULL) {
|
---|
2352 | talloc_free(r);
|
---|
2353 | return false;
|
---|
2354 | }
|
---|
2355 |
|
---|
2356 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2357 | if (p->endian) {
|
---|
2358 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2359 | }
|
---|
2360 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2361 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2362 | talloc_free(r);
|
---|
2363 | return false;
|
---|
2364 | }
|
---|
2365 |
|
---|
2366 | if (DEBUGLEVEL >= 10) {
|
---|
2367 | NDR_PRINT_FUNCTION_DEBUG(NetGroupGetUsers, NDR_IN, r);
|
---|
2368 | }
|
---|
2369 |
|
---|
2370 | ZERO_STRUCT(r->out);
|
---|
2371 | r->out.resume_handle = r->in.resume_handle;
|
---|
2372 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
2373 | if (r->out.buffer == NULL) {
|
---|
2374 | talloc_free(r);
|
---|
2375 | return false;
|
---|
2376 | }
|
---|
2377 |
|
---|
2378 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
2379 | if (r->out.entries_read == NULL) {
|
---|
2380 | talloc_free(r);
|
---|
2381 | return false;
|
---|
2382 | }
|
---|
2383 |
|
---|
2384 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
2385 | if (r->out.total_entries == NULL) {
|
---|
2386 | talloc_free(r);
|
---|
2387 | return false;
|
---|
2388 | }
|
---|
2389 |
|
---|
2390 | r->out.result = _NetGroupGetUsers(p, r);
|
---|
2391 |
|
---|
2392 | if (p->rng_fault_state) {
|
---|
2393 | talloc_free(r);
|
---|
2394 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2395 | return true;
|
---|
2396 | }
|
---|
2397 |
|
---|
2398 | if (DEBUGLEVEL >= 10) {
|
---|
2399 | NDR_PRINT_FUNCTION_DEBUG(NetGroupGetUsers, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2400 | }
|
---|
2401 |
|
---|
2402 | push = ndr_push_init_ctx(r);
|
---|
2403 | if (push == NULL) {
|
---|
2404 | talloc_free(r);
|
---|
2405 | return false;
|
---|
2406 | }
|
---|
2407 |
|
---|
2408 | /*
|
---|
2409 | * carry over the pointer count to the reply in case we are
|
---|
2410 | * using full pointer. See NDR specification for full pointers
|
---|
2411 | */
|
---|
2412 | push->ptr_count = pull->ptr_count;
|
---|
2413 |
|
---|
2414 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2415 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2416 | talloc_free(r);
|
---|
2417 | return false;
|
---|
2418 | }
|
---|
2419 |
|
---|
2420 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2421 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2422 |
|
---|
2423 | talloc_free(r);
|
---|
2424 |
|
---|
2425 | return true;
|
---|
2426 | }
|
---|
2427 |
|
---|
2428 | static bool api_NetGroupSetUsers(struct pipes_struct *p)
|
---|
2429 | {
|
---|
2430 | const struct ndr_interface_call *call;
|
---|
2431 | struct ndr_pull *pull;
|
---|
2432 | struct ndr_push *push;
|
---|
2433 | enum ndr_err_code ndr_err;
|
---|
2434 | struct NetGroupSetUsers *r;
|
---|
2435 |
|
---|
2436 | call = &ndr_table_libnetapi.calls[NDR_NETGROUPSETUSERS];
|
---|
2437 |
|
---|
2438 | r = talloc(talloc_tos(), struct NetGroupSetUsers);
|
---|
2439 | if (r == NULL) {
|
---|
2440 | return false;
|
---|
2441 | }
|
---|
2442 |
|
---|
2443 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2444 | if (pull == NULL) {
|
---|
2445 | talloc_free(r);
|
---|
2446 | return false;
|
---|
2447 | }
|
---|
2448 |
|
---|
2449 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2450 | if (p->endian) {
|
---|
2451 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2452 | }
|
---|
2453 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2454 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2455 | talloc_free(r);
|
---|
2456 | return false;
|
---|
2457 | }
|
---|
2458 |
|
---|
2459 | if (DEBUGLEVEL >= 10) {
|
---|
2460 | NDR_PRINT_FUNCTION_DEBUG(NetGroupSetUsers, NDR_IN, r);
|
---|
2461 | }
|
---|
2462 |
|
---|
2463 | r->out.result = _NetGroupSetUsers(p, r);
|
---|
2464 |
|
---|
2465 | if (p->rng_fault_state) {
|
---|
2466 | talloc_free(r);
|
---|
2467 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2468 | return true;
|
---|
2469 | }
|
---|
2470 |
|
---|
2471 | if (DEBUGLEVEL >= 10) {
|
---|
2472 | NDR_PRINT_FUNCTION_DEBUG(NetGroupSetUsers, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2473 | }
|
---|
2474 |
|
---|
2475 | push = ndr_push_init_ctx(r);
|
---|
2476 | if (push == NULL) {
|
---|
2477 | talloc_free(r);
|
---|
2478 | return false;
|
---|
2479 | }
|
---|
2480 |
|
---|
2481 | /*
|
---|
2482 | * carry over the pointer count to the reply in case we are
|
---|
2483 | * using full pointer. See NDR specification for full pointers
|
---|
2484 | */
|
---|
2485 | push->ptr_count = pull->ptr_count;
|
---|
2486 |
|
---|
2487 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2488 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2489 | talloc_free(r);
|
---|
2490 | return false;
|
---|
2491 | }
|
---|
2492 |
|
---|
2493 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2494 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2495 |
|
---|
2496 | talloc_free(r);
|
---|
2497 |
|
---|
2498 | return true;
|
---|
2499 | }
|
---|
2500 |
|
---|
2501 | static bool api_NetLocalGroupAdd(struct pipes_struct *p)
|
---|
2502 | {
|
---|
2503 | const struct ndr_interface_call *call;
|
---|
2504 | struct ndr_pull *pull;
|
---|
2505 | struct ndr_push *push;
|
---|
2506 | enum ndr_err_code ndr_err;
|
---|
2507 | struct NetLocalGroupAdd *r;
|
---|
2508 |
|
---|
2509 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPADD];
|
---|
2510 |
|
---|
2511 | r = talloc(talloc_tos(), struct NetLocalGroupAdd);
|
---|
2512 | if (r == NULL) {
|
---|
2513 | return false;
|
---|
2514 | }
|
---|
2515 |
|
---|
2516 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2517 | if (pull == NULL) {
|
---|
2518 | talloc_free(r);
|
---|
2519 | return false;
|
---|
2520 | }
|
---|
2521 |
|
---|
2522 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2523 | if (p->endian) {
|
---|
2524 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2525 | }
|
---|
2526 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2527 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2528 | talloc_free(r);
|
---|
2529 | return false;
|
---|
2530 | }
|
---|
2531 |
|
---|
2532 | if (DEBUGLEVEL >= 10) {
|
---|
2533 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupAdd, NDR_IN, r);
|
---|
2534 | }
|
---|
2535 |
|
---|
2536 | ZERO_STRUCT(r->out);
|
---|
2537 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
2538 | if (r->out.parm_err == NULL) {
|
---|
2539 | talloc_free(r);
|
---|
2540 | return false;
|
---|
2541 | }
|
---|
2542 |
|
---|
2543 | r->out.result = _NetLocalGroupAdd(p, r);
|
---|
2544 |
|
---|
2545 | if (p->rng_fault_state) {
|
---|
2546 | talloc_free(r);
|
---|
2547 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2548 | return true;
|
---|
2549 | }
|
---|
2550 |
|
---|
2551 | if (DEBUGLEVEL >= 10) {
|
---|
2552 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupAdd, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2553 | }
|
---|
2554 |
|
---|
2555 | push = ndr_push_init_ctx(r);
|
---|
2556 | if (push == NULL) {
|
---|
2557 | talloc_free(r);
|
---|
2558 | return false;
|
---|
2559 | }
|
---|
2560 |
|
---|
2561 | /*
|
---|
2562 | * carry over the pointer count to the reply in case we are
|
---|
2563 | * using full pointer. See NDR specification for full pointers
|
---|
2564 | */
|
---|
2565 | push->ptr_count = pull->ptr_count;
|
---|
2566 |
|
---|
2567 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2568 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2569 | talloc_free(r);
|
---|
2570 | return false;
|
---|
2571 | }
|
---|
2572 |
|
---|
2573 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2574 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2575 |
|
---|
2576 | talloc_free(r);
|
---|
2577 |
|
---|
2578 | return true;
|
---|
2579 | }
|
---|
2580 |
|
---|
2581 | static bool api_NetLocalGroupDel(struct pipes_struct *p)
|
---|
2582 | {
|
---|
2583 | const struct ndr_interface_call *call;
|
---|
2584 | struct ndr_pull *pull;
|
---|
2585 | struct ndr_push *push;
|
---|
2586 | enum ndr_err_code ndr_err;
|
---|
2587 | struct NetLocalGroupDel *r;
|
---|
2588 |
|
---|
2589 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPDEL];
|
---|
2590 |
|
---|
2591 | r = talloc(talloc_tos(), struct NetLocalGroupDel);
|
---|
2592 | if (r == NULL) {
|
---|
2593 | return false;
|
---|
2594 | }
|
---|
2595 |
|
---|
2596 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2597 | if (pull == NULL) {
|
---|
2598 | talloc_free(r);
|
---|
2599 | return false;
|
---|
2600 | }
|
---|
2601 |
|
---|
2602 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2603 | if (p->endian) {
|
---|
2604 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2605 | }
|
---|
2606 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2607 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2608 | talloc_free(r);
|
---|
2609 | return false;
|
---|
2610 | }
|
---|
2611 |
|
---|
2612 | if (DEBUGLEVEL >= 10) {
|
---|
2613 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupDel, NDR_IN, r);
|
---|
2614 | }
|
---|
2615 |
|
---|
2616 | r->out.result = _NetLocalGroupDel(p, r);
|
---|
2617 |
|
---|
2618 | if (p->rng_fault_state) {
|
---|
2619 | talloc_free(r);
|
---|
2620 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2621 | return true;
|
---|
2622 | }
|
---|
2623 |
|
---|
2624 | if (DEBUGLEVEL >= 10) {
|
---|
2625 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupDel, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2626 | }
|
---|
2627 |
|
---|
2628 | push = ndr_push_init_ctx(r);
|
---|
2629 | if (push == NULL) {
|
---|
2630 | talloc_free(r);
|
---|
2631 | return false;
|
---|
2632 | }
|
---|
2633 |
|
---|
2634 | /*
|
---|
2635 | * carry over the pointer count to the reply in case we are
|
---|
2636 | * using full pointer. See NDR specification for full pointers
|
---|
2637 | */
|
---|
2638 | push->ptr_count = pull->ptr_count;
|
---|
2639 |
|
---|
2640 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2641 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2642 | talloc_free(r);
|
---|
2643 | return false;
|
---|
2644 | }
|
---|
2645 |
|
---|
2646 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2647 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2648 |
|
---|
2649 | talloc_free(r);
|
---|
2650 |
|
---|
2651 | return true;
|
---|
2652 | }
|
---|
2653 |
|
---|
2654 | static bool api_NetLocalGroupGetInfo(struct pipes_struct *p)
|
---|
2655 | {
|
---|
2656 | const struct ndr_interface_call *call;
|
---|
2657 | struct ndr_pull *pull;
|
---|
2658 | struct ndr_push *push;
|
---|
2659 | enum ndr_err_code ndr_err;
|
---|
2660 | struct NetLocalGroupGetInfo *r;
|
---|
2661 |
|
---|
2662 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPGETINFO];
|
---|
2663 |
|
---|
2664 | r = talloc(talloc_tos(), struct NetLocalGroupGetInfo);
|
---|
2665 | if (r == NULL) {
|
---|
2666 | return false;
|
---|
2667 | }
|
---|
2668 |
|
---|
2669 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2670 | if (pull == NULL) {
|
---|
2671 | talloc_free(r);
|
---|
2672 | return false;
|
---|
2673 | }
|
---|
2674 |
|
---|
2675 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2676 | if (p->endian) {
|
---|
2677 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2678 | }
|
---|
2679 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2680 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2681 | talloc_free(r);
|
---|
2682 | return false;
|
---|
2683 | }
|
---|
2684 |
|
---|
2685 | if (DEBUGLEVEL >= 10) {
|
---|
2686 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupGetInfo, NDR_IN, r);
|
---|
2687 | }
|
---|
2688 |
|
---|
2689 | ZERO_STRUCT(r->out);
|
---|
2690 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
2691 | if (r->out.buffer == NULL) {
|
---|
2692 | talloc_free(r);
|
---|
2693 | return false;
|
---|
2694 | }
|
---|
2695 |
|
---|
2696 | r->out.result = _NetLocalGroupGetInfo(p, r);
|
---|
2697 |
|
---|
2698 | if (p->rng_fault_state) {
|
---|
2699 | talloc_free(r);
|
---|
2700 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2701 | return true;
|
---|
2702 | }
|
---|
2703 |
|
---|
2704 | if (DEBUGLEVEL >= 10) {
|
---|
2705 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupGetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2706 | }
|
---|
2707 |
|
---|
2708 | push = ndr_push_init_ctx(r);
|
---|
2709 | if (push == NULL) {
|
---|
2710 | talloc_free(r);
|
---|
2711 | return false;
|
---|
2712 | }
|
---|
2713 |
|
---|
2714 | /*
|
---|
2715 | * carry over the pointer count to the reply in case we are
|
---|
2716 | * using full pointer. See NDR specification for full pointers
|
---|
2717 | */
|
---|
2718 | push->ptr_count = pull->ptr_count;
|
---|
2719 |
|
---|
2720 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2721 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2722 | talloc_free(r);
|
---|
2723 | return false;
|
---|
2724 | }
|
---|
2725 |
|
---|
2726 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2727 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2728 |
|
---|
2729 | talloc_free(r);
|
---|
2730 |
|
---|
2731 | return true;
|
---|
2732 | }
|
---|
2733 |
|
---|
2734 | static bool api_NetLocalGroupSetInfo(struct pipes_struct *p)
|
---|
2735 | {
|
---|
2736 | const struct ndr_interface_call *call;
|
---|
2737 | struct ndr_pull *pull;
|
---|
2738 | struct ndr_push *push;
|
---|
2739 | enum ndr_err_code ndr_err;
|
---|
2740 | struct NetLocalGroupSetInfo *r;
|
---|
2741 |
|
---|
2742 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPSETINFO];
|
---|
2743 |
|
---|
2744 | r = talloc(talloc_tos(), struct NetLocalGroupSetInfo);
|
---|
2745 | if (r == NULL) {
|
---|
2746 | return false;
|
---|
2747 | }
|
---|
2748 |
|
---|
2749 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2750 | if (pull == NULL) {
|
---|
2751 | talloc_free(r);
|
---|
2752 | return false;
|
---|
2753 | }
|
---|
2754 |
|
---|
2755 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2756 | if (p->endian) {
|
---|
2757 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2758 | }
|
---|
2759 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2760 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2761 | talloc_free(r);
|
---|
2762 | return false;
|
---|
2763 | }
|
---|
2764 |
|
---|
2765 | if (DEBUGLEVEL >= 10) {
|
---|
2766 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupSetInfo, NDR_IN, r);
|
---|
2767 | }
|
---|
2768 |
|
---|
2769 | ZERO_STRUCT(r->out);
|
---|
2770 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
2771 | if (r->out.parm_err == NULL) {
|
---|
2772 | talloc_free(r);
|
---|
2773 | return false;
|
---|
2774 | }
|
---|
2775 |
|
---|
2776 | r->out.result = _NetLocalGroupSetInfo(p, r);
|
---|
2777 |
|
---|
2778 | if (p->rng_fault_state) {
|
---|
2779 | talloc_free(r);
|
---|
2780 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2781 | return true;
|
---|
2782 | }
|
---|
2783 |
|
---|
2784 | if (DEBUGLEVEL >= 10) {
|
---|
2785 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupSetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2786 | }
|
---|
2787 |
|
---|
2788 | push = ndr_push_init_ctx(r);
|
---|
2789 | if (push == NULL) {
|
---|
2790 | talloc_free(r);
|
---|
2791 | return false;
|
---|
2792 | }
|
---|
2793 |
|
---|
2794 | /*
|
---|
2795 | * carry over the pointer count to the reply in case we are
|
---|
2796 | * using full pointer. See NDR specification for full pointers
|
---|
2797 | */
|
---|
2798 | push->ptr_count = pull->ptr_count;
|
---|
2799 |
|
---|
2800 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2801 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2802 | talloc_free(r);
|
---|
2803 | return false;
|
---|
2804 | }
|
---|
2805 |
|
---|
2806 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2807 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2808 |
|
---|
2809 | talloc_free(r);
|
---|
2810 |
|
---|
2811 | return true;
|
---|
2812 | }
|
---|
2813 |
|
---|
2814 | static bool api_NetLocalGroupEnum(struct pipes_struct *p)
|
---|
2815 | {
|
---|
2816 | const struct ndr_interface_call *call;
|
---|
2817 | struct ndr_pull *pull;
|
---|
2818 | struct ndr_push *push;
|
---|
2819 | enum ndr_err_code ndr_err;
|
---|
2820 | struct NetLocalGroupEnum *r;
|
---|
2821 |
|
---|
2822 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPENUM];
|
---|
2823 |
|
---|
2824 | r = talloc(talloc_tos(), struct NetLocalGroupEnum);
|
---|
2825 | if (r == NULL) {
|
---|
2826 | return false;
|
---|
2827 | }
|
---|
2828 |
|
---|
2829 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2830 | if (pull == NULL) {
|
---|
2831 | talloc_free(r);
|
---|
2832 | return false;
|
---|
2833 | }
|
---|
2834 |
|
---|
2835 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2836 | if (p->endian) {
|
---|
2837 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2838 | }
|
---|
2839 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2840 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2841 | talloc_free(r);
|
---|
2842 | return false;
|
---|
2843 | }
|
---|
2844 |
|
---|
2845 | if (DEBUGLEVEL >= 10) {
|
---|
2846 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupEnum, NDR_IN, r);
|
---|
2847 | }
|
---|
2848 |
|
---|
2849 | ZERO_STRUCT(r->out);
|
---|
2850 | r->out.resume_handle = r->in.resume_handle;
|
---|
2851 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
2852 | if (r->out.buffer == NULL) {
|
---|
2853 | talloc_free(r);
|
---|
2854 | return false;
|
---|
2855 | }
|
---|
2856 |
|
---|
2857 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
2858 | if (r->out.entries_read == NULL) {
|
---|
2859 | talloc_free(r);
|
---|
2860 | return false;
|
---|
2861 | }
|
---|
2862 |
|
---|
2863 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
2864 | if (r->out.total_entries == NULL) {
|
---|
2865 | talloc_free(r);
|
---|
2866 | return false;
|
---|
2867 | }
|
---|
2868 |
|
---|
2869 | r->out.result = _NetLocalGroupEnum(p, r);
|
---|
2870 |
|
---|
2871 | if (p->rng_fault_state) {
|
---|
2872 | talloc_free(r);
|
---|
2873 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2874 | return true;
|
---|
2875 | }
|
---|
2876 |
|
---|
2877 | if (DEBUGLEVEL >= 10) {
|
---|
2878 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupEnum, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2879 | }
|
---|
2880 |
|
---|
2881 | push = ndr_push_init_ctx(r);
|
---|
2882 | if (push == NULL) {
|
---|
2883 | talloc_free(r);
|
---|
2884 | return false;
|
---|
2885 | }
|
---|
2886 |
|
---|
2887 | /*
|
---|
2888 | * carry over the pointer count to the reply in case we are
|
---|
2889 | * using full pointer. See NDR specification for full pointers
|
---|
2890 | */
|
---|
2891 | push->ptr_count = pull->ptr_count;
|
---|
2892 |
|
---|
2893 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2894 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2895 | talloc_free(r);
|
---|
2896 | return false;
|
---|
2897 | }
|
---|
2898 |
|
---|
2899 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2900 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2901 |
|
---|
2902 | talloc_free(r);
|
---|
2903 |
|
---|
2904 | return true;
|
---|
2905 | }
|
---|
2906 |
|
---|
2907 | static bool api_NetLocalGroupAddMembers(struct pipes_struct *p)
|
---|
2908 | {
|
---|
2909 | const struct ndr_interface_call *call;
|
---|
2910 | struct ndr_pull *pull;
|
---|
2911 | struct ndr_push *push;
|
---|
2912 | enum ndr_err_code ndr_err;
|
---|
2913 | struct NetLocalGroupAddMembers *r;
|
---|
2914 |
|
---|
2915 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPADDMEMBERS];
|
---|
2916 |
|
---|
2917 | r = talloc(talloc_tos(), struct NetLocalGroupAddMembers);
|
---|
2918 | if (r == NULL) {
|
---|
2919 | return false;
|
---|
2920 | }
|
---|
2921 |
|
---|
2922 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2923 | if (pull == NULL) {
|
---|
2924 | talloc_free(r);
|
---|
2925 | return false;
|
---|
2926 | }
|
---|
2927 |
|
---|
2928 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
2929 | if (p->endian) {
|
---|
2930 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
2931 | }
|
---|
2932 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
2933 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2934 | talloc_free(r);
|
---|
2935 | return false;
|
---|
2936 | }
|
---|
2937 |
|
---|
2938 | if (DEBUGLEVEL >= 10) {
|
---|
2939 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupAddMembers, NDR_IN, r);
|
---|
2940 | }
|
---|
2941 |
|
---|
2942 | r->out.result = _NetLocalGroupAddMembers(p, r);
|
---|
2943 |
|
---|
2944 | if (p->rng_fault_state) {
|
---|
2945 | talloc_free(r);
|
---|
2946 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
2947 | return true;
|
---|
2948 | }
|
---|
2949 |
|
---|
2950 | if (DEBUGLEVEL >= 10) {
|
---|
2951 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupAddMembers, NDR_OUT | NDR_SET_VALUES, r);
|
---|
2952 | }
|
---|
2953 |
|
---|
2954 | push = ndr_push_init_ctx(r);
|
---|
2955 | if (push == NULL) {
|
---|
2956 | talloc_free(r);
|
---|
2957 | return false;
|
---|
2958 | }
|
---|
2959 |
|
---|
2960 | /*
|
---|
2961 | * carry over the pointer count to the reply in case we are
|
---|
2962 | * using full pointer. See NDR specification for full pointers
|
---|
2963 | */
|
---|
2964 | push->ptr_count = pull->ptr_count;
|
---|
2965 |
|
---|
2966 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
2967 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
2968 | talloc_free(r);
|
---|
2969 | return false;
|
---|
2970 | }
|
---|
2971 |
|
---|
2972 | p->out_data.rdata = ndr_push_blob(push);
|
---|
2973 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
2974 |
|
---|
2975 | talloc_free(r);
|
---|
2976 |
|
---|
2977 | return true;
|
---|
2978 | }
|
---|
2979 |
|
---|
2980 | static bool api_NetLocalGroupDelMembers(struct pipes_struct *p)
|
---|
2981 | {
|
---|
2982 | const struct ndr_interface_call *call;
|
---|
2983 | struct ndr_pull *pull;
|
---|
2984 | struct ndr_push *push;
|
---|
2985 | enum ndr_err_code ndr_err;
|
---|
2986 | struct NetLocalGroupDelMembers *r;
|
---|
2987 |
|
---|
2988 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPDELMEMBERS];
|
---|
2989 |
|
---|
2990 | r = talloc(talloc_tos(), struct NetLocalGroupDelMembers);
|
---|
2991 | if (r == NULL) {
|
---|
2992 | return false;
|
---|
2993 | }
|
---|
2994 |
|
---|
2995 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
2996 | if (pull == NULL) {
|
---|
2997 | talloc_free(r);
|
---|
2998 | return false;
|
---|
2999 | }
|
---|
3000 |
|
---|
3001 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3002 | if (p->endian) {
|
---|
3003 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3004 | }
|
---|
3005 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3006 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3007 | talloc_free(r);
|
---|
3008 | return false;
|
---|
3009 | }
|
---|
3010 |
|
---|
3011 | if (DEBUGLEVEL >= 10) {
|
---|
3012 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupDelMembers, NDR_IN, r);
|
---|
3013 | }
|
---|
3014 |
|
---|
3015 | r->out.result = _NetLocalGroupDelMembers(p, r);
|
---|
3016 |
|
---|
3017 | if (p->rng_fault_state) {
|
---|
3018 | talloc_free(r);
|
---|
3019 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3020 | return true;
|
---|
3021 | }
|
---|
3022 |
|
---|
3023 | if (DEBUGLEVEL >= 10) {
|
---|
3024 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupDelMembers, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3025 | }
|
---|
3026 |
|
---|
3027 | push = ndr_push_init_ctx(r);
|
---|
3028 | if (push == NULL) {
|
---|
3029 | talloc_free(r);
|
---|
3030 | return false;
|
---|
3031 | }
|
---|
3032 |
|
---|
3033 | /*
|
---|
3034 | * carry over the pointer count to the reply in case we are
|
---|
3035 | * using full pointer. See NDR specification for full pointers
|
---|
3036 | */
|
---|
3037 | push->ptr_count = pull->ptr_count;
|
---|
3038 |
|
---|
3039 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3040 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3041 | talloc_free(r);
|
---|
3042 | return false;
|
---|
3043 | }
|
---|
3044 |
|
---|
3045 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3046 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3047 |
|
---|
3048 | talloc_free(r);
|
---|
3049 |
|
---|
3050 | return true;
|
---|
3051 | }
|
---|
3052 |
|
---|
3053 | static bool api_NetLocalGroupGetMembers(struct pipes_struct *p)
|
---|
3054 | {
|
---|
3055 | const struct ndr_interface_call *call;
|
---|
3056 | struct ndr_pull *pull;
|
---|
3057 | struct ndr_push *push;
|
---|
3058 | enum ndr_err_code ndr_err;
|
---|
3059 | struct NetLocalGroupGetMembers *r;
|
---|
3060 |
|
---|
3061 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPGETMEMBERS];
|
---|
3062 |
|
---|
3063 | r = talloc(talloc_tos(), struct NetLocalGroupGetMembers);
|
---|
3064 | if (r == NULL) {
|
---|
3065 | return false;
|
---|
3066 | }
|
---|
3067 |
|
---|
3068 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3069 | if (pull == NULL) {
|
---|
3070 | talloc_free(r);
|
---|
3071 | return false;
|
---|
3072 | }
|
---|
3073 |
|
---|
3074 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3075 | if (p->endian) {
|
---|
3076 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3077 | }
|
---|
3078 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3079 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3080 | talloc_free(r);
|
---|
3081 | return false;
|
---|
3082 | }
|
---|
3083 |
|
---|
3084 | if (DEBUGLEVEL >= 10) {
|
---|
3085 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupGetMembers, NDR_IN, r);
|
---|
3086 | }
|
---|
3087 |
|
---|
3088 | ZERO_STRUCT(r->out);
|
---|
3089 | r->out.resume_handle = r->in.resume_handle;
|
---|
3090 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
3091 | if (r->out.buffer == NULL) {
|
---|
3092 | talloc_free(r);
|
---|
3093 | return false;
|
---|
3094 | }
|
---|
3095 |
|
---|
3096 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
3097 | if (r->out.entries_read == NULL) {
|
---|
3098 | talloc_free(r);
|
---|
3099 | return false;
|
---|
3100 | }
|
---|
3101 |
|
---|
3102 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
3103 | if (r->out.total_entries == NULL) {
|
---|
3104 | talloc_free(r);
|
---|
3105 | return false;
|
---|
3106 | }
|
---|
3107 |
|
---|
3108 | r->out.result = _NetLocalGroupGetMembers(p, r);
|
---|
3109 |
|
---|
3110 | if (p->rng_fault_state) {
|
---|
3111 | talloc_free(r);
|
---|
3112 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3113 | return true;
|
---|
3114 | }
|
---|
3115 |
|
---|
3116 | if (DEBUGLEVEL >= 10) {
|
---|
3117 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupGetMembers, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3118 | }
|
---|
3119 |
|
---|
3120 | push = ndr_push_init_ctx(r);
|
---|
3121 | if (push == NULL) {
|
---|
3122 | talloc_free(r);
|
---|
3123 | return false;
|
---|
3124 | }
|
---|
3125 |
|
---|
3126 | /*
|
---|
3127 | * carry over the pointer count to the reply in case we are
|
---|
3128 | * using full pointer. See NDR specification for full pointers
|
---|
3129 | */
|
---|
3130 | push->ptr_count = pull->ptr_count;
|
---|
3131 |
|
---|
3132 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3133 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3134 | talloc_free(r);
|
---|
3135 | return false;
|
---|
3136 | }
|
---|
3137 |
|
---|
3138 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3139 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3140 |
|
---|
3141 | talloc_free(r);
|
---|
3142 |
|
---|
3143 | return true;
|
---|
3144 | }
|
---|
3145 |
|
---|
3146 | static bool api_NetLocalGroupSetMembers(struct pipes_struct *p)
|
---|
3147 | {
|
---|
3148 | const struct ndr_interface_call *call;
|
---|
3149 | struct ndr_pull *pull;
|
---|
3150 | struct ndr_push *push;
|
---|
3151 | enum ndr_err_code ndr_err;
|
---|
3152 | struct NetLocalGroupSetMembers *r;
|
---|
3153 |
|
---|
3154 | call = &ndr_table_libnetapi.calls[NDR_NETLOCALGROUPSETMEMBERS];
|
---|
3155 |
|
---|
3156 | r = talloc(talloc_tos(), struct NetLocalGroupSetMembers);
|
---|
3157 | if (r == NULL) {
|
---|
3158 | return false;
|
---|
3159 | }
|
---|
3160 |
|
---|
3161 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3162 | if (pull == NULL) {
|
---|
3163 | talloc_free(r);
|
---|
3164 | return false;
|
---|
3165 | }
|
---|
3166 |
|
---|
3167 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3168 | if (p->endian) {
|
---|
3169 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3170 | }
|
---|
3171 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3172 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3173 | talloc_free(r);
|
---|
3174 | return false;
|
---|
3175 | }
|
---|
3176 |
|
---|
3177 | if (DEBUGLEVEL >= 10) {
|
---|
3178 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupSetMembers, NDR_IN, r);
|
---|
3179 | }
|
---|
3180 |
|
---|
3181 | r->out.result = _NetLocalGroupSetMembers(p, r);
|
---|
3182 |
|
---|
3183 | if (p->rng_fault_state) {
|
---|
3184 | talloc_free(r);
|
---|
3185 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3186 | return true;
|
---|
3187 | }
|
---|
3188 |
|
---|
3189 | if (DEBUGLEVEL >= 10) {
|
---|
3190 | NDR_PRINT_FUNCTION_DEBUG(NetLocalGroupSetMembers, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3191 | }
|
---|
3192 |
|
---|
3193 | push = ndr_push_init_ctx(r);
|
---|
3194 | if (push == NULL) {
|
---|
3195 | talloc_free(r);
|
---|
3196 | return false;
|
---|
3197 | }
|
---|
3198 |
|
---|
3199 | /*
|
---|
3200 | * carry over the pointer count to the reply in case we are
|
---|
3201 | * using full pointer. See NDR specification for full pointers
|
---|
3202 | */
|
---|
3203 | push->ptr_count = pull->ptr_count;
|
---|
3204 |
|
---|
3205 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3206 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3207 | talloc_free(r);
|
---|
3208 | return false;
|
---|
3209 | }
|
---|
3210 |
|
---|
3211 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3212 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3213 |
|
---|
3214 | talloc_free(r);
|
---|
3215 |
|
---|
3216 | return true;
|
---|
3217 | }
|
---|
3218 |
|
---|
3219 | static bool api_NetRemoteTOD(struct pipes_struct *p)
|
---|
3220 | {
|
---|
3221 | const struct ndr_interface_call *call;
|
---|
3222 | struct ndr_pull *pull;
|
---|
3223 | struct ndr_push *push;
|
---|
3224 | enum ndr_err_code ndr_err;
|
---|
3225 | struct NetRemoteTOD *r;
|
---|
3226 |
|
---|
3227 | call = &ndr_table_libnetapi.calls[NDR_NETREMOTETOD];
|
---|
3228 |
|
---|
3229 | r = talloc(talloc_tos(), struct NetRemoteTOD);
|
---|
3230 | if (r == NULL) {
|
---|
3231 | return false;
|
---|
3232 | }
|
---|
3233 |
|
---|
3234 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3235 | if (pull == NULL) {
|
---|
3236 | talloc_free(r);
|
---|
3237 | return false;
|
---|
3238 | }
|
---|
3239 |
|
---|
3240 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3241 | if (p->endian) {
|
---|
3242 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3243 | }
|
---|
3244 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3245 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3246 | talloc_free(r);
|
---|
3247 | return false;
|
---|
3248 | }
|
---|
3249 |
|
---|
3250 | if (DEBUGLEVEL >= 10) {
|
---|
3251 | NDR_PRINT_FUNCTION_DEBUG(NetRemoteTOD, NDR_IN, r);
|
---|
3252 | }
|
---|
3253 |
|
---|
3254 | ZERO_STRUCT(r->out);
|
---|
3255 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
3256 | if (r->out.buffer == NULL) {
|
---|
3257 | talloc_free(r);
|
---|
3258 | return false;
|
---|
3259 | }
|
---|
3260 |
|
---|
3261 | r->out.result = _NetRemoteTOD(p, r);
|
---|
3262 |
|
---|
3263 | if (p->rng_fault_state) {
|
---|
3264 | talloc_free(r);
|
---|
3265 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3266 | return true;
|
---|
3267 | }
|
---|
3268 |
|
---|
3269 | if (DEBUGLEVEL >= 10) {
|
---|
3270 | NDR_PRINT_FUNCTION_DEBUG(NetRemoteTOD, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3271 | }
|
---|
3272 |
|
---|
3273 | push = ndr_push_init_ctx(r);
|
---|
3274 | if (push == NULL) {
|
---|
3275 | talloc_free(r);
|
---|
3276 | return false;
|
---|
3277 | }
|
---|
3278 |
|
---|
3279 | /*
|
---|
3280 | * carry over the pointer count to the reply in case we are
|
---|
3281 | * using full pointer. See NDR specification for full pointers
|
---|
3282 | */
|
---|
3283 | push->ptr_count = pull->ptr_count;
|
---|
3284 |
|
---|
3285 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3286 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3287 | talloc_free(r);
|
---|
3288 | return false;
|
---|
3289 | }
|
---|
3290 |
|
---|
3291 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3292 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3293 |
|
---|
3294 | talloc_free(r);
|
---|
3295 |
|
---|
3296 | return true;
|
---|
3297 | }
|
---|
3298 |
|
---|
3299 | static bool api_NetShareAdd(struct pipes_struct *p)
|
---|
3300 | {
|
---|
3301 | const struct ndr_interface_call *call;
|
---|
3302 | struct ndr_pull *pull;
|
---|
3303 | struct ndr_push *push;
|
---|
3304 | enum ndr_err_code ndr_err;
|
---|
3305 | struct NetShareAdd *r;
|
---|
3306 |
|
---|
3307 | call = &ndr_table_libnetapi.calls[NDR_NETSHAREADD];
|
---|
3308 |
|
---|
3309 | r = talloc(talloc_tos(), struct NetShareAdd);
|
---|
3310 | if (r == NULL) {
|
---|
3311 | return false;
|
---|
3312 | }
|
---|
3313 |
|
---|
3314 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3315 | if (pull == NULL) {
|
---|
3316 | talloc_free(r);
|
---|
3317 | return false;
|
---|
3318 | }
|
---|
3319 |
|
---|
3320 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3321 | if (p->endian) {
|
---|
3322 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3323 | }
|
---|
3324 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3325 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3326 | talloc_free(r);
|
---|
3327 | return false;
|
---|
3328 | }
|
---|
3329 |
|
---|
3330 | if (DEBUGLEVEL >= 10) {
|
---|
3331 | NDR_PRINT_FUNCTION_DEBUG(NetShareAdd, NDR_IN, r);
|
---|
3332 | }
|
---|
3333 |
|
---|
3334 | ZERO_STRUCT(r->out);
|
---|
3335 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
3336 | if (r->out.parm_err == NULL) {
|
---|
3337 | talloc_free(r);
|
---|
3338 | return false;
|
---|
3339 | }
|
---|
3340 |
|
---|
3341 | r->out.result = _NetShareAdd(p, r);
|
---|
3342 |
|
---|
3343 | if (p->rng_fault_state) {
|
---|
3344 | talloc_free(r);
|
---|
3345 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3346 | return true;
|
---|
3347 | }
|
---|
3348 |
|
---|
3349 | if (DEBUGLEVEL >= 10) {
|
---|
3350 | NDR_PRINT_FUNCTION_DEBUG(NetShareAdd, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3351 | }
|
---|
3352 |
|
---|
3353 | push = ndr_push_init_ctx(r);
|
---|
3354 | if (push == NULL) {
|
---|
3355 | talloc_free(r);
|
---|
3356 | return false;
|
---|
3357 | }
|
---|
3358 |
|
---|
3359 | /*
|
---|
3360 | * carry over the pointer count to the reply in case we are
|
---|
3361 | * using full pointer. See NDR specification for full pointers
|
---|
3362 | */
|
---|
3363 | push->ptr_count = pull->ptr_count;
|
---|
3364 |
|
---|
3365 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3366 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3367 | talloc_free(r);
|
---|
3368 | return false;
|
---|
3369 | }
|
---|
3370 |
|
---|
3371 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3372 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3373 |
|
---|
3374 | talloc_free(r);
|
---|
3375 |
|
---|
3376 | return true;
|
---|
3377 | }
|
---|
3378 |
|
---|
3379 | static bool api_NetShareDel(struct pipes_struct *p)
|
---|
3380 | {
|
---|
3381 | const struct ndr_interface_call *call;
|
---|
3382 | struct ndr_pull *pull;
|
---|
3383 | struct ndr_push *push;
|
---|
3384 | enum ndr_err_code ndr_err;
|
---|
3385 | struct NetShareDel *r;
|
---|
3386 |
|
---|
3387 | call = &ndr_table_libnetapi.calls[NDR_NETSHAREDEL];
|
---|
3388 |
|
---|
3389 | r = talloc(talloc_tos(), struct NetShareDel);
|
---|
3390 | if (r == NULL) {
|
---|
3391 | return false;
|
---|
3392 | }
|
---|
3393 |
|
---|
3394 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3395 | if (pull == NULL) {
|
---|
3396 | talloc_free(r);
|
---|
3397 | return false;
|
---|
3398 | }
|
---|
3399 |
|
---|
3400 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3401 | if (p->endian) {
|
---|
3402 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3403 | }
|
---|
3404 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3405 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3406 | talloc_free(r);
|
---|
3407 | return false;
|
---|
3408 | }
|
---|
3409 |
|
---|
3410 | if (DEBUGLEVEL >= 10) {
|
---|
3411 | NDR_PRINT_FUNCTION_DEBUG(NetShareDel, NDR_IN, r);
|
---|
3412 | }
|
---|
3413 |
|
---|
3414 | r->out.result = _NetShareDel(p, r);
|
---|
3415 |
|
---|
3416 | if (p->rng_fault_state) {
|
---|
3417 | talloc_free(r);
|
---|
3418 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3419 | return true;
|
---|
3420 | }
|
---|
3421 |
|
---|
3422 | if (DEBUGLEVEL >= 10) {
|
---|
3423 | NDR_PRINT_FUNCTION_DEBUG(NetShareDel, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3424 | }
|
---|
3425 |
|
---|
3426 | push = ndr_push_init_ctx(r);
|
---|
3427 | if (push == NULL) {
|
---|
3428 | talloc_free(r);
|
---|
3429 | return false;
|
---|
3430 | }
|
---|
3431 |
|
---|
3432 | /*
|
---|
3433 | * carry over the pointer count to the reply in case we are
|
---|
3434 | * using full pointer. See NDR specification for full pointers
|
---|
3435 | */
|
---|
3436 | push->ptr_count = pull->ptr_count;
|
---|
3437 |
|
---|
3438 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3439 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3440 | talloc_free(r);
|
---|
3441 | return false;
|
---|
3442 | }
|
---|
3443 |
|
---|
3444 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3445 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3446 |
|
---|
3447 | talloc_free(r);
|
---|
3448 |
|
---|
3449 | return true;
|
---|
3450 | }
|
---|
3451 |
|
---|
3452 | static bool api_NetShareEnum(struct pipes_struct *p)
|
---|
3453 | {
|
---|
3454 | const struct ndr_interface_call *call;
|
---|
3455 | struct ndr_pull *pull;
|
---|
3456 | struct ndr_push *push;
|
---|
3457 | enum ndr_err_code ndr_err;
|
---|
3458 | struct NetShareEnum *r;
|
---|
3459 |
|
---|
3460 | call = &ndr_table_libnetapi.calls[NDR_NETSHAREENUM];
|
---|
3461 |
|
---|
3462 | r = talloc(talloc_tos(), struct NetShareEnum);
|
---|
3463 | if (r == NULL) {
|
---|
3464 | return false;
|
---|
3465 | }
|
---|
3466 |
|
---|
3467 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3468 | if (pull == NULL) {
|
---|
3469 | talloc_free(r);
|
---|
3470 | return false;
|
---|
3471 | }
|
---|
3472 |
|
---|
3473 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3474 | if (p->endian) {
|
---|
3475 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3476 | }
|
---|
3477 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3478 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3479 | talloc_free(r);
|
---|
3480 | return false;
|
---|
3481 | }
|
---|
3482 |
|
---|
3483 | if (DEBUGLEVEL >= 10) {
|
---|
3484 | NDR_PRINT_FUNCTION_DEBUG(NetShareEnum, NDR_IN, r);
|
---|
3485 | }
|
---|
3486 |
|
---|
3487 | ZERO_STRUCT(r->out);
|
---|
3488 | r->out.resume_handle = r->in.resume_handle;
|
---|
3489 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
3490 | if (r->out.buffer == NULL) {
|
---|
3491 | talloc_free(r);
|
---|
3492 | return false;
|
---|
3493 | }
|
---|
3494 |
|
---|
3495 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
3496 | if (r->out.entries_read == NULL) {
|
---|
3497 | talloc_free(r);
|
---|
3498 | return false;
|
---|
3499 | }
|
---|
3500 |
|
---|
3501 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
3502 | if (r->out.total_entries == NULL) {
|
---|
3503 | talloc_free(r);
|
---|
3504 | return false;
|
---|
3505 | }
|
---|
3506 |
|
---|
3507 | r->out.result = _NetShareEnum(p, r);
|
---|
3508 |
|
---|
3509 | if (p->rng_fault_state) {
|
---|
3510 | talloc_free(r);
|
---|
3511 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3512 | return true;
|
---|
3513 | }
|
---|
3514 |
|
---|
3515 | if (DEBUGLEVEL >= 10) {
|
---|
3516 | NDR_PRINT_FUNCTION_DEBUG(NetShareEnum, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3517 | }
|
---|
3518 |
|
---|
3519 | push = ndr_push_init_ctx(r);
|
---|
3520 | if (push == NULL) {
|
---|
3521 | talloc_free(r);
|
---|
3522 | return false;
|
---|
3523 | }
|
---|
3524 |
|
---|
3525 | /*
|
---|
3526 | * carry over the pointer count to the reply in case we are
|
---|
3527 | * using full pointer. See NDR specification for full pointers
|
---|
3528 | */
|
---|
3529 | push->ptr_count = pull->ptr_count;
|
---|
3530 |
|
---|
3531 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3532 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3533 | talloc_free(r);
|
---|
3534 | return false;
|
---|
3535 | }
|
---|
3536 |
|
---|
3537 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3538 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3539 |
|
---|
3540 | talloc_free(r);
|
---|
3541 |
|
---|
3542 | return true;
|
---|
3543 | }
|
---|
3544 |
|
---|
3545 | static bool api_NetShareGetInfo(struct pipes_struct *p)
|
---|
3546 | {
|
---|
3547 | const struct ndr_interface_call *call;
|
---|
3548 | struct ndr_pull *pull;
|
---|
3549 | struct ndr_push *push;
|
---|
3550 | enum ndr_err_code ndr_err;
|
---|
3551 | struct NetShareGetInfo *r;
|
---|
3552 |
|
---|
3553 | call = &ndr_table_libnetapi.calls[NDR_NETSHAREGETINFO];
|
---|
3554 |
|
---|
3555 | r = talloc(talloc_tos(), struct NetShareGetInfo);
|
---|
3556 | if (r == NULL) {
|
---|
3557 | return false;
|
---|
3558 | }
|
---|
3559 |
|
---|
3560 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3561 | if (pull == NULL) {
|
---|
3562 | talloc_free(r);
|
---|
3563 | return false;
|
---|
3564 | }
|
---|
3565 |
|
---|
3566 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3567 | if (p->endian) {
|
---|
3568 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3569 | }
|
---|
3570 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3571 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3572 | talloc_free(r);
|
---|
3573 | return false;
|
---|
3574 | }
|
---|
3575 |
|
---|
3576 | if (DEBUGLEVEL >= 10) {
|
---|
3577 | NDR_PRINT_FUNCTION_DEBUG(NetShareGetInfo, NDR_IN, r);
|
---|
3578 | }
|
---|
3579 |
|
---|
3580 | ZERO_STRUCT(r->out);
|
---|
3581 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
3582 | if (r->out.buffer == NULL) {
|
---|
3583 | talloc_free(r);
|
---|
3584 | return false;
|
---|
3585 | }
|
---|
3586 |
|
---|
3587 | r->out.result = _NetShareGetInfo(p, r);
|
---|
3588 |
|
---|
3589 | if (p->rng_fault_state) {
|
---|
3590 | talloc_free(r);
|
---|
3591 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3592 | return true;
|
---|
3593 | }
|
---|
3594 |
|
---|
3595 | if (DEBUGLEVEL >= 10) {
|
---|
3596 | NDR_PRINT_FUNCTION_DEBUG(NetShareGetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3597 | }
|
---|
3598 |
|
---|
3599 | push = ndr_push_init_ctx(r);
|
---|
3600 | if (push == NULL) {
|
---|
3601 | talloc_free(r);
|
---|
3602 | return false;
|
---|
3603 | }
|
---|
3604 |
|
---|
3605 | /*
|
---|
3606 | * carry over the pointer count to the reply in case we are
|
---|
3607 | * using full pointer. See NDR specification for full pointers
|
---|
3608 | */
|
---|
3609 | push->ptr_count = pull->ptr_count;
|
---|
3610 |
|
---|
3611 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3612 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3613 | talloc_free(r);
|
---|
3614 | return false;
|
---|
3615 | }
|
---|
3616 |
|
---|
3617 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3618 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3619 |
|
---|
3620 | talloc_free(r);
|
---|
3621 |
|
---|
3622 | return true;
|
---|
3623 | }
|
---|
3624 |
|
---|
3625 | static bool api_NetShareSetInfo(struct pipes_struct *p)
|
---|
3626 | {
|
---|
3627 | const struct ndr_interface_call *call;
|
---|
3628 | struct ndr_pull *pull;
|
---|
3629 | struct ndr_push *push;
|
---|
3630 | enum ndr_err_code ndr_err;
|
---|
3631 | struct NetShareSetInfo *r;
|
---|
3632 |
|
---|
3633 | call = &ndr_table_libnetapi.calls[NDR_NETSHARESETINFO];
|
---|
3634 |
|
---|
3635 | r = talloc(talloc_tos(), struct NetShareSetInfo);
|
---|
3636 | if (r == NULL) {
|
---|
3637 | return false;
|
---|
3638 | }
|
---|
3639 |
|
---|
3640 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3641 | if (pull == NULL) {
|
---|
3642 | talloc_free(r);
|
---|
3643 | return false;
|
---|
3644 | }
|
---|
3645 |
|
---|
3646 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3647 | if (p->endian) {
|
---|
3648 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3649 | }
|
---|
3650 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3651 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3652 | talloc_free(r);
|
---|
3653 | return false;
|
---|
3654 | }
|
---|
3655 |
|
---|
3656 | if (DEBUGLEVEL >= 10) {
|
---|
3657 | NDR_PRINT_FUNCTION_DEBUG(NetShareSetInfo, NDR_IN, r);
|
---|
3658 | }
|
---|
3659 |
|
---|
3660 | ZERO_STRUCT(r->out);
|
---|
3661 | r->out.parm_err = talloc_zero(r, uint32_t);
|
---|
3662 | if (r->out.parm_err == NULL) {
|
---|
3663 | talloc_free(r);
|
---|
3664 | return false;
|
---|
3665 | }
|
---|
3666 |
|
---|
3667 | r->out.result = _NetShareSetInfo(p, r);
|
---|
3668 |
|
---|
3669 | if (p->rng_fault_state) {
|
---|
3670 | talloc_free(r);
|
---|
3671 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3672 | return true;
|
---|
3673 | }
|
---|
3674 |
|
---|
3675 | if (DEBUGLEVEL >= 10) {
|
---|
3676 | NDR_PRINT_FUNCTION_DEBUG(NetShareSetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3677 | }
|
---|
3678 |
|
---|
3679 | push = ndr_push_init_ctx(r);
|
---|
3680 | if (push == NULL) {
|
---|
3681 | talloc_free(r);
|
---|
3682 | return false;
|
---|
3683 | }
|
---|
3684 |
|
---|
3685 | /*
|
---|
3686 | * carry over the pointer count to the reply in case we are
|
---|
3687 | * using full pointer. See NDR specification for full pointers
|
---|
3688 | */
|
---|
3689 | push->ptr_count = pull->ptr_count;
|
---|
3690 |
|
---|
3691 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3692 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3693 | talloc_free(r);
|
---|
3694 | return false;
|
---|
3695 | }
|
---|
3696 |
|
---|
3697 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3698 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3699 |
|
---|
3700 | talloc_free(r);
|
---|
3701 |
|
---|
3702 | return true;
|
---|
3703 | }
|
---|
3704 |
|
---|
3705 | static bool api_NetFileClose(struct pipes_struct *p)
|
---|
3706 | {
|
---|
3707 | const struct ndr_interface_call *call;
|
---|
3708 | struct ndr_pull *pull;
|
---|
3709 | struct ndr_push *push;
|
---|
3710 | enum ndr_err_code ndr_err;
|
---|
3711 | struct NetFileClose *r;
|
---|
3712 |
|
---|
3713 | call = &ndr_table_libnetapi.calls[NDR_NETFILECLOSE];
|
---|
3714 |
|
---|
3715 | r = talloc(talloc_tos(), struct NetFileClose);
|
---|
3716 | if (r == NULL) {
|
---|
3717 | return false;
|
---|
3718 | }
|
---|
3719 |
|
---|
3720 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3721 | if (pull == NULL) {
|
---|
3722 | talloc_free(r);
|
---|
3723 | return false;
|
---|
3724 | }
|
---|
3725 |
|
---|
3726 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3727 | if (p->endian) {
|
---|
3728 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3729 | }
|
---|
3730 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3731 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3732 | talloc_free(r);
|
---|
3733 | return false;
|
---|
3734 | }
|
---|
3735 |
|
---|
3736 | if (DEBUGLEVEL >= 10) {
|
---|
3737 | NDR_PRINT_FUNCTION_DEBUG(NetFileClose, NDR_IN, r);
|
---|
3738 | }
|
---|
3739 |
|
---|
3740 | r->out.result = _NetFileClose(p, r);
|
---|
3741 |
|
---|
3742 | if (p->rng_fault_state) {
|
---|
3743 | talloc_free(r);
|
---|
3744 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3745 | return true;
|
---|
3746 | }
|
---|
3747 |
|
---|
3748 | if (DEBUGLEVEL >= 10) {
|
---|
3749 | NDR_PRINT_FUNCTION_DEBUG(NetFileClose, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3750 | }
|
---|
3751 |
|
---|
3752 | push = ndr_push_init_ctx(r);
|
---|
3753 | if (push == NULL) {
|
---|
3754 | talloc_free(r);
|
---|
3755 | return false;
|
---|
3756 | }
|
---|
3757 |
|
---|
3758 | /*
|
---|
3759 | * carry over the pointer count to the reply in case we are
|
---|
3760 | * using full pointer. See NDR specification for full pointers
|
---|
3761 | */
|
---|
3762 | push->ptr_count = pull->ptr_count;
|
---|
3763 |
|
---|
3764 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3765 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3766 | talloc_free(r);
|
---|
3767 | return false;
|
---|
3768 | }
|
---|
3769 |
|
---|
3770 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3771 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3772 |
|
---|
3773 | talloc_free(r);
|
---|
3774 |
|
---|
3775 | return true;
|
---|
3776 | }
|
---|
3777 |
|
---|
3778 | static bool api_NetFileGetInfo(struct pipes_struct *p)
|
---|
3779 | {
|
---|
3780 | const struct ndr_interface_call *call;
|
---|
3781 | struct ndr_pull *pull;
|
---|
3782 | struct ndr_push *push;
|
---|
3783 | enum ndr_err_code ndr_err;
|
---|
3784 | struct NetFileGetInfo *r;
|
---|
3785 |
|
---|
3786 | call = &ndr_table_libnetapi.calls[NDR_NETFILEGETINFO];
|
---|
3787 |
|
---|
3788 | r = talloc(talloc_tos(), struct NetFileGetInfo);
|
---|
3789 | if (r == NULL) {
|
---|
3790 | return false;
|
---|
3791 | }
|
---|
3792 |
|
---|
3793 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3794 | if (pull == NULL) {
|
---|
3795 | talloc_free(r);
|
---|
3796 | return false;
|
---|
3797 | }
|
---|
3798 |
|
---|
3799 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3800 | if (p->endian) {
|
---|
3801 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3802 | }
|
---|
3803 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3804 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3805 | talloc_free(r);
|
---|
3806 | return false;
|
---|
3807 | }
|
---|
3808 |
|
---|
3809 | if (DEBUGLEVEL >= 10) {
|
---|
3810 | NDR_PRINT_FUNCTION_DEBUG(NetFileGetInfo, NDR_IN, r);
|
---|
3811 | }
|
---|
3812 |
|
---|
3813 | ZERO_STRUCT(r->out);
|
---|
3814 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
3815 | if (r->out.buffer == NULL) {
|
---|
3816 | talloc_free(r);
|
---|
3817 | return false;
|
---|
3818 | }
|
---|
3819 |
|
---|
3820 | r->out.result = _NetFileGetInfo(p, r);
|
---|
3821 |
|
---|
3822 | if (p->rng_fault_state) {
|
---|
3823 | talloc_free(r);
|
---|
3824 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3825 | return true;
|
---|
3826 | }
|
---|
3827 |
|
---|
3828 | if (DEBUGLEVEL >= 10) {
|
---|
3829 | NDR_PRINT_FUNCTION_DEBUG(NetFileGetInfo, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3830 | }
|
---|
3831 |
|
---|
3832 | push = ndr_push_init_ctx(r);
|
---|
3833 | if (push == NULL) {
|
---|
3834 | talloc_free(r);
|
---|
3835 | return false;
|
---|
3836 | }
|
---|
3837 |
|
---|
3838 | /*
|
---|
3839 | * carry over the pointer count to the reply in case we are
|
---|
3840 | * using full pointer. See NDR specification for full pointers
|
---|
3841 | */
|
---|
3842 | push->ptr_count = pull->ptr_count;
|
---|
3843 |
|
---|
3844 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3845 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3846 | talloc_free(r);
|
---|
3847 | return false;
|
---|
3848 | }
|
---|
3849 |
|
---|
3850 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3851 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3852 |
|
---|
3853 | talloc_free(r);
|
---|
3854 |
|
---|
3855 | return true;
|
---|
3856 | }
|
---|
3857 |
|
---|
3858 | static bool api_NetFileEnum(struct pipes_struct *p)
|
---|
3859 | {
|
---|
3860 | const struct ndr_interface_call *call;
|
---|
3861 | struct ndr_pull *pull;
|
---|
3862 | struct ndr_push *push;
|
---|
3863 | enum ndr_err_code ndr_err;
|
---|
3864 | struct NetFileEnum *r;
|
---|
3865 |
|
---|
3866 | call = &ndr_table_libnetapi.calls[NDR_NETFILEENUM];
|
---|
3867 |
|
---|
3868 | r = talloc(talloc_tos(), struct NetFileEnum);
|
---|
3869 | if (r == NULL) {
|
---|
3870 | return false;
|
---|
3871 | }
|
---|
3872 |
|
---|
3873 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3874 | if (pull == NULL) {
|
---|
3875 | talloc_free(r);
|
---|
3876 | return false;
|
---|
3877 | }
|
---|
3878 |
|
---|
3879 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3880 | if (p->endian) {
|
---|
3881 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3882 | }
|
---|
3883 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3884 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3885 | talloc_free(r);
|
---|
3886 | return false;
|
---|
3887 | }
|
---|
3888 |
|
---|
3889 | if (DEBUGLEVEL >= 10) {
|
---|
3890 | NDR_PRINT_FUNCTION_DEBUG(NetFileEnum, NDR_IN, r);
|
---|
3891 | }
|
---|
3892 |
|
---|
3893 | ZERO_STRUCT(r->out);
|
---|
3894 | r->out.resume_handle = r->in.resume_handle;
|
---|
3895 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
3896 | if (r->out.buffer == NULL) {
|
---|
3897 | talloc_free(r);
|
---|
3898 | return false;
|
---|
3899 | }
|
---|
3900 |
|
---|
3901 | r->out.entries_read = talloc_zero(r, uint32_t);
|
---|
3902 | if (r->out.entries_read == NULL) {
|
---|
3903 | talloc_free(r);
|
---|
3904 | return false;
|
---|
3905 | }
|
---|
3906 |
|
---|
3907 | r->out.total_entries = talloc_zero(r, uint32_t);
|
---|
3908 | if (r->out.total_entries == NULL) {
|
---|
3909 | talloc_free(r);
|
---|
3910 | return false;
|
---|
3911 | }
|
---|
3912 |
|
---|
3913 | r->out.result = _NetFileEnum(p, r);
|
---|
3914 |
|
---|
3915 | if (p->rng_fault_state) {
|
---|
3916 | talloc_free(r);
|
---|
3917 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3918 | return true;
|
---|
3919 | }
|
---|
3920 |
|
---|
3921 | if (DEBUGLEVEL >= 10) {
|
---|
3922 | NDR_PRINT_FUNCTION_DEBUG(NetFileEnum, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3923 | }
|
---|
3924 |
|
---|
3925 | push = ndr_push_init_ctx(r);
|
---|
3926 | if (push == NULL) {
|
---|
3927 | talloc_free(r);
|
---|
3928 | return false;
|
---|
3929 | }
|
---|
3930 |
|
---|
3931 | /*
|
---|
3932 | * carry over the pointer count to the reply in case we are
|
---|
3933 | * using full pointer. See NDR specification for full pointers
|
---|
3934 | */
|
---|
3935 | push->ptr_count = pull->ptr_count;
|
---|
3936 |
|
---|
3937 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
3938 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3939 | talloc_free(r);
|
---|
3940 | return false;
|
---|
3941 | }
|
---|
3942 |
|
---|
3943 | p->out_data.rdata = ndr_push_blob(push);
|
---|
3944 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
3945 |
|
---|
3946 | talloc_free(r);
|
---|
3947 |
|
---|
3948 | return true;
|
---|
3949 | }
|
---|
3950 |
|
---|
3951 | static bool api_NetShutdownInit(struct pipes_struct *p)
|
---|
3952 | {
|
---|
3953 | const struct ndr_interface_call *call;
|
---|
3954 | struct ndr_pull *pull;
|
---|
3955 | struct ndr_push *push;
|
---|
3956 | enum ndr_err_code ndr_err;
|
---|
3957 | struct NetShutdownInit *r;
|
---|
3958 |
|
---|
3959 | call = &ndr_table_libnetapi.calls[NDR_NETSHUTDOWNINIT];
|
---|
3960 |
|
---|
3961 | r = talloc(talloc_tos(), struct NetShutdownInit);
|
---|
3962 | if (r == NULL) {
|
---|
3963 | return false;
|
---|
3964 | }
|
---|
3965 |
|
---|
3966 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
3967 | if (pull == NULL) {
|
---|
3968 | talloc_free(r);
|
---|
3969 | return false;
|
---|
3970 | }
|
---|
3971 |
|
---|
3972 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
3973 | if (p->endian) {
|
---|
3974 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
3975 | }
|
---|
3976 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
3977 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
3978 | talloc_free(r);
|
---|
3979 | return false;
|
---|
3980 | }
|
---|
3981 |
|
---|
3982 | if (DEBUGLEVEL >= 10) {
|
---|
3983 | NDR_PRINT_FUNCTION_DEBUG(NetShutdownInit, NDR_IN, r);
|
---|
3984 | }
|
---|
3985 |
|
---|
3986 | r->out.result = _NetShutdownInit(p, r);
|
---|
3987 |
|
---|
3988 | if (p->rng_fault_state) {
|
---|
3989 | talloc_free(r);
|
---|
3990 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
3991 | return true;
|
---|
3992 | }
|
---|
3993 |
|
---|
3994 | if (DEBUGLEVEL >= 10) {
|
---|
3995 | NDR_PRINT_FUNCTION_DEBUG(NetShutdownInit, NDR_OUT | NDR_SET_VALUES, r);
|
---|
3996 | }
|
---|
3997 |
|
---|
3998 | push = ndr_push_init_ctx(r);
|
---|
3999 | if (push == NULL) {
|
---|
4000 | talloc_free(r);
|
---|
4001 | return false;
|
---|
4002 | }
|
---|
4003 |
|
---|
4004 | /*
|
---|
4005 | * carry over the pointer count to the reply in case we are
|
---|
4006 | * using full pointer. See NDR specification for full pointers
|
---|
4007 | */
|
---|
4008 | push->ptr_count = pull->ptr_count;
|
---|
4009 |
|
---|
4010 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
4011 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4012 | talloc_free(r);
|
---|
4013 | return false;
|
---|
4014 | }
|
---|
4015 |
|
---|
4016 | p->out_data.rdata = ndr_push_blob(push);
|
---|
4017 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
4018 |
|
---|
4019 | talloc_free(r);
|
---|
4020 |
|
---|
4021 | return true;
|
---|
4022 | }
|
---|
4023 |
|
---|
4024 | static bool api_NetShutdownAbort(struct pipes_struct *p)
|
---|
4025 | {
|
---|
4026 | const struct ndr_interface_call *call;
|
---|
4027 | struct ndr_pull *pull;
|
---|
4028 | struct ndr_push *push;
|
---|
4029 | enum ndr_err_code ndr_err;
|
---|
4030 | struct NetShutdownAbort *r;
|
---|
4031 |
|
---|
4032 | call = &ndr_table_libnetapi.calls[NDR_NETSHUTDOWNABORT];
|
---|
4033 |
|
---|
4034 | r = talloc(talloc_tos(), struct NetShutdownAbort);
|
---|
4035 | if (r == NULL) {
|
---|
4036 | return false;
|
---|
4037 | }
|
---|
4038 |
|
---|
4039 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
4040 | if (pull == NULL) {
|
---|
4041 | talloc_free(r);
|
---|
4042 | return false;
|
---|
4043 | }
|
---|
4044 |
|
---|
4045 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
4046 | if (p->endian) {
|
---|
4047 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
4048 | }
|
---|
4049 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
4050 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4051 | talloc_free(r);
|
---|
4052 | return false;
|
---|
4053 | }
|
---|
4054 |
|
---|
4055 | if (DEBUGLEVEL >= 10) {
|
---|
4056 | NDR_PRINT_FUNCTION_DEBUG(NetShutdownAbort, NDR_IN, r);
|
---|
4057 | }
|
---|
4058 |
|
---|
4059 | r->out.result = _NetShutdownAbort(p, r);
|
---|
4060 |
|
---|
4061 | if (p->rng_fault_state) {
|
---|
4062 | talloc_free(r);
|
---|
4063 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
4064 | return true;
|
---|
4065 | }
|
---|
4066 |
|
---|
4067 | if (DEBUGLEVEL >= 10) {
|
---|
4068 | NDR_PRINT_FUNCTION_DEBUG(NetShutdownAbort, NDR_OUT | NDR_SET_VALUES, r);
|
---|
4069 | }
|
---|
4070 |
|
---|
4071 | push = ndr_push_init_ctx(r);
|
---|
4072 | if (push == NULL) {
|
---|
4073 | talloc_free(r);
|
---|
4074 | return false;
|
---|
4075 | }
|
---|
4076 |
|
---|
4077 | /*
|
---|
4078 | * carry over the pointer count to the reply in case we are
|
---|
4079 | * using full pointer. See NDR specification for full pointers
|
---|
4080 | */
|
---|
4081 | push->ptr_count = pull->ptr_count;
|
---|
4082 |
|
---|
4083 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
4084 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4085 | talloc_free(r);
|
---|
4086 | return false;
|
---|
4087 | }
|
---|
4088 |
|
---|
4089 | p->out_data.rdata = ndr_push_blob(push);
|
---|
4090 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
4091 |
|
---|
4092 | talloc_free(r);
|
---|
4093 |
|
---|
4094 | return true;
|
---|
4095 | }
|
---|
4096 |
|
---|
4097 | static bool api_I_NetLogonControl(struct pipes_struct *p)
|
---|
4098 | {
|
---|
4099 | const struct ndr_interface_call *call;
|
---|
4100 | struct ndr_pull *pull;
|
---|
4101 | struct ndr_push *push;
|
---|
4102 | enum ndr_err_code ndr_err;
|
---|
4103 | struct I_NetLogonControl *r;
|
---|
4104 |
|
---|
4105 | call = &ndr_table_libnetapi.calls[NDR_I_NETLOGONCONTROL];
|
---|
4106 |
|
---|
4107 | r = talloc(talloc_tos(), struct I_NetLogonControl);
|
---|
4108 | if (r == NULL) {
|
---|
4109 | return false;
|
---|
4110 | }
|
---|
4111 |
|
---|
4112 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
4113 | if (pull == NULL) {
|
---|
4114 | talloc_free(r);
|
---|
4115 | return false;
|
---|
4116 | }
|
---|
4117 |
|
---|
4118 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
4119 | if (p->endian) {
|
---|
4120 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
4121 | }
|
---|
4122 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
4123 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4124 | talloc_free(r);
|
---|
4125 | return false;
|
---|
4126 | }
|
---|
4127 |
|
---|
4128 | if (DEBUGLEVEL >= 10) {
|
---|
4129 | NDR_PRINT_FUNCTION_DEBUG(I_NetLogonControl, NDR_IN, r);
|
---|
4130 | }
|
---|
4131 |
|
---|
4132 | ZERO_STRUCT(r->out);
|
---|
4133 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
4134 | if (r->out.buffer == NULL) {
|
---|
4135 | talloc_free(r);
|
---|
4136 | return false;
|
---|
4137 | }
|
---|
4138 |
|
---|
4139 | r->out.result = _I_NetLogonControl(p, r);
|
---|
4140 |
|
---|
4141 | if (p->rng_fault_state) {
|
---|
4142 | talloc_free(r);
|
---|
4143 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
4144 | return true;
|
---|
4145 | }
|
---|
4146 |
|
---|
4147 | if (DEBUGLEVEL >= 10) {
|
---|
4148 | NDR_PRINT_FUNCTION_DEBUG(I_NetLogonControl, NDR_OUT | NDR_SET_VALUES, r);
|
---|
4149 | }
|
---|
4150 |
|
---|
4151 | push = ndr_push_init_ctx(r);
|
---|
4152 | if (push == NULL) {
|
---|
4153 | talloc_free(r);
|
---|
4154 | return false;
|
---|
4155 | }
|
---|
4156 |
|
---|
4157 | /*
|
---|
4158 | * carry over the pointer count to the reply in case we are
|
---|
4159 | * using full pointer. See NDR specification for full pointers
|
---|
4160 | */
|
---|
4161 | push->ptr_count = pull->ptr_count;
|
---|
4162 |
|
---|
4163 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
4164 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4165 | talloc_free(r);
|
---|
4166 | return false;
|
---|
4167 | }
|
---|
4168 |
|
---|
4169 | p->out_data.rdata = ndr_push_blob(push);
|
---|
4170 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
4171 |
|
---|
4172 | talloc_free(r);
|
---|
4173 |
|
---|
4174 | return true;
|
---|
4175 | }
|
---|
4176 |
|
---|
4177 | static bool api_I_NetLogonControl2(struct pipes_struct *p)
|
---|
4178 | {
|
---|
4179 | const struct ndr_interface_call *call;
|
---|
4180 | struct ndr_pull *pull;
|
---|
4181 | struct ndr_push *push;
|
---|
4182 | enum ndr_err_code ndr_err;
|
---|
4183 | struct I_NetLogonControl2 *r;
|
---|
4184 |
|
---|
4185 | call = &ndr_table_libnetapi.calls[NDR_I_NETLOGONCONTROL2];
|
---|
4186 |
|
---|
4187 | r = talloc(talloc_tos(), struct I_NetLogonControl2);
|
---|
4188 | if (r == NULL) {
|
---|
4189 | return false;
|
---|
4190 | }
|
---|
4191 |
|
---|
4192 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
4193 | if (pull == NULL) {
|
---|
4194 | talloc_free(r);
|
---|
4195 | return false;
|
---|
4196 | }
|
---|
4197 |
|
---|
4198 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
4199 | if (p->endian) {
|
---|
4200 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
4201 | }
|
---|
4202 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
4203 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4204 | talloc_free(r);
|
---|
4205 | return false;
|
---|
4206 | }
|
---|
4207 |
|
---|
4208 | if (DEBUGLEVEL >= 10) {
|
---|
4209 | NDR_PRINT_FUNCTION_DEBUG(I_NetLogonControl2, NDR_IN, r);
|
---|
4210 | }
|
---|
4211 |
|
---|
4212 | ZERO_STRUCT(r->out);
|
---|
4213 | r->out.buffer = talloc_zero(r, uint8_t *);
|
---|
4214 | if (r->out.buffer == NULL) {
|
---|
4215 | talloc_free(r);
|
---|
4216 | return false;
|
---|
4217 | }
|
---|
4218 |
|
---|
4219 | r->out.result = _I_NetLogonControl2(p, r);
|
---|
4220 |
|
---|
4221 | if (p->rng_fault_state) {
|
---|
4222 | talloc_free(r);
|
---|
4223 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
4224 | return true;
|
---|
4225 | }
|
---|
4226 |
|
---|
4227 | if (DEBUGLEVEL >= 10) {
|
---|
4228 | NDR_PRINT_FUNCTION_DEBUG(I_NetLogonControl2, NDR_OUT | NDR_SET_VALUES, r);
|
---|
4229 | }
|
---|
4230 |
|
---|
4231 | push = ndr_push_init_ctx(r);
|
---|
4232 | if (push == NULL) {
|
---|
4233 | talloc_free(r);
|
---|
4234 | return false;
|
---|
4235 | }
|
---|
4236 |
|
---|
4237 | /*
|
---|
4238 | * carry over the pointer count to the reply in case we are
|
---|
4239 | * using full pointer. See NDR specification for full pointers
|
---|
4240 | */
|
---|
4241 | push->ptr_count = pull->ptr_count;
|
---|
4242 |
|
---|
4243 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
4244 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
4245 | talloc_free(r);
|
---|
4246 | return false;
|
---|
4247 | }
|
---|
4248 |
|
---|
4249 | p->out_data.rdata = ndr_push_blob(push);
|
---|
4250 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
4251 |
|
---|
4252 | talloc_free(r);
|
---|
4253 |
|
---|
4254 | return true;
|
---|
4255 | }
|
---|
4256 |
|
---|
4257 |
|
---|
4258 | /* Tables */
|
---|
4259 | static struct api_struct api_libnetapi_cmds[] =
|
---|
4260 | {
|
---|
4261 | {"NETJOINDOMAIN", NDR_NETJOINDOMAIN, api_NetJoinDomain},
|
---|
4262 | {"NETUNJOINDOMAIN", NDR_NETUNJOINDOMAIN, api_NetUnjoinDomain},
|
---|
4263 | {"NETGETJOININFORMATION", NDR_NETGETJOININFORMATION, api_NetGetJoinInformation},
|
---|
4264 | {"NETGETJOINABLEOUS", NDR_NETGETJOINABLEOUS, api_NetGetJoinableOUs},
|
---|
4265 | {"NETRENAMEMACHINEINDOMAIN", NDR_NETRENAMEMACHINEINDOMAIN, api_NetRenameMachineInDomain},
|
---|
4266 | {"NETSERVERGETINFO", NDR_NETSERVERGETINFO, api_NetServerGetInfo},
|
---|
4267 | {"NETSERVERSETINFO", NDR_NETSERVERSETINFO, api_NetServerSetInfo},
|
---|
4268 | {"NETGETDCNAME", NDR_NETGETDCNAME, api_NetGetDCName},
|
---|
4269 | {"NETGETANYDCNAME", NDR_NETGETANYDCNAME, api_NetGetAnyDCName},
|
---|
4270 | {"DSGETDCNAME", NDR_DSGETDCNAME, api_DsGetDcName},
|
---|
4271 | {"NETUSERADD", NDR_NETUSERADD, api_NetUserAdd},
|
---|
4272 | {"NETUSERDEL", NDR_NETUSERDEL, api_NetUserDel},
|
---|
4273 | {"NETUSERENUM", NDR_NETUSERENUM, api_NetUserEnum},
|
---|
4274 | {"NETUSERCHANGEPASSWORD", NDR_NETUSERCHANGEPASSWORD, api_NetUserChangePassword},
|
---|
4275 | {"NETUSERGETINFO", NDR_NETUSERGETINFO, api_NetUserGetInfo},
|
---|
4276 | {"NETUSERSETINFO", NDR_NETUSERSETINFO, api_NetUserSetInfo},
|
---|
4277 | {"NETUSERGETGROUPS", NDR_NETUSERGETGROUPS, api_NetUserGetGroups},
|
---|
4278 | {"NETUSERSETGROUPS", NDR_NETUSERSETGROUPS, api_NetUserSetGroups},
|
---|
4279 | {"NETUSERGETLOCALGROUPS", NDR_NETUSERGETLOCALGROUPS, api_NetUserGetLocalGroups},
|
---|
4280 | {"NETUSERMODALSGET", NDR_NETUSERMODALSGET, api_NetUserModalsGet},
|
---|
4281 | {"NETUSERMODALSSET", NDR_NETUSERMODALSSET, api_NetUserModalsSet},
|
---|
4282 | {"NETQUERYDISPLAYINFORMATION", NDR_NETQUERYDISPLAYINFORMATION, api_NetQueryDisplayInformation},
|
---|
4283 | {"NETGROUPADD", NDR_NETGROUPADD, api_NetGroupAdd},
|
---|
4284 | {"NETGROUPDEL", NDR_NETGROUPDEL, api_NetGroupDel},
|
---|
4285 | {"NETGROUPENUM", NDR_NETGROUPENUM, api_NetGroupEnum},
|
---|
4286 | {"NETGROUPSETINFO", NDR_NETGROUPSETINFO, api_NetGroupSetInfo},
|
---|
4287 | {"NETGROUPGETINFO", NDR_NETGROUPGETINFO, api_NetGroupGetInfo},
|
---|
4288 | {"NETGROUPADDUSER", NDR_NETGROUPADDUSER, api_NetGroupAddUser},
|
---|
4289 | {"NETGROUPDELUSER", NDR_NETGROUPDELUSER, api_NetGroupDelUser},
|
---|
4290 | {"NETGROUPGETUSERS", NDR_NETGROUPGETUSERS, api_NetGroupGetUsers},
|
---|
4291 | {"NETGROUPSETUSERS", NDR_NETGROUPSETUSERS, api_NetGroupSetUsers},
|
---|
4292 | {"NETLOCALGROUPADD", NDR_NETLOCALGROUPADD, api_NetLocalGroupAdd},
|
---|
4293 | {"NETLOCALGROUPDEL", NDR_NETLOCALGROUPDEL, api_NetLocalGroupDel},
|
---|
4294 | {"NETLOCALGROUPGETINFO", NDR_NETLOCALGROUPGETINFO, api_NetLocalGroupGetInfo},
|
---|
4295 | {"NETLOCALGROUPSETINFO", NDR_NETLOCALGROUPSETINFO, api_NetLocalGroupSetInfo},
|
---|
4296 | {"NETLOCALGROUPENUM", NDR_NETLOCALGROUPENUM, api_NetLocalGroupEnum},
|
---|
4297 | {"NETLOCALGROUPADDMEMBERS", NDR_NETLOCALGROUPADDMEMBERS, api_NetLocalGroupAddMembers},
|
---|
4298 | {"NETLOCALGROUPDELMEMBERS", NDR_NETLOCALGROUPDELMEMBERS, api_NetLocalGroupDelMembers},
|
---|
4299 | {"NETLOCALGROUPGETMEMBERS", NDR_NETLOCALGROUPGETMEMBERS, api_NetLocalGroupGetMembers},
|
---|
4300 | {"NETLOCALGROUPSETMEMBERS", NDR_NETLOCALGROUPSETMEMBERS, api_NetLocalGroupSetMembers},
|
---|
4301 | {"NETREMOTETOD", NDR_NETREMOTETOD, api_NetRemoteTOD},
|
---|
4302 | {"NETSHAREADD", NDR_NETSHAREADD, api_NetShareAdd},
|
---|
4303 | {"NETSHAREDEL", NDR_NETSHAREDEL, api_NetShareDel},
|
---|
4304 | {"NETSHAREENUM", NDR_NETSHAREENUM, api_NetShareEnum},
|
---|
4305 | {"NETSHAREGETINFO", NDR_NETSHAREGETINFO, api_NetShareGetInfo},
|
---|
4306 | {"NETSHARESETINFO", NDR_NETSHARESETINFO, api_NetShareSetInfo},
|
---|
4307 | {"NETFILECLOSE", NDR_NETFILECLOSE, api_NetFileClose},
|
---|
4308 | {"NETFILEGETINFO", NDR_NETFILEGETINFO, api_NetFileGetInfo},
|
---|
4309 | {"NETFILEENUM", NDR_NETFILEENUM, api_NetFileEnum},
|
---|
4310 | {"NETSHUTDOWNINIT", NDR_NETSHUTDOWNINIT, api_NetShutdownInit},
|
---|
4311 | {"NETSHUTDOWNABORT", NDR_NETSHUTDOWNABORT, api_NetShutdownAbort},
|
---|
4312 | {"I_NETLOGONCONTROL", NDR_I_NETLOGONCONTROL, api_I_NetLogonControl},
|
---|
4313 | {"I_NETLOGONCONTROL2", NDR_I_NETLOGONCONTROL2, api_I_NetLogonControl2},
|
---|
4314 | };
|
---|
4315 |
|
---|
4316 | void libnetapi_get_pipe_fns(struct api_struct **fns, int *n_fns)
|
---|
4317 | {
|
---|
4318 | *fns = api_libnetapi_cmds;
|
---|
4319 | *n_fns = sizeof(api_libnetapi_cmds) / sizeof(struct api_struct);
|
---|
4320 | }
|
---|
4321 |
|
---|
4322 | NTSTATUS rpc_libnetapi_init(const struct rpc_srv_callbacks *rpc_srv_cb)
|
---|
4323 | {
|
---|
4324 | return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "libnetapi", "libnetapi", &ndr_table_libnetapi, api_libnetapi_cmds, sizeof(api_libnetapi_cmds) / sizeof(struct api_struct), rpc_srv_cb);
|
---|
4325 | }
|
---|
4326 |
|
---|
4327 | NTSTATUS rpc_libnetapi_shutdown(void)
|
---|
4328 | {
|
---|
4329 | return rpc_srv_unregister(&ndr_table_libnetapi);
|
---|
4330 | }
|
---|