~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source3/librpc/gen_ndr/srv_frsrpc.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_frsrpc.h"
 
9
 
 
10
static bool api_frsrpc_FrsSendCommPkt(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 frsrpc_FrsSendCommPkt *r;
 
17
 
 
18
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_FRSSENDCOMMPKT];
 
19
 
 
20
        r = talloc(talloc_tos(), struct frsrpc_FrsSendCommPkt);
 
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(frsrpc_FrsSendCommPkt, NDR_IN, r);
 
43
        }
 
44
 
 
45
        r->out.result = _frsrpc_FrsSendCommPkt(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(frsrpc_FrsSendCommPkt, 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_frsrpc_FrsVerifyPromotionParent(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 frsrpc_FrsVerifyPromotionParent *r;
 
90
 
 
91
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_FRSVERIFYPROMOTIONPARENT];
 
92
 
 
93
        r = talloc(talloc_tos(), struct frsrpc_FrsVerifyPromotionParent);
 
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(frsrpc_FrsVerifyPromotionParent, NDR_IN, r);
 
116
        }
 
117
 
 
118
        r->out.result = _frsrpc_FrsVerifyPromotionParent(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(frsrpc_FrsVerifyPromotionParent, 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_frsrpc_FrsStartPromotionParent(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 frsrpc_FrsStartPromotionParent *r;
 
163
 
 
164
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_FRSSTARTPROMOTIONPARENT];
 
165
 
 
166
        r = talloc(talloc_tos(), struct frsrpc_FrsStartPromotionParent);
 
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(frsrpc_FrsStartPromotionParent, NDR_IN, r);
 
189
        }
 
190
 
 
191
        ZERO_STRUCT(r->out);
 
192
        r->out.parent_guid = r->in.parent_guid;
 
193
        r->out.result = _frsrpc_FrsStartPromotionParent(p, r);
 
194
 
 
195
        if (p->rng_fault_state) {
 
196
                talloc_free(r);
 
197
                /* Return true here, srv_pipe_hnd.c will take care */
 
198
                return true;
 
199
        }
 
200
 
 
201
        if (DEBUGLEVEL >= 10) {
 
202
                NDR_PRINT_FUNCTION_DEBUG(frsrpc_FrsStartPromotionParent, NDR_OUT | NDR_SET_VALUES, r);
 
203
        }
 
204
 
 
205
        push = ndr_push_init_ctx(r);
 
206
        if (push == NULL) {
 
207
                talloc_free(r);
 
208
                return false;
 
209
        }
 
210
 
 
211
        /*
 
212
         * carry over the pointer count to the reply in case we are
 
213
         * using full pointer. See NDR specification for full pointers
 
214
         */
 
215
        push->ptr_count = pull->ptr_count;
 
216
 
 
217
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
218
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
219
                talloc_free(r);
 
220
                return false;
 
221
        }
 
222
 
 
223
        p->out_data.rdata = ndr_push_blob(push);
 
224
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
225
 
 
226
        talloc_free(r);
 
227
 
 
228
        return true;
 
229
}
 
230
 
 
231
static bool api_frsrpc_FrsNOP(struct pipes_struct *p)
 
232
{
 
233
        const struct ndr_interface_call *call;
 
234
        struct ndr_pull *pull;
 
235
        struct ndr_push *push;
 
236
        enum ndr_err_code ndr_err;
 
237
        struct frsrpc_FrsNOP *r;
 
238
 
 
239
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_FRSNOP];
 
240
 
 
241
        r = talloc(talloc_tos(), struct frsrpc_FrsNOP);
 
242
        if (r == NULL) {
 
243
                return false;
 
244
        }
 
245
 
 
246
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
247
        if (pull == NULL) {
 
248
                talloc_free(r);
 
249
                return false;
 
250
        }
 
251
 
 
252
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
253
        if (p->endian) {
 
254
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
255
        }
 
256
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
257
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
258
                talloc_free(r);
 
259
                return false;
 
260
        }
 
261
 
 
262
        if (DEBUGLEVEL >= 10) {
 
263
                NDR_PRINT_FUNCTION_DEBUG(frsrpc_FrsNOP, NDR_IN, r);
 
264
        }
 
265
 
 
266
        r->out.result = _frsrpc_FrsNOP(p, r);
 
