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_dsbackup.h"
|
---|
9 |
|
---|
10 | static bool api_HrRBackupPrepare(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 HrRBackupPrepare *r;
|
---|
17 |
|
---|
18 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPPREPARE];
|
---|
19 |
|
---|
20 | r = talloc(talloc_tos(), struct HrRBackupPrepare);
|
---|
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(HrRBackupPrepare, NDR_IN, r);
|
---|
43 | }
|
---|
44 |
|
---|
45 | _HrRBackupPrepare(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(HrRBackupPrepare, 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_HrRBackupEnd(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 HrRBackupEnd *r;
|
---|
90 |
|
---|
91 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPEND];
|
---|
92 |
|
---|
93 | r = talloc(talloc_tos(), struct HrRBackupEnd);
|
---|
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(HrRBackupEnd, NDR_IN, r);
|
---|
116 | }
|
---|
117 |
|
---|
118 | _HrRBackupEnd(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(HrRBackupEnd, 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_HrRBackupGetAttachmentInformation(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 HrRBackupGetAttachmentInformation *r;
|
---|
163 |
|
---|
164 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPGETATTACHMENTINFORMATION];
|
---|
165 |
|
---|
166 | r = talloc(talloc_tos(), struct HrRBackupGetAttachmentInformation);
|
---|
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(HrRBackupGetAttachmentInformation, NDR_IN, r);
|
---|
189 | }
|
---|
190 |
|
---|
191 | _HrRBackupGetAttachmentInformation(p, r);
|
---|
192 |
|
---|
193 | if (p->rng_fault_state) {
|
---|
194 | talloc_free(r);
|
---|
195 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
196 | return true;
|
---|
197 | }
|
---|
198 |
|
---|
199 | if (DEBUGLEVEL >= 10) {
|
---|
200 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupGetAttachmentInformation, NDR_OUT | NDR_SET_VALUES, r);
|
---|
201 | }
|
---|
202 |
|
---|
203 | push = ndr_push_init_ctx(r);
|
---|
204 | if (push == NULL) {
|
---|
205 | talloc_free(r);
|
---|
206 | return false;
|
---|
207 | }
|
---|
208 |
|
---|
209 | /*
|
---|
210 | * carry over the pointer count to the reply in case we are
|
---|
211 | * using full pointer. See NDR specification for full pointers
|
---|
212 | */
|
---|
213 | push->ptr_count = pull->ptr_count;
|
---|
214 |
|
---|
215 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
216 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
217 | talloc_free(r);
|
---|
218 | return false;
|
---|
219 | }
|
---|
220 |
|
---|
221 | p->out_data.rdata = ndr_push_blob(push);
|
---|
222 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
223 |
|
---|
224 | talloc_free(r);
|
---|
225 |
|
---|
226 | return true;
|
---|
227 | }
|
---|
228 |
|
---|
229 | static bool api_HrRBackupOpenFile(struct pipes_struct *p)
|
---|
230 | {
|
---|
231 | const struct ndr_interface_call *call;
|
---|
232 | struct ndr_pull *pull;
|
---|
233 | struct ndr_push *push;
|
---|
234 | enum ndr_err_code ndr_err;
|
---|
235 | struct HrRBackupOpenFile *r;
|
---|
236 |
|
---|
237 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPOPENFILE];
|
---|
238 |
|
---|
239 | r = talloc(talloc_tos(), struct HrRBackupOpenFile);
|
---|
240 | if (r == NULL) {
|
---|
241 | return false;
|
---|
242 | }
|
---|
243 |
|
---|
244 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
245 | if (pull == NULL) {
|
---|
246 | talloc_free(r);
|
---|
247 | return false;
|
---|
248 | }
|
---|
249 |
|
---|
250 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
251 | if (p->endian) {
|
---|
252 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
253 | }
|
---|
254 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
255 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
256 | talloc_free(r);
|
---|
257 | return false;
|
---|
258 | }
|
---|
259 |
|
---|
260 | if (DEBUGLEVEL >= 10) {
|
---|
261 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupOpenFile, NDR_IN, r);
|
---|
262 | }
|
---|
263 |
|
---|
264 | _HrRBackupOpenFile(p, r);
|
---|
265 |
|
---|
266 | if (p->rng_fault_state) {
|
---|
267 | talloc_free(r);
|
---|
268 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
269 | return true;
|
---|
270 | }
|
---|
271 |
|
---|
272 | if (DEBUGLEVEL >= 10) {
|
---|
273 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupOpenFile, NDR_OUT | NDR_SET_VALUES, r);
|
---|
274 | }
|
---|
275 |
|
---|
276 | push = ndr_push_init_ctx(r);
|
---|
277 | if (push == NULL) {
|
---|
278 | talloc_free(r);
|
---|
279 | return false;
|
---|
280 | }
|
---|
281 |
|
---|
282 | /*
|
---|
283 | * carry over the pointer count to the reply in case we are
|
---|
284 | * using full pointer. See NDR specification for full pointers
|
---|
285 | */
|
---|
286 | push->ptr_count = pull->ptr_count;
|
---|
287 |
|
---|
288 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
289 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
290 | talloc_free(r);
|
---|
291 | return false;
|
---|
292 | }
|
---|
293 |
|
---|
294 | p->out_data.rdata = ndr_push_blob(push);
|
---|
295 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
296 |
|
---|
297 | talloc_free(r);
|
---|
298 |
|
---|
299 | return true;
|
---|
300 | }
|
---|
301 |
|
---|
302 | static bool api_HrRBackupRead(struct pipes_struct *p)
|
---|
303 | {
|
---|
304 | const struct ndr_interface_call *call;
|
---|
305 | struct ndr_pull *pull;
|
---|
306 | struct ndr_push *push;
|
---|
307 | enum ndr_err_code ndr_err;
|
---|
308 | struct HrRBackupRead *r;
|
---|
309 |
|
---|
310 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPREAD];
|
---|
311 |
|
---|
312 | r = talloc(talloc_tos(), struct HrRBackupRead);
|
---|
313 | if (r == NULL) {
|
---|
314 | return false;
|
---|
315 | }
|
---|
316 |
|
---|
317 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
318 | if (pull == NULL) {
|
---|
319 | talloc_free(r);
|
---|
320 | return false;
|
---|
321 | }
|
---|
322 |
|
---|
323 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
324 | if (p->endian) {
|
---|
325 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
326 | }
|
---|
327 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
328 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
329 | talloc_free(r);
|
---|
330 | return false;
|
---|
331 | }
|
---|
332 |
|
---|
333 | if (DEBUGLEVEL >= 10) {
|
---|
334 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupRead, NDR_IN, r);
|
---|
335 | }
|
---|
336 |
|
---|
337 | _HrRBackupRead(p, r);
|
---|
338 |
|
---|
339 | if (p->rng_fault_state) {
|
---|
340 | talloc_free(r);
|
---|
341 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
342 | return true;
|
---|
343 | }
|
---|
344 |
|
---|
345 | if (DEBUGLEVEL >= 10) {
|
---|
346 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupRead, NDR_OUT | NDR_SET_VALUES, r);
|
---|
347 | }
|
---|
348 |
|
---|
349 | push = ndr_push_init_ctx(r);
|
---|
350 | if (push == NULL) {
|
---|
351 | talloc_free(r);
|
---|
352 | return false;
|
---|
353 | }
|
---|
354 |
|
---|
355 | /*
|
---|
356 | * carry over the pointer count to the reply in case we are
|
---|
357 | * using full pointer. See NDR specification for full pointers
|
---|
358 | */
|
---|
359 | push->ptr_count = pull->ptr_count;
|
---|
360 |
|
---|
361 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
362 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
363 | talloc_free(r);
|
---|
364 | return false;
|
---|
365 | }
|
---|
366 |
|
---|
367 | p->out_data.rdata = ndr_push_blob(push);
|
---|
368 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
369 |
|
---|
370 | talloc_free(r);
|
---|
371 |
|
---|
372 | return true;
|
---|
373 | }
|
---|
374 |
|
---|
375 | static bool api_HrRBackupClose(struct pipes_struct *p)
|
---|
376 | {
|
---|
377 | const struct ndr_interface_call *call;
|
---|
378 | struct ndr_pull *pull;
|
---|
379 | struct ndr_push *push;
|
---|
380 | enum ndr_err_code ndr_err;
|
---|
381 | struct HrRBackupClose *r;
|
---|
382 |
|
---|
383 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPCLOSE];
|
---|
384 |
|
---|
385 | r = talloc(talloc_tos(), struct HrRBackupClose);
|
---|
386 | if (r == NULL) {
|
---|
387 | return false;
|
---|
388 | }
|
---|
389 |
|
---|
390 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
391 | if (pull == NULL) {
|
---|
392 | talloc_free(r);
|
---|
393 | return false;
|
---|
394 | }
|
---|
395 |
|
---|
396 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
397 | if (p->endian) {
|
---|
398 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
399 | }
|
---|
400 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
401 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
402 | talloc_free(r);
|
---|
403 | return false;
|
---|
404 | }
|
---|
405 |
|
---|
406 | if (DEBUGLEVEL >= 10) {
|
---|
407 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupClose, NDR_IN, r);
|
---|
408 | }
|
---|
409 |
|
---|
410 | _HrRBackupClose(p, r);
|
---|
411 |
|
---|
412 | if (p->rng_fault_state) {
|
---|
413 | talloc_free(r);
|
---|
414 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
415 | return true;
|
---|
416 | }
|
---|
417 |
|
---|
418 | if (DEBUGLEVEL >= 10) {
|
---|
419 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupClose, NDR_OUT | NDR_SET_VALUES, r);
|
---|
420 | }
|
---|
421 |
|
---|
422 | push = ndr_push_init_ctx(r);
|
---|
423 | if (push == NULL) {
|
---|
424 | talloc_free(r);
|
---|
425 | return false;
|
---|
426 | }
|
---|
427 |
|
---|
428 | /*
|
---|
429 | * carry over the pointer count to the reply in case we are
|
---|
430 | * using full pointer. See NDR specification for full pointers
|
---|
431 | */
|
---|
432 | push->ptr_count = pull->ptr_count;
|
---|
433 |
|
---|
434 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
435 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
436 | talloc_free(r);
|
---|
437 | return false;
|
---|
438 | }
|
---|
439 |
|
---|
440 | p->out_data.rdata = ndr_push_blob(push);
|
---|
441 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
442 |
|
---|
443 | talloc_free(r);
|
---|
444 |
|
---|
445 | return true;
|
---|
446 | }
|
---|
447 |
|
---|
448 | static bool api_HrRBackupGetBackupLogs(struct pipes_struct *p)
|
---|
449 | {
|
---|
450 | const struct ndr_interface_call *call;
|
---|
451 | struct ndr_pull *pull;
|
---|
452 | struct ndr_push *push;
|
---|
453 | enum ndr_err_code ndr_err;
|
---|
454 | struct HrRBackupGetBackupLogs *r;
|
---|
455 |
|
---|
456 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPGETBACKUPLOGS];
|
---|
457 |
|
---|
458 | r = talloc(talloc_tos(), struct HrRBackupGetBackupLogs);
|
---|
459 | if (r == NULL) {
|
---|
460 | return false;
|
---|
461 | }
|
---|
462 |
|
---|
463 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
464 | if (pull == NULL) {
|
---|
465 | talloc_free(r);
|
---|
466 | return false;
|
---|
467 | }
|
---|
468 |
|
---|
469 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
470 | if (p->endian) {
|
---|
471 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
472 | }
|
---|
473 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
474 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
475 | talloc_free(r);
|
---|
476 | return false;
|
---|
477 | }
|
---|
478 |
|
---|
479 | if (DEBUGLEVEL >= 10) {
|
---|
480 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupGetBackupLogs, NDR_IN, r);
|
---|
481 | }
|
---|
482 |
|
---|
483 | _HrRBackupGetBackupLogs(p, r);
|
---|
484 |
|
---|
485 | if (p->rng_fault_state) {
|
---|
486 | talloc_free(r);
|
---|
487 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
488 | return true;
|
---|
489 | }
|
---|
490 |
|
---|
491 | if (DEBUGLEVEL >= 10) {
|
---|
492 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupGetBackupLogs, NDR_OUT | NDR_SET_VALUES, r);
|
---|
493 | }
|
---|
494 |
|
---|
495 | push = ndr_push_init_ctx(r);
|
---|
496 | if (push == NULL) {
|
---|
497 | talloc_free(r);
|
---|
498 | return false;
|
---|
499 | }
|
---|
500 |
|
---|
501 | /*
|
---|
502 | * carry over the pointer count to the reply in case we are
|
---|
503 | * using full pointer. See NDR specification for full pointers
|
---|
504 | */
|
---|
505 | push->ptr_count = pull->ptr_count;
|
---|
506 |
|
---|
507 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
508 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
509 | talloc_free(r);
|
---|
510 | return false;
|
---|
511 | }
|
---|
512 |
|
---|
513 | p->out_data.rdata = ndr_push_blob(push);
|
---|
514 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
515 |
|
---|
516 | talloc_free(r);
|
---|
517 |
|
---|
518 | return true;
|
---|
519 | }
|
---|
520 |
|
---|
521 | static bool api_HrRBackupTruncateLogs(struct pipes_struct *p)
|
---|
522 | {
|
---|
523 | const struct ndr_interface_call *call;
|
---|
524 | struct ndr_pull *pull;
|
---|
525 | struct ndr_push *push;
|
---|
526 | enum ndr_err_code ndr_err;
|
---|
527 | struct HrRBackupTruncateLogs *r;
|
---|
528 |
|
---|
529 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPTRUNCATELOGS];
|
---|
530 |
|
---|
531 | r = talloc(talloc_tos(), struct HrRBackupTruncateLogs);
|
---|
532 | if (r == NULL) {
|
---|
533 | return false;
|
---|
534 | }
|
---|
535 |
|
---|
536 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
537 | if (pull == NULL) {
|
---|
538 | talloc_free(r);
|
---|
539 | return false;
|
---|
540 | }
|
---|
541 |
|
---|
542 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
543 | if (p->endian) {
|
---|
544 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
545 | }
|
---|
546 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
547 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
548 | talloc_free(r);
|
---|
549 | return false;
|
---|
550 | }
|
---|
551 |
|
---|
552 | if (DEBUGLEVEL >= 10) {
|
---|
553 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupTruncateLogs, NDR_IN, r);
|
---|
554 | }
|
---|
555 |
|
---|
556 | _HrRBackupTruncateLogs(p, r);
|
---|
557 |
|
---|
558 | if (p->rng_fault_state) {
|
---|
559 | talloc_free(r);
|
---|
560 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
561 | return true;
|
---|
562 | }
|
---|
563 |
|
---|
564 | if (DEBUGLEVEL >= 10) {
|
---|
565 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupTruncateLogs, NDR_OUT | NDR_SET_VALUES, r);
|
---|
566 | }
|
---|
567 |
|
---|
568 | push = ndr_push_init_ctx(r);
|
---|
569 | if (push == NULL) {
|
---|
570 | talloc_free(r);
|
---|
571 | return false;
|
---|
572 | }
|
---|
573 |
|
---|
574 | /*
|
---|
575 | * carry over the pointer count to the reply in case we are
|
---|
576 | * using full pointer. See NDR specification for full pointers
|
---|
577 | */
|
---|
578 | push->ptr_count = pull->ptr_count;
|
---|
579 |
|
---|
580 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
581 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
582 | talloc_free(r);
|
---|
583 | return false;
|
---|
584 | }
|
---|
585 |
|
---|
586 | p->out_data.rdata = ndr_push_blob(push);
|
---|
587 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
588 |
|
---|
589 | talloc_free(r);
|
---|
590 |
|
---|
591 | return true;
|
---|
592 | }
|
---|
593 |
|
---|
594 | static bool api_HrRBackupPing(struct pipes_struct *p)
|
---|
595 | {
|
---|
596 | const struct ndr_interface_call *call;
|
---|
597 | struct ndr_pull *pull;
|
---|
598 | struct ndr_push *push;
|
---|
599 | enum ndr_err_code ndr_err;
|
---|
600 | struct HrRBackupPing *r;
|
---|
601 |
|
---|
602 | call = &ndr_table_ad_backup.calls[NDR_HRRBACKUPPING];
|
---|
603 |
|
---|
604 | r = talloc(talloc_tos(), struct HrRBackupPing);
|
---|
605 | if (r == NULL) {
|
---|
606 | return false;
|
---|
607 | }
|
---|
608 |
|
---|
609 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
610 | if (pull == NULL) {
|
---|
611 | talloc_free(r);
|
---|
612 | return false;
|
---|
613 | }
|
---|
614 |
|
---|
615 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
616 | if (p->endian) {
|
---|
617 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
618 | }
|
---|
619 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
620 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
621 | talloc_free(r);
|
---|
622 | return false;
|
---|
623 | }
|
---|
624 |
|
---|
625 | if (DEBUGLEVEL >= 10) {
|
---|
626 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupPing, NDR_IN, r);
|
---|
627 | }
|
---|
628 |
|
---|
629 | _HrRBackupPing(p, r);
|
---|
630 |
|
---|
631 | if (p->rng_fault_state) {
|
---|
632 | talloc_free(r);
|
---|
633 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
634 | return true;
|
---|
635 | }
|
---|
636 |
|
---|
637 | if (DEBUGLEVEL >= 10) {
|
---|
638 | NDR_PRINT_FUNCTION_DEBUG(HrRBackupPing, NDR_OUT | NDR_SET_VALUES, r);
|
---|
639 | }
|
---|
640 |
|
---|
641 | push = ndr_push_init_ctx(r);
|
---|
642 | if (push == NULL) {
|
---|
643 | talloc_free(r);
|
---|
644 | return false;
|
---|
645 | }
|
---|
646 |
|
---|
647 | /*
|
---|
648 | * carry over the pointer count to the reply in case we are
|
---|
649 | * using full pointer. See NDR specification for full pointers
|
---|
650 | */
|
---|
651 | push->ptr_count = pull->ptr_count;
|
---|
652 |
|
---|
653 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
654 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
655 | talloc_free(r);
|
---|
656 | return false;
|
---|
657 | }
|
---|
658 |
|
---|
659 | p->out_data.rdata = ndr_push_blob(push);
|
---|
660 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
661 |
|
---|
662 | talloc_free(r);
|
---|
663 |
|
---|
664 | return true;
|
---|
665 | }
|
---|
666 |
|
---|
667 |
|
---|
668 | /* Tables */
|
---|
669 | static struct api_struct api_ad_backup_cmds[] =
|
---|
670 | {
|
---|
671 | {"HRRBACKUPPREPARE", NDR_HRRBACKUPPREPARE, api_HrRBackupPrepare},
|
---|
672 | {"HRRBACKUPEND", NDR_HRRBACKUPEND, api_HrRBackupEnd},
|
---|
673 | {"HRRBACKUPGETATTACHMENTINFORMATION", NDR_HRRBACKUPGETATTACHMENTINFORMATION, api_HrRBackupGetAttachmentInformation},
|
---|
674 | {"HRRBACKUPOPENFILE", NDR_HRRBACKUPOPENFILE, api_HrRBackupOpenFile},
|
---|
675 | {"HRRBACKUPREAD", NDR_HRRBACKUPREAD, api_HrRBackupRead},
|
---|
676 | {"HRRBACKUPCLOSE", NDR_HRRBACKUPCLOSE, api_HrRBackupClose},
|
---|
677 | {"HRRBACKUPGETBACKUPLOGS", NDR_HRRBACKUPGETBACKUPLOGS, api_HrRBackupGetBackupLogs},
|
---|
678 | {"HRRBACKUPTRUNCATELOGS", NDR_HRRBACKUPTRUNCATELOGS, api_HrRBackupTruncateLogs},
|
---|
679 | {"HRRBACKUPPING", NDR_HRRBACKUPPING, api_HrRBackupPing},
|
---|
680 | };
|
---|
681 |
|
---|
682 | void ad_backup_get_pipe_fns(struct api_struct **fns, int *n_fns)
|
---|
683 | {
|
---|
684 | *fns = api_ad_backup_cmds;
|
---|
685 | *n_fns = sizeof(api_ad_backup_cmds) / sizeof(struct api_struct);
|
---|
686 | }
|
---|
687 |
|
---|
688 | NTSTATUS rpc_ad_backup_init(const struct rpc_srv_callbacks *rpc_srv_cb)
|
---|
689 | {
|
---|
690 | return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "ad_backup", "ad_backup", &ndr_table_ad_backup, api_ad_backup_cmds, sizeof(api_ad_backup_cmds) / sizeof(struct api_struct), rpc_srv_cb);
|
---|
691 | }
|
---|
692 |
|
---|
693 | NTSTATUS rpc_ad_backup_shutdown(void)
|
---|
694 | {
|
---|
695 | return rpc_srv_unregister(&ndr_table_ad_backup);
|
---|
696 | }
|
---|
697 | static bool api_HrRIsNTDSOnline(struct pipes_struct *p)
|
---|
698 | {
|
---|
699 | const struct ndr_interface_call *call;
|
---|
700 | struct ndr_pull *pull;
|
---|
701 | struct ndr_push *push;
|
---|
702 | enum ndr_err_code ndr_err;
|
---|
703 | struct HrRIsNTDSOnline *r;
|
---|
704 |
|
---|
705 | call = &ndr_table_ad_restore.calls[NDR_HRRISNTDSONLINE];
|
---|
706 |
|
---|
707 | r = talloc(talloc_tos(), struct HrRIsNTDSOnline);
|
---|
708 | if (r == NULL) {
|
---|
709 | return false;
|
---|
710 | }
|
---|
711 |
|
---|
712 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
713 | if (pull == NULL) {
|
---|
714 | talloc_free(r);
|
---|
715 | return false;
|
---|
716 | }
|
---|
717 |
|
---|
718 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
719 | if (p->endian) {
|
---|
720 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
721 | }
|
---|
722 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
723 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
724 | talloc_free(r);
|
---|
725 | return false;
|
---|
726 | }
|
---|
727 |
|
---|
728 | if (DEBUGLEVEL >= 10) {
|
---|
729 | NDR_PRINT_FUNCTION_DEBUG(HrRIsNTDSOnline, NDR_IN, r);
|
---|
730 | }
|
---|
731 |
|
---|
732 | _HrRIsNTDSOnline(p, r);
|
---|
733 |
|
---|
734 | if (p->rng_fault_state) {
|
---|
735 | talloc_free(r);
|
---|
736 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
737 | return true;
|
---|
738 | }
|
---|
739 |
|
---|
740 | if (DEBUGLEVEL >= 10) {
|
---|
741 | NDR_PRINT_FUNCTION_DEBUG(HrRIsNTDSOnline, NDR_OUT | NDR_SET_VALUES, r);
|
---|
742 | }
|
---|
743 |
|
---|
744 | push = ndr_push_init_ctx(r);
|
---|
745 | if (push == NULL) {
|
---|
746 | talloc_free(r);
|
---|
747 | return false;
|
---|
748 | }
|
---|
749 |
|
---|
750 | /*
|
---|
751 | * carry over the pointer count to the reply in case we are
|
---|
752 | * using full pointer. See NDR specification for full pointers
|
---|
753 | */
|
---|
754 | push->ptr_count = pull->ptr_count;
|
---|
755 |
|
---|
756 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
757 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
758 | talloc_free(r);
|
---|
759 | return false;
|
---|
760 | }
|
---|
761 |
|
---|
762 | p->out_data.rdata = ndr_push_blob(push);
|
---|
763 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
764 |
|
---|
765 | talloc_free(r);
|
---|
766 |
|
---|
767 | return true;
|
---|
768 | }
|
---|
769 |
|
---|
770 | static bool api_HrRRestorePrepare(struct pipes_struct *p)
|
---|
771 | {
|
---|
772 | const struct ndr_interface_call *call;
|
---|
773 | struct ndr_pull *pull;
|
---|
774 | struct ndr_push *push;
|
---|
775 | enum ndr_err_code ndr_err;
|
---|
776 | struct HrRRestorePrepare *r;
|
---|
777 |
|
---|
778 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTOREPREPARE];
|
---|
779 |
|
---|
780 | r = talloc(talloc_tos(), struct HrRRestorePrepare);
|
---|
781 | if (r == NULL) {
|
---|
782 | return false;
|
---|
783 | }
|
---|
784 |
|
---|
785 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
786 | if (pull == NULL) {
|
---|
787 | talloc_free(r);
|
---|
788 | return false;
|
---|
789 | }
|
---|
790 |
|
---|
791 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
792 | if (p->endian) {
|
---|
793 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
794 | }
|
---|
795 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
796 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
797 | talloc_free(r);
|
---|
798 | return false;
|
---|
799 | }
|
---|
800 |
|
---|
801 | if (DEBUGLEVEL >= 10) {
|
---|
802 | NDR_PRINT_FUNCTION_DEBUG(HrRRestorePrepare, NDR_IN, r);
|
---|
803 | }
|
---|
804 |
|
---|
805 | _HrRRestorePrepare(p, r);
|
---|
806 |
|
---|
807 | if (p->rng_fault_state) {
|
---|
808 | talloc_free(r);
|
---|
809 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
810 | return true;
|
---|
811 | }
|
---|
812 |
|
---|
813 | if (DEBUGLEVEL >= 10) {
|
---|
814 | NDR_PRINT_FUNCTION_DEBUG(HrRRestorePrepare, NDR_OUT | NDR_SET_VALUES, r);
|
---|
815 | }
|
---|
816 |
|
---|
817 | push = ndr_push_init_ctx(r);
|
---|
818 | if (push == NULL) {
|
---|
819 | talloc_free(r);
|
---|
820 | return false;
|
---|
821 | }
|
---|
822 |
|
---|
823 | /*
|
---|
824 | * carry over the pointer count to the reply in case we are
|
---|
825 | * using full pointer. See NDR specification for full pointers
|
---|
826 | */
|
---|
827 | push->ptr_count = pull->ptr_count;
|
---|
828 |
|
---|
829 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
830 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
831 | talloc_free(r);
|
---|
832 | return false;
|
---|
833 | }
|
---|
834 |
|
---|
835 | p->out_data.rdata = ndr_push_blob(push);
|
---|
836 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
837 |
|
---|
838 | talloc_free(r);
|
---|
839 |
|
---|
840 | return true;
|
---|
841 | }
|
---|
842 |
|
---|
843 | static bool api_HrRRestoreRegister(struct pipes_struct *p)
|
---|
844 | {
|
---|
845 | const struct ndr_interface_call *call;
|
---|
846 | struct ndr_pull *pull;
|
---|
847 | struct ndr_push *push;
|
---|
848 | enum ndr_err_code ndr_err;
|
---|
849 | struct HrRRestoreRegister *r;
|
---|
850 |
|
---|
851 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTOREREGISTER];
|
---|
852 |
|
---|
853 | r = talloc(talloc_tos(), struct HrRRestoreRegister);
|
---|
854 | if (r == NULL) {
|
---|
855 | return false;
|
---|
856 | }
|
---|
857 |
|
---|
858 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
859 | if (pull == NULL) {
|
---|
860 | talloc_free(r);
|
---|
861 | return false;
|
---|
862 | }
|
---|
863 |
|
---|
864 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
865 | if (p->endian) {
|
---|
866 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
867 | }
|
---|
868 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
869 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
870 | talloc_free(r);
|
---|
871 | return false;
|
---|
872 | }
|
---|
873 |
|
---|
874 | if (DEBUGLEVEL >= 10) {
|
---|
875 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreRegister, NDR_IN, r);
|
---|
876 | }
|
---|
877 |
|
---|
878 | _HrRRestoreRegister(p, r);
|
---|
879 |
|
---|
880 | if (p->rng_fault_state) {
|
---|
881 | talloc_free(r);
|
---|
882 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
883 | return true;
|
---|
884 | }
|
---|
885 |
|
---|
886 | if (DEBUGLEVEL >= 10) {
|
---|
887 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreRegister, NDR_OUT | NDR_SET_VALUES, r);
|
---|
888 | }
|
---|
889 |
|
---|
890 | push = ndr_push_init_ctx(r);
|
---|
891 | if (push == NULL) {
|
---|
892 | talloc_free(r);
|
---|
893 | return false;
|
---|
894 | }
|
---|
895 |
|
---|
896 | /*
|
---|
897 | * carry over the pointer count to the reply in case we are
|
---|
898 | * using full pointer. See NDR specification for full pointers
|
---|
899 | */
|
---|
900 | push->ptr_count = pull->ptr_count;
|
---|
901 |
|
---|
902 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
903 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
904 | talloc_free(r);
|
---|
905 | return false;
|
---|
906 | }
|
---|
907 |
|
---|
908 | p->out_data.rdata = ndr_push_blob(push);
|
---|
909 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
910 |
|
---|
911 | talloc_free(r);
|
---|
912 |
|
---|
913 | return true;
|
---|
914 | }
|
---|
915 |
|
---|
916 | static bool api_HrRRestoreRegisterComplete(struct pipes_struct *p)
|
---|
917 | {
|
---|
918 | const struct ndr_interface_call *call;
|
---|
919 | struct ndr_pull *pull;
|
---|
920 | struct ndr_push *push;
|
---|
921 | enum ndr_err_code ndr_err;
|
---|
922 | struct HrRRestoreRegisterComplete *r;
|
---|
923 |
|
---|
924 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTOREREGISTERCOMPLETE];
|
---|
925 |
|
---|
926 | r = talloc(talloc_tos(), struct HrRRestoreRegisterComplete);
|
---|
927 | if (r == NULL) {
|
---|
928 | return false;
|
---|
929 | }
|
---|
930 |
|
---|
931 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
932 | if (pull == NULL) {
|
---|
933 | talloc_free(r);
|
---|
934 | return false;
|
---|
935 | }
|
---|
936 |
|
---|
937 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
938 | if (p->endian) {
|
---|
939 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
940 | }
|
---|
941 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
942 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
943 | talloc_free(r);
|
---|
944 | return false;
|
---|
945 | }
|
---|
946 |
|
---|
947 | if (DEBUGLEVEL >= 10) {
|
---|
948 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreRegisterComplete, NDR_IN, r);
|
---|
949 | }
|
---|
950 |
|
---|
951 | _HrRRestoreRegisterComplete(p, r);
|
---|
952 |
|
---|
953 | if (p->rng_fault_state) {
|
---|
954 | talloc_free(r);
|
---|
955 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
956 | return true;
|
---|
957 | }
|
---|
958 |
|
---|
959 | if (DEBUGLEVEL >= 10) {
|
---|
960 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreRegisterComplete, NDR_OUT | NDR_SET_VALUES, r);
|
---|
961 | }
|
---|
962 |
|
---|
963 | push = ndr_push_init_ctx(r);
|
---|
964 | if (push == NULL) {
|
---|
965 | talloc_free(r);
|
---|
966 | return false;
|
---|
967 | }
|
---|
968 |
|
---|
969 | /*
|
---|
970 | * carry over the pointer count to the reply in case we are
|
---|
971 | * using full pointer. See NDR specification for full pointers
|
---|
972 | */
|
---|
973 | push->ptr_count = pull->ptr_count;
|
---|
974 |
|
---|
975 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
976 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
977 | talloc_free(r);
|
---|
978 | return false;
|
---|
979 | }
|
---|
980 |
|
---|
981 | p->out_data.rdata = ndr_push_blob(push);
|
---|
982 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
983 |
|
---|
984 | talloc_free(r);
|
---|
985 |
|
---|
986 | return true;
|
---|
987 | }
|
---|
988 |
|
---|
989 | static bool api_HrRRestoreGetDatabaseLocations(struct pipes_struct *p)
|
---|
990 | {
|
---|
991 | const struct ndr_interface_call *call;
|
---|
992 | struct ndr_pull *pull;
|
---|
993 | struct ndr_push *push;
|
---|
994 | enum ndr_err_code ndr_err;
|
---|
995 | struct HrRRestoreGetDatabaseLocations *r;
|
---|
996 |
|
---|
997 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTOREGETDATABASELOCATIONS];
|
---|
998 |
|
---|
999 | r = talloc(talloc_tos(), struct HrRRestoreGetDatabaseLocations);
|
---|
1000 | if (r == NULL) {
|
---|
1001 | return false;
|
---|
1002 | }
|
---|
1003 |
|
---|
1004 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1005 | if (pull == NULL) {
|
---|
1006 | talloc_free(r);
|
---|
1007 | return false;
|
---|
1008 | }
|
---|
1009 |
|
---|
1010 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1011 | if (p->endian) {
|
---|
1012 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1013 | }
|
---|
1014 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1015 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1016 | talloc_free(r);
|
---|
1017 | return false;
|
---|
1018 | }
|
---|
1019 |
|
---|
1020 | if (DEBUGLEVEL >= 10) {
|
---|
1021 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreGetDatabaseLocations, NDR_IN, r);
|
---|
1022 | }
|
---|
1023 |
|
---|
1024 | _HrRRestoreGetDatabaseLocations(p, r);
|
---|
1025 |
|
---|
1026 | if (p->rng_fault_state) {
|
---|
1027 | talloc_free(r);
|
---|
1028 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1029 | return true;
|
---|
1030 | }
|
---|
1031 |
|
---|
1032 | if (DEBUGLEVEL >= 10) {
|
---|
1033 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreGetDatabaseLocations, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1034 | }
|
---|
1035 |
|
---|
1036 | push = ndr_push_init_ctx(r);
|
---|
1037 | if (push == NULL) {
|
---|
1038 | talloc_free(r);
|
---|
1039 | return false;
|
---|
1040 | }
|
---|
1041 |
|
---|
1042 | /*
|
---|
1043 | * carry over the pointer count to the reply in case we are
|
---|
1044 | * using full pointer. See NDR specification for full pointers
|
---|
1045 | */
|
---|
1046 | push->ptr_count = pull->ptr_count;
|
---|
1047 |
|
---|
1048 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1049 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1050 | talloc_free(r);
|
---|
1051 | return false;
|
---|
1052 | }
|
---|
1053 |
|
---|
1054 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1055 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1056 |
|
---|
1057 | talloc_free(r);
|
---|
1058 |
|
---|
1059 | return true;
|
---|
1060 | }
|
---|
1061 |
|
---|
1062 | static bool api_HrRRestoreEnd(struct pipes_struct *p)
|
---|
1063 | {
|
---|
1064 | const struct ndr_interface_call *call;
|
---|
1065 | struct ndr_pull *pull;
|
---|
1066 | struct ndr_push *push;
|
---|
1067 | enum ndr_err_code ndr_err;
|
---|
1068 | struct HrRRestoreEnd *r;
|
---|
1069 |
|
---|
1070 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTOREEND];
|
---|
1071 |
|
---|
1072 | r = talloc(talloc_tos(), struct HrRRestoreEnd);
|
---|
1073 | if (r == NULL) {
|
---|
1074 | return false;
|
---|
1075 | }
|
---|
1076 |
|
---|
1077 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1078 | if (pull == NULL) {
|
---|
1079 | talloc_free(r);
|
---|
1080 | return false;
|
---|
1081 | }
|
---|
1082 |
|
---|
1083 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1084 | if (p->endian) {
|
---|
1085 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1086 | }
|
---|
1087 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1088 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1089 | talloc_free(r);
|
---|
1090 | return false;
|
---|
1091 | }
|
---|
1092 |
|
---|
1093 | if (DEBUGLEVEL >= 10) {
|
---|
1094 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreEnd, NDR_IN, r);
|
---|
1095 | }
|
---|
1096 |
|
---|
1097 | _HrRRestoreEnd(p, r);
|
---|
1098 |
|
---|
1099 | if (p->rng_fault_state) {
|
---|
1100 | talloc_free(r);
|
---|
1101 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1102 | return true;
|
---|
1103 | }
|
---|
1104 |
|
---|
1105 | if (DEBUGLEVEL >= 10) {
|
---|
1106 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreEnd, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1107 | }
|
---|
1108 |
|
---|
1109 | push = ndr_push_init_ctx(r);
|
---|
1110 | if (push == NULL) {
|
---|
1111 | talloc_free(r);
|
---|
1112 | return false;
|
---|
1113 | }
|
---|
1114 |
|
---|
1115 | /*
|
---|
1116 | * carry over the pointer count to the reply in case we are
|
---|
1117 | * using full pointer. See NDR specification for full pointers
|
---|
1118 | */
|
---|
1119 | push->ptr_count = pull->ptr_count;
|
---|
1120 |
|
---|
1121 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1122 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1123 | talloc_free(r);
|
---|
1124 | return false;
|
---|
1125 | }
|
---|
1126 |
|
---|
1127 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1128 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1129 |
|
---|
1130 | talloc_free(r);
|
---|
1131 |
|
---|
1132 | return true;
|
---|
1133 | }
|
---|
1134 |
|
---|
1135 | static bool api_HrRRestoreSetCurrentLogNumber(struct pipes_struct *p)
|
---|
1136 | {
|
---|
1137 | const struct ndr_interface_call *call;
|
---|
1138 | struct ndr_pull *pull;
|
---|
1139 | struct ndr_push *push;
|
---|
1140 | enum ndr_err_code ndr_err;
|
---|
1141 | struct HrRRestoreSetCurrentLogNumber *r;
|
---|
1142 |
|
---|
1143 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTORESETCURRENTLOGNUMBER];
|
---|
1144 |
|
---|
1145 | r = talloc(talloc_tos(), struct HrRRestoreSetCurrentLogNumber);
|
---|
1146 | if (r == NULL) {
|
---|
1147 | return false;
|
---|
1148 | }
|
---|
1149 |
|
---|
1150 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1151 | if (pull == NULL) {
|
---|
1152 | talloc_free(r);
|
---|
1153 | return false;
|
---|
1154 | }
|
---|
1155 |
|
---|
1156 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1157 | if (p->endian) {
|
---|
1158 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1159 | }
|
---|
1160 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1161 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1162 | talloc_free(r);
|
---|
1163 | return false;
|
---|
1164 | }
|
---|
1165 |
|
---|
1166 | if (DEBUGLEVEL >= 10) {
|
---|
1167 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreSetCurrentLogNumber, NDR_IN, r);
|
---|
1168 | }
|
---|
1169 |
|
---|
1170 | _HrRRestoreSetCurrentLogNumber(p, r);
|
---|
1171 |
|
---|
1172 | if (p->rng_fault_state) {
|
---|
1173 | talloc_free(r);
|
---|
1174 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1175 | return true;
|
---|
1176 | }
|
---|
1177 |
|
---|
1178 | if (DEBUGLEVEL >= 10) {
|
---|
1179 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreSetCurrentLogNumber, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1180 | }
|
---|
1181 |
|
---|
1182 | push = ndr_push_init_ctx(r);
|
---|
1183 | if (push == NULL) {
|
---|
1184 | talloc_free(r);
|
---|
1185 | return false;
|
---|
1186 | }
|
---|
1187 |
|
---|
1188 | /*
|
---|
1189 | * carry over the pointer count to the reply in case we are
|
---|
1190 | * using full pointer. See NDR specification for full pointers
|
---|
1191 | */
|
---|
1192 | push->ptr_count = pull->ptr_count;
|
---|
1193 |
|
---|
1194 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1195 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1196 | talloc_free(r);
|
---|
1197 | return false;
|
---|
1198 | }
|
---|
1199 |
|
---|
1200 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1201 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1202 |
|
---|
1203 | talloc_free(r);
|
---|
1204 |
|
---|
1205 | return true;
|
---|
1206 | }
|
---|
1207 |
|
---|
1208 | static bool api_HrRRestoreCheckLogsForBackup(struct pipes_struct *p)
|
---|
1209 | {
|
---|
1210 | const struct ndr_interface_call *call;
|
---|
1211 | struct ndr_pull *pull;
|
---|
1212 | struct ndr_push *push;
|
---|
1213 | enum ndr_err_code ndr_err;
|
---|
1214 | struct HrRRestoreCheckLogsForBackup *r;
|
---|
1215 |
|
---|
1216 | call = &ndr_table_ad_restore.calls[NDR_HRRRESTORECHECKLOGSFORBACKUP];
|
---|
1217 |
|
---|
1218 | r = talloc(talloc_tos(), struct HrRRestoreCheckLogsForBackup);
|
---|
1219 | if (r == NULL) {
|
---|
1220 | return false;
|
---|
1221 | }
|
---|
1222 |
|
---|
1223 | pull = ndr_pull_init_blob(&p->in_data.data, r);
|
---|
1224 | if (pull == NULL) {
|
---|
1225 | talloc_free(r);
|
---|
1226 | return false;
|
---|
1227 | }
|
---|
1228 |
|
---|
1229 | pull->flags |= LIBNDR_FLAG_REF_ALLOC;
|
---|
1230 | if (p->endian) {
|
---|
1231 | pull->flags |= LIBNDR_FLAG_BIGENDIAN;
|
---|
1232 | }
|
---|
1233 | ndr_err = call->ndr_pull(pull, NDR_IN, r);
|
---|
1234 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1235 | talloc_free(r);
|
---|
1236 | return false;
|
---|
1237 | }
|
---|
1238 |
|
---|
1239 | if (DEBUGLEVEL >= 10) {
|
---|
1240 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreCheckLogsForBackup, NDR_IN, r);
|
---|
1241 | }
|
---|
1242 |
|
---|
1243 | _HrRRestoreCheckLogsForBackup(p, r);
|
---|
1244 |
|
---|
1245 | if (p->rng_fault_state) {
|
---|
1246 | talloc_free(r);
|
---|
1247 | /* Return true here, srv_pipe_hnd.c will take care */
|
---|
1248 | return true;
|
---|
1249 | }
|
---|
1250 |
|
---|
1251 | if (DEBUGLEVEL >= 10) {
|
---|
1252 | NDR_PRINT_FUNCTION_DEBUG(HrRRestoreCheckLogsForBackup, NDR_OUT | NDR_SET_VALUES, r);
|
---|
1253 | }
|
---|
1254 |
|
---|
1255 | push = ndr_push_init_ctx(r);
|
---|
1256 | if (push == NULL) {
|
---|
1257 | talloc_free(r);
|
---|
1258 | return false;
|
---|
1259 | }
|
---|
1260 |
|
---|
1261 | /*
|
---|
1262 | * carry over the pointer count to the reply in case we are
|
---|
1263 | * using full pointer. See NDR specification for full pointers
|
---|
1264 | */
|
---|
1265 | push->ptr_count = pull->ptr_count;
|
---|
1266 |
|
---|
1267 | ndr_err = call->ndr_push(push, NDR_OUT, r);
|
---|
1268 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
---|
1269 | talloc_free(r);
|
---|
1270 | return false;
|
---|
1271 | }
|
---|
1272 |
|
---|
1273 | p->out_data.rdata = ndr_push_blob(push);
|
---|
1274 | talloc_steal(p->mem_ctx, p->out_data.rdata.data);
|
---|
1275 |
|
---|
1276 | talloc_free(r);
|
---|
1277 |
|
---|
1278 | return true;
|
---|
1279 | }
|
---|
1280 |
|
---|
1281 |
|
---|
1282 | /* Tables */
|
---|
1283 | static struct api_struct api_ad_restore_cmds[] =
|
---|
1284 | {
|
---|
1285 | {"HRRISNTDSONLINE", NDR_HRRISNTDSONLINE, api_HrRIsNTDSOnline},
|
---|
1286 | {"HRRRESTOREPREPARE", NDR_HRRRESTOREPREPARE, api_HrRRestorePrepare},
|
---|
1287 | {"HRRRESTOREREGISTER", NDR_HRRRESTOREREGISTER, api_HrRRestoreRegister},
|
---|
1288 | {"HRRRESTOREREGISTERCOMPLETE", NDR_HRRRESTOREREGISTERCOMPLETE, api_HrRRestoreRegisterComplete},
|
---|
1289 | {"HRRRESTOREGETDATABASELOCATIONS", NDR_HRRRESTOREGETDATABASELOCATIONS, api_HrRRestoreGetDatabaseLocations},
|
---|
1290 | {"HRRRESTOREEND", NDR_HRRRESTOREEND, api_HrRRestoreEnd},
|
---|
1291 | {"HRRRESTORESETCURRENTLOGNUMBER", NDR_HRRRESTORESETCURRENTLOGNUMBER, api_HrRRestoreSetCurrentLogNumber},
|
---|
1292 | {"HRRRESTORECHECKLOGSFORBACKUP", NDR_HRRRESTORECHECKLOGSFORBACKUP, api_HrRRestoreCheckLogsForBackup},
|
---|
1293 | };
|
---|
1294 |
|
---|
1295 | void ad_restore_get_pipe_fns(struct api_struct **fns, int *n_fns)
|
---|
1296 | {
|
---|
1297 | *fns = api_ad_restore_cmds;
|
---|
1298 | *n_fns = sizeof(api_ad_restore_cmds) / sizeof(struct api_struct);
|
---|
1299 | }
|
---|
1300 |
|
---|
1301 | NTSTATUS rpc_ad_restore_init(const struct rpc_srv_callbacks *rpc_srv_cb)
|
---|
1302 | {
|
---|
1303 | return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "ad_restore", "ad_restore", &ndr_table_ad_restore, api_ad_restore_cmds, sizeof(api_ad_restore_cmds) / sizeof(struct api_struct), rpc_srv_cb);
|
---|
1304 | }
|
---|
1305 |
|
---|
1306 | NTSTATUS rpc_ad_restore_shutdown(void)
|
---|
1307 | {
|
---|
1308 | return rpc_srv_unregister(&ndr_table_ad_restore);
|
---|
1309 | }
|
---|