267
 
 
268
        if (p->rng_fault_state) {
 
269
                talloc_free(r);
 
270
                /* Return true here, srv_pipe_hnd.c will take care */
 
271
                return true;
 
272
        }
 
273
 
 
274
        if (DEBUGLEVEL >= 10) {
 
275
                NDR_PRINT_FUNCTION_DEBUG(frsrpc_FrsNOP, NDR_OUT | NDR_SET_VALUES, r);
 
276
        }
 
277
 
 
278
        push = ndr_push_init_ctx(r);
 
279
        if (push == NULL) {
 
280
                talloc_free(r);
 
281
                return false;
 
282
        }
 
283
 
 
284
        /*
 
285
         * carry over the pointer count to the reply in case we are
 
286
         * using full pointer. See NDR specification for full pointers
 
287
         */
 
288
        push->ptr_count = pull->ptr_count;
 
289
 
 
290
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
291
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
292
                talloc_free(r);
 
293
                return false;
 
294
        }
 
295
 
 
296
        p->out_data.rdata = ndr_push_blob(push);
 
297
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
298
 
 
299
        talloc_free(r);
 
300
 
 
301
        return true;
 
302
}
 
303
 
 
304
static bool api_FRSRPC_BACKUP_COMPLETE(struct pipes_struct *p)
 
305
{
 
306
        const struct ndr_interface_call *call;
 
307
        struct ndr_pull *pull;
 
308
        struct ndr_push *push;
 
309
        enum ndr_err_code ndr_err;
 
310
        struct FRSRPC_BACKUP_COMPLETE *r;
 
311
 
 
312
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_BACKUP_COMPLETE];
 
313
 
 
314
        r = talloc(talloc_tos(), struct FRSRPC_BACKUP_COMPLETE);
 
315
        if (r == NULL) {
 
316
                return false;
 
317
        }
 
318
 
 
319
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
320
        if (pull == NULL) {
 
321
                talloc_free(r);
 
322
                return false;
 
323
        }
 
324
 
 
325
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
326
        if (p->endian) {
 
327
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
328
        }
 
329
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
330
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
331
                talloc_free(r);
 
332
                return false;
 
333
        }
 
334
 
 
335
        if (DEBUGLEVEL >= 10) {
 
336
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE, NDR_IN, r);
 
337
        }
 
338
 
 
339
        _FRSRPC_BACKUP_COMPLETE(p, r);
 
340
 
 
341
        if (p->rng_fault_state) {
 
342
                talloc_free(r);
 
343
                /* Return true here, srv_pipe_hnd.c will take care */
 
344
                return true;
 
345
        }
 
346
 
 
347
        if (DEBUGLEVEL >= 10) {
 
348
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE, NDR_OUT | NDR_SET_VALUES, r);
 
349
        }
 
350
 
 
351
        push = ndr_push_init_ctx(r);
 
352
        if (push == NULL) {
 
353
                talloc_free(r);
 
354
                return false;
 
355
        }
 
356
 
 
357
        /*
 
358
         * carry over the pointer count to the reply in case we are
 
359
         * using full pointer. See NDR specification for full pointers
 
360
         */
 
361
        push->ptr_count = pull->ptr_count;
 
362
 
 
363
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
364
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
365
                talloc_free(r);
 
366
                return false;
 
367
        }
 
368
 
 
369
        p->out_data.rdata = ndr_push_blob(push);
 
370
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
371
 
 
372
        talloc_free(r);
 
373
 
 
374
        return true;
 
375
}
 
376
 
 
377
static bool api_FRSRPC_BACKUP_COMPLETE_5(struct pipes_struct *p)
 
378
{
 
379
        const struct ndr_interface_call *call;
 
380
        struct ndr_pull *pull;
 
381
        struct ndr_push *push;
 
382
        enum ndr_err_code ndr_err;
 
383
        struct FRSRPC_BACKUP_COMPLETE_5 *r;
 
384
 
 
385
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_BACKUP_COMPLETE_5];
 
386
 
 
387
        r = talloc(talloc_tos(), struct FRSRPC_BACKUP_COMPLETE_5);
 
388
        if (r == NULL) {
 
389
                return false;
 
390
        }
 
391
 
 
392
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
393
        if (pull == NULL) {
 
394
                talloc_free(r);
 
395
                return false;
 
396
        }
 
397
 
 
398
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
399
        if (p->endian) {
 
400
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
401
        }
 
402
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
403
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
404
                talloc_free(r);
 
405
                return false;
 
406
        }
 
407
 
 
408
        if (DEBUGLEVEL >= 10) {
 
409
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_5, NDR_IN, r);
 
410
        }
 
411
 
 
412
        _FRSRPC_BACKUP_COMPLETE_5(p, r);
 
413
 
 
414
        if (p->rng_fault_state) {
 
415
                talloc_free(r);
 
416
                /* Return true here, srv_pipe_hnd.c will take care */
 
417
                return true;
 
418
        }
 
419
 
 
420
        if (DEBUGLEVEL >= 10) {
 
421
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_5, NDR_OUT | NDR_SET_VALUES, r);
 
422
        }
 
423
 
 
424
        push = ndr_push_init_ctx(r);
 
425
        if (push == NULL) {
 
426
                talloc_free(r);
 
427
                return false;
 
428
        }
 
429
 
 
430
        /*
 
431
         * carry over the pointer count to the reply in case we are
 
432
         * using full pointer. See NDR specification for full pointers
 
433
         */
 
434
        push->ptr_count = pull->ptr_count;
 
435
 
 
436
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
437
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
438
                talloc_free(r);
 
439
                return false;
 
440
        }
 
441
 
 
442
        p->out_data.rdata = ndr_push_blob(push);
 
443
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
444
 
 
445
        talloc_free(r);
 
446
 
 
447
        return true;
 
448
}
 
449
 
 
450
static bool api_FRSRPC_BACKUP_COMPLETE_6(struct pipes_struct *p)
 
451
{
 
452
        const struct ndr_interface_call *call;
 
453
        struct ndr_pull *pull;
 
454
        struct ndr_push *push;
 
455
        enum ndr_err_code ndr_err;
 
456
        struct FRSRPC_BACKUP_COMPLETE_6 *r;
 
457
 
 
458
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_BACKUP_COMPLETE_6];
 
459
 
 
460
        r = talloc(talloc_tos(), struct FRSRPC_BACKUP_COMPLETE_6);
 
461
        if (r == NULL) {
 
462
                return false;
 
463
        }
 
464
 
 
465
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
466
        if (pull == NULL) {
 
467
                talloc_free(r);
 
468
                return false;
 
469
        }
 
470
 
 
471
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
472
        if (p->endian) {
 
473
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
474
        }
 
475
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
476
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
477
                talloc_free(r);
 
478
                return false;
 
479
        }
 
480
 
 
481
        if (DEBUGLEVEL >= 10) {
 
482
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_6, NDR_IN, r);
 
483
        }
 
484
 
 
485
        _FRSRPC_BACKUP_COMPLETE_6(p, r);
 
486
 
 
487
        if (p->rng_fault_state) {
 
488
                talloc_free(r);
 
489
                /* Return true here, srv_pipe_hnd.c will take care */
 
490
                return true;
 
491
        }
 
492
 
 
493
        if (DEBUGLEVEL >= 10) {
 
494
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_6, NDR_OUT | NDR_SET_VALUES, r);
 
495
        }
 
496
 
 
497
        push = ndr_push_init_ctx(r);
 
498
        if (push == NULL) {
 
499
                talloc_free(r);
 
500
                return false;
 
501
        }
 
502
 
 
503
        /*
 
504
         * carry over the pointer count to the reply in case we are
 
505
         * using full pointer. See NDR specification for full pointers
 
506
         */
 
507
        push->ptr_count = pull->ptr_count;
 
508
 
 
509
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
510
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
511
                talloc_free(r);
 
512
                return false;
 
513
        }
 
514
 
 
515
        p->out_data.rdata = ndr_push_blob(push);
 
516
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
517
 
 
518
        talloc_free(r);
 
519
 
 
520
        return true;
 
521
}
 
522
 
 
523
static bool api_FRSRPC_BACKUP_COMPLETE_7(struct pipes_struct *p)
 
524
{
 
525
        const struct ndr_interface_call *call;
 
526
        struct ndr_pull *pull;
 
527
        struct ndr_push *push;
 
528
        enum ndr_err_code ndr_err;
 
529
        struct FRSRPC_BACKUP_COMPLETE_7 *r;
 
530
 
 
531
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_BACKUP_COMPLETE_7];
 
532
 
 
533
        r = talloc(talloc_tos(), struct FRSRPC_BACKUP_COMPLETE_7);
 
534
        if (r == NULL) {
 
535
                return false;
 
536
        }
 
537
 
 
538
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
539
        if (pull == NULL) {
 
540
                talloc_free(r);
 
541
                return false;
 
542
        }
 
543
 
 
544
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
545
        if (p->endian) {
 
546
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
547
        }
 
548
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
549
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
550
                talloc_free(r);
 
551
                return false;
 
552
        }
 
553
 
 
554
        if (DEBUGLEVEL >= 10) {
 
555
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_7, NDR_IN, r);
 
556
        }
 
557
 
 
558
        _FRSRPC_BACKUP_COMPLETE_7(p, r);
 
559
 
 
560
        if (p->rng_fault_state) {
 
561
                talloc_free(r);
 
562
                /* Return true here, srv_pipe_hnd.c will take care */
 
563
                return true;
 
564
        }
 
565
 
 
566
        if (DEBUGLEVEL >= 10) {
 
567
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_7, NDR_OUT | NDR_SET_VALUES, r);
 
568
        }
 
569
 
 
570
        push = ndr_push_init_ctx(r);
 
571
        if (push == NULL) {
 
572
                talloc_free(r);
 
573
                return false;
 
574
        }
 
575
 
 
576
        /*
 
577
         * carry over the pointer count to the reply in case we are
 
578
         * using full pointer. See NDR specification for full pointers
 
579
         */
 
580
        push->ptr_count = pull->ptr_count;
 
581
 
 
582
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
583
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
584
                talloc_free(r);
 
585
                return false;
 
586
        }
 
587
 
 
588
        p->out_data.rdata = ndr_push_blob(push);
 
589
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
590
 
 
591
        talloc_free(r);
 
592
 
 
593
        return true;
 
594
}
 
595
 
 
596
static bool api_FRSRPC_BACKUP_COMPLETE_8(struct pipes_struct *p)
 
597
{
 
598
        const struct ndr_interface_call *call;
 
599
        struct ndr_pull *pull;
 
600
        struct ndr_push *push;
 
601
        enum ndr_err_code ndr_err;
 
602
        struct FRSRPC_BACKUP_COMPLETE_8 *r;
 
603
 
 
604
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_BACKUP_COMPLETE_8];
 
605
 
 
606
        r = talloc(talloc_tos(), struct FRSRPC_BACKUP_COMPLETE_8);
 
607
        if (r == NULL) {
 
608
                return false;
 
609
        }
 
610
 
 
611
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
612
        if (pull == NULL) {
 
613
                talloc_free(r);
 
614
                return false;
 
615
        }
 
616
 
 
617
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
618
        if (p->endian) {
 
619
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
620
        }
 
621
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
622
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
623
                talloc_free(r);
 
624
                return false;
 
625
        }
 
626
 
 
627
        if (DEBUGLEVEL >= 10) {
 
628
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_8, NDR_IN, r);
 
629
        }
 
630
 
 
631
        _FRSRPC_BACKUP_COMPLETE_8(p, r);
 
632
 
 
633
        if (p->rng_fault_state) {
 
634
                talloc_free(r);
 
635
                /* Return true here, srv_pipe_hnd.c will take care */
 
636
                return true;
 
637
        }
 
638
 
 
639
        if (DEBUGLEVEL >= 10) {
 
640
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_8, NDR_OUT | NDR_SET_VALUES, r);
 
641
        }
 
642
 
 
643
        push = ndr_push_init_ctx(r);
 
644
        if (push == NULL) {
 
645
                talloc_free(r);
 
646
                return false;
 
647
        }
 
648
 
 
649
        /*
 
650
         * carry over the pointer count to the reply in case we are
 
651
         * using full pointer. See NDR specification for full pointers
 
652
         */
 
653
        push->ptr_count = pull->ptr_count;
 
654
 
 
655
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
656
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
657
                talloc_free(r);
 
658
                return false;
 
659
        }
 
660
 
 
661
        p->out_data.rdata = ndr_push_blob(push);
 
662
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
663
 
 
664
        talloc_free(r);
 
665
 
 
666
        return true;
 
667
}
 
668
 
 
669
static bool api_FRSRPC_BACKUP_COMPLETE_9(struct pipes_struct *p)
 
670
{
 
671
        const struct ndr_interface_call *call;
 
672
        struct ndr_pull *pull;
 
673
        struct ndr_push *push;
 
674
        enum ndr_err_code ndr_err;
 
675
        struct FRSRPC_BACKUP_COMPLETE_9 *r;
 
676
 
 
677
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_BACKUP_COMPLETE_9];
 
678
 
 
679
        r = talloc(talloc_tos(), struct FRSRPC_BACKUP_COMPLETE_9);
 
680
        if (r == NULL) {
 
681
                return false;
 
682
        }
 
683
 
 
684
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
685
        if (pull == NULL) {
 
686
                talloc_free(r);
 
687
                return false;
 
688
        }
 
689
 
 
690
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
691
        if (p->endian) {
 
692
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
693
        }
 
694
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
695
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
696
                talloc_free(r);
 
697
                return false;
 
698
        }
 
699
 
 
700
        if (DEBUGLEVEL >= 10) {
 
701
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_9, NDR_IN, r);
 
702
        }
 
703
 
 
704
        _FRSRPC_BACKUP_COMPLETE_9(p, r);
 
705
 
 
706
        if (p->rng_fault_state) {
 
707
                talloc_free(r);
 
708
                /* Return true here, srv_pipe_hnd.c will take care */
 
709
                return true;
 
710
        }
 
711
 
 
712
        if (DEBUGLEVEL >= 10) {
 
713
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_BACKUP_COMPLETE_9, NDR_OUT | NDR_SET_VALUES, r);
 
714
        }
 
715
 
 
716
        push = ndr_push_init_ctx(r);
 
717
        if (push == NULL) {
 
718
                talloc_free(r);
 
719
                return false;
 
720
        }
 
721
 
 
722
        /*
 
723
         * carry over the pointer count to the reply in case we are
 
724
         * using full pointer. See NDR specification for full pointers
 
725
         */
 
726
        push->ptr_count = pull->ptr_count;
 
727
 
 
728
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
729
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
730
                talloc_free(r);
 
731
                return false;
 
732
        }
 
733
 
 
734
        p->out_data.rdata = ndr_push_blob(push);
 
735
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
736
 
 
737
        talloc_free(r);
 
738
 
 
739
        return true;
 
740
}
 
741
 
 
742
static bool api_FRSRPC_VERIFY_PROMOTION_PARENT_EX(struct pipes_struct *p)
 
743
{
 
744
        const struct ndr_interface_call *call;
 
745
        struct ndr_pull *pull;
 
746
        struct ndr_push *push;
 
747
        enum ndr_err_code ndr_err;
 
748
        struct FRSRPC_VERIFY_PROMOTION_PARENT_EX *r;
 
749
 
 
750
        call = &ndr_table_frsrpc.calls[NDR_FRSRPC_VERIFY_PROMOTION_PARENT_EX];
 
751
 
 
752
        r = talloc(talloc_tos(), struct FRSRPC_VERIFY_PROMOTION_PARENT_EX);
 
753
        if (r == NULL) {
 
754
                return false;
 
755
        }
 
756
 
 
757
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
758
        if (pull == NULL) {
 
759
                talloc_free(r);
 
760
                return false;
 
761
        }
 
762
 
 
763
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
764
        if (p->endian) {
 
765
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
766
        }
 
767
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
768
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
769
                talloc_free(r);
 
770
                return false;
 
771
        }
 
772
 
 
773
        if (DEBUGLEVEL >= 10) {
 
774
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_VERIFY_PROMOTION_PARENT_EX, NDR_IN, r);
 
775
        }
 
776
 
 
777
        _FRSRPC_VERIFY_PROMOTION_PARENT_EX(p, r);
 
778
 
 
779
        if (p->rng_fault_state) {
 
780
                talloc_free(r);
 
781
                /* Return true here, srv_pipe_hnd.c will take care */
 
782
                return true;
 
783
        }
 
784
 
 
785
        if (DEBUGLEVEL >= 10) {
 
786
                NDR_PRINT_FUNCTION_DEBUG(FRSRPC_VERIFY_PROMOTION_PARENT_EX, NDR_OUT | NDR_SET_VALUES, r);
 
787
        }
 
788
 
 
789
        push = ndr_push_init_ctx(r);
 
790
        if (push == NULL) {
 
791
                talloc_free(r);
 
792
                return false;
 
793
        }
 
794
 
 
795
        /*
 
796
         * carry over the pointer count to the reply in case we are
 
797
         * using full pointer. See NDR specification for full pointers
 
798
         */
 
799
        push->ptr_count = pull->ptr_count;
 
800
 
 
801
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
802
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
803
                talloc_free(r);
 
804
                return false;
 
805
        }
 
806
 
 
807
        p->out_data.rdata = ndr_push_blob(push);
 
808
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
809
 
 
810
        talloc_free(r);
 
811
 
 
812
        return true;
 
813
}
 
814
 
 
815
 
 
816
/* Tables */
 
817
static struct api_struct api_frsrpc_cmds[] = 
 
818
{
 
819
        {"FRSRPC_FRSSENDCOMMPKT", NDR_FRSRPC_FRSSENDCOMMPKT, api_frsrpc_FrsSendCommPkt},
 
820
        {"FRSRPC_FRSVERIFYPROMOTIONPARENT", NDR_FRSRPC_FRSVERIFYPROMOTIONPARENT, api_frsrpc_FrsVerifyPromotionParent},
 
821
        {"FRSRPC_FRSSTARTPROMOTIONPARENT", NDR_FRSRPC_FRSSTARTPROMOTIONPARENT, api_frsrpc_FrsStartPromotionParent},
 
822
        {"FRSRPC_FRSNOP", NDR_FRSRPC_FRSNOP, api_frsrpc_FrsNOP},
 
823
        {"FRSRPC_BACKUP_COMPLETE", NDR_FRSRPC_BACKUP_COMPLETE, api_FRSRPC_BACKUP_COMPLETE},
 
824
        {"FRSRPC_BACKUP_COMPLETE_5", NDR_FRSRPC_BACKUP_COMPLETE_5, api_FRSRPC_BACKUP_COMPLETE_5},
 
825
        {"FRSRPC_BACKUP_COMPLETE_6", NDR_FRSRPC_BACKUP_COMPLETE_6, api_FRSRPC_BACKUP_COMPLETE_6},
 
826
        {"FRSRPC_BACKUP_COMPLETE_7", NDR_FRSRPC_BACKUP_COMPLETE_7, api_FRSRPC_BACKUP_COMPLETE_7},
 
827
        {"FRSRPC_BACKUP_COMPLETE_8", NDR_FRSRPC_BACKUP_COMPLETE_8, api_FRSRPC_BACKUP_COMPLETE_8},
 
828
        {"FRSRPC_BACKUP_COMPLETE_9", NDR_FRSRPC_BACKUP_COMPLETE_9, api_FRSRPC_BACKUP_COMPLETE_9},
 
829
        {"FRSRPC_VERIFY_PROMOTION_PARENT_EX", NDR_FRSRPC_VERIFY_PROMOTION_PARENT_EX, api_FRSRPC_VERIFY_PROMOTION_PARENT_EX},
 
830
};
 
831
 
 
832
void frsrpc_get_pipe_fns(struct api_struct **fns, int *n_fns)
 
833
{
 
834
        *fns = api_frsrpc_cmds;
 
835
        *n_fns = sizeof(api_frsrpc_cmds) / sizeof(struct api_struct);
 
836
}
 
837
 
 
838
NTSTATUS rpc_frsrpc_init(const struct rpc_srv_callbacks *rpc_srv_cb)
 
839
{
 
840
        return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "frsrpc", "frsrpc", &ndr_table_frsrpc, api_frsrpc_cmds, sizeof(api_frsrpc_cmds) / sizeof(struct api_struct), rpc_srv_cb);
 
841
}
 
842
 
 
843
NTSTATUS rpc_frsrpc_shutdown(void)
 
844
{
 
845
        return rpc_srv_unregister(&ndr_table_frsrpc);
 
846
}