~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source3/librpc/gen_ndr/srv_dssetup.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_dssetup.h"
 
9
 
 
10
static bool api_dssetup_DsRoleGetPrimaryDomainInformation(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 dssetup_DsRoleGetPrimaryDomainInformation *r;
 
17
 
 
18
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION];
 
19
 
 
20
        r = talloc(talloc_tos(), struct dssetup_DsRoleGetPrimaryDomainInformation);
 
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(dssetup_DsRoleGetPrimaryDomainInformation, NDR_IN, r);
 
43
        }
 
44
 
 
45
        ZERO_STRUCT(r->out);
 
46
        r->out.info = talloc_zero(r, union dssetup_DsRoleInfo);
 
47
        if (r->out.info == NULL) {
 
48
                talloc_free(r);
 
49
                return false;
 
50
        }
 
51
 
 
52
        r->out.result = _dssetup_DsRoleGetPrimaryDomainInformation(p, r);
 
53
 
 
54
        if (p->rng_fault_state) {
 
55
                talloc_free(r);
 
56
                /* Return true here, srv_pipe_hnd.c will take care */
 
57
                return true;
 
58
        }
 
59
 
 
60
        if (DEBUGLEVEL >= 10) {
 
61
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, NDR_OUT | NDR_SET_VALUES, r);
 
62
        }
 
63
 
 
64
        push = ndr_push_init_ctx(r);
 
65
        if (push == NULL) {
 
66
                talloc_free(r);
 
67
                return false;
 
68
        }
 
69
 
 
70
        /*
 
71
         * carry over the pointer count to the reply in case we are
 
72
         * using full pointer. See NDR specification for full pointers
 
73
         */
 
74
        push->ptr_count = pull->ptr_count;
 
75
 
 
76
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
77
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
78
                talloc_free(r);
 
79
                return false;
 
80
        }
 
81
 
 
82
        p->out_data.rdata = ndr_push_blob(push);
 
83
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
84
 
 
85
        talloc_free(r);
 
86
 
 
87
        return true;
 
88
}
 
89
 
 
90
static bool api_dssetup_DsRoleDnsNameToFlatName(struct pipes_struct *p)
 
91
{
 
92
        const struct ndr_interface_call *call;
 
93
        struct ndr_pull *pull;
 
94
        struct ndr_push *push;
 
95
        enum ndr_err_code ndr_err;
 
96
        struct dssetup_DsRoleDnsNameToFlatName *r;
 
97
 
 
98
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME];
 
99
 
 
100
        r = talloc(talloc_tos(), struct dssetup_DsRoleDnsNameToFlatName);
 
101
        if (r == NULL) {
 
102
                return false;
 
103
        }
 
104
 
 
105
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
106
        if (pull == NULL) {
 
107
                talloc_free(r);
 
108
                return false;
 
109
        }
 
110
 
 
111
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
112
        if (p->endian) {
 
113
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
114
        }
 
115
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
116
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
117
                talloc_free(r);
 
118
                return false;
 
119
        }
 
120
 
 
121
        if (DEBUGLEVEL >= 10) {
 
122
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDnsNameToFlatName, NDR_IN, r);
 
123
        }
 
124
 
 
125
        r->out.result = _dssetup_DsRoleDnsNameToFlatName(p, r);
 
126
 
 
127
        if (p->rng_fault_state) {
 
128
                talloc_free(r);
 
129
                /* Return true here, srv_pipe_hnd.c will take care */
 
130
                return true;
 
131
        }
 
132
 
 
133
        if (DEBUGLEVEL >= 10) {
 
134
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDnsNameToFlatName, NDR_OUT | NDR_SET_VALUES, r);
 
135
        }
 
136
 
 
137
        push = ndr_push_init_ctx(r);
 
138
        if (push == NULL) {
 
139
                talloc_free(r);
 
140
                return false;
 
141
        }
 
142
 
 
143
        /*
 
144
         * carry over the pointer count to the reply in case we are
 
145
         * using full pointer. See NDR specification for full pointers
 
146
         */
 
147
        push->ptr_count = pull->ptr_count;
 
148
 
 
149
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
150
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
151
                talloc_free(r);
 
152
                return false;
 
153
        }
 
154
 
 
155
        p->out_data.rdata = ndr_push_blob(push);
 
156
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
157
 
 
158
        talloc_free(r);
 
159
 
 
160
        return true;
 
161
}
 
162
 
 
163
static bool api_dssetup_DsRoleDcAsDc(struct pipes_struct *p)
 
164
{
 
165
        const struct ndr_interface_call *call;
 
166
        struct ndr_pull *pull;
 
167
        struct ndr_push *push;
 
168
        enum ndr_err_code ndr_err;
 
169
        struct dssetup_DsRoleDcAsDc *r;
 
170
 
 
171
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASDC];
 
172
 
 
173
        r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsDc);
 
174
        if (r == NULL) {
 
175
                return false;
 
176
        }
 
177
 
 
178
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
179
        if (pull == NULL) {
 
180
                talloc_free(r);
 
181
                return false;
 
182
        }
 
183
 
 
184
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
185
        if (p->endian) {
 
186
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
187
        }
 
188
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
189
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
190
                talloc_free(r);
 
191
                return false;
 
192
        }
 
193
 
 
194
        if (DEBUGLEVEL >= 10) {
 
195
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDcAsDc, NDR_IN, r);
 
196
        }
 
197
 
 
198
        r->out.result = _dssetup_DsRoleDcAsDc(p, r);
 
199
 
 
200
        if (p->rng_fault_state) {
 
201
                talloc_free(r);
 
202
                /* Return true here, srv_pipe_hnd.c will take care */
 
203
                return true;
 
204
        }
 
205
 
 
206
        if (DEBUGLEVEL >= 10) {
 
207
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDcAsDc, NDR_OUT | NDR_SET_VALUES, r);
 
208
        }
 
209
 
 
210
        push = ndr_push_init_ctx(r);
 
211
        if (push == NULL) {
 
212
                talloc_free(r);
 
213
                return false;
 
214
        }
 
215
 
 
216
        /*
 
217
         * carry over the pointer count to the reply in case we are
 
218
         * using full pointer. See NDR specification for full pointers
 
219
         */
 
220
        push->ptr_count = pull->ptr_count;
 
221
 
 
222
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
223
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
224
                talloc_free(r);
 
225
                return false;
 
226
        }
 
227
 
 
228
        p->out_data.rdata = ndr_push_blob(push);
 
229
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
230
 
 
231
        talloc_free(r);
 
232
 
 
233
        return true;
 
234
}
 
235
 
 
236
static bool api_dssetup_DsRoleDcAsReplica(struct pipes_struct *p)
 
237
{
 
238
        const struct ndr_interface_call *call;
 
239
        struct ndr_pull *pull;
 
240
        struct ndr_push *push;
 
241
        enum ndr_err_code ndr_err;
 
242
        struct dssetup_DsRoleDcAsReplica *r;
 
243
 
 
244
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASREPLICA];
 
245
 
 
246
        r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsReplica);
 
247
        if (r == NULL) {
 
248
                return false;
 
249
        }
 
250
 
 
251
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
252
        if (pull == NULL) {
 
253
                talloc_free(r);
 
254
                return false;
 
255
        }
 
256
 
 
257
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
258
        if (p->endian) {
 
259
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
260
        }
 
261
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
262
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
263
                talloc_free(r);
 
264
                return false;
 
265
        }
 
266
 
 
267
        if (DEBUGLEVEL >= 10) {
 
268
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDcAsReplica, NDR_IN, r);
 
269
        }
 
270
 
 
271
        r->out.result = _dssetup_DsRoleDcAsReplica(p, r);
 
272
 
 
273
        if (p->rng_fault_state) {
 
274
                talloc_free(r);
 
275
                /* Return true here, srv_pipe_hnd.c will take care */
 
276
                return true;
 
277
        }
 
278
 
 
279
        if (DEBUGLEVEL >= 10) {
 
280
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDcAsReplica, NDR_OUT | NDR_SET_VALUES, r);
 
281
        }
 
282
 
 
283
        push = ndr_push_init_ctx(r);
 
284
        if (push == NULL) {
 
285
                talloc_free(r);
 
286
                return false;
 
287
        }
 
288
 
 
289
        /*
 
290
         * carry over the pointer count to the reply in case we are
 
291
         * using full pointer. See NDR specification for full pointers
 
292
         */
 
293
        push->ptr_count = pull->ptr_count;
 
294
 
 
295
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
296
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
297
                talloc_free(r);
 
298
                return false;
 
299
        }
 
300
 
 
301
        p->out_data.rdata = ndr_push_blob(push);
 
302
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
303
 
 
304
        talloc_free(r);
 
305
 
 
306
        return true;
 
307
}
 
308
 
 
309
static bool api_dssetup_DsRoleDemoteDc(struct pipes_struct *p)
 
310
{
 
311
        const struct ndr_interface_call *call;
 
312
        struct ndr_pull *pull;
 
313
        struct ndr_push *push;
 
314
        enum ndr_err_code ndr_err;
 
315
        struct dssetup_DsRoleDemoteDc *r;
 
316
 
 
317
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDEMOTEDC];
 
318
 
 
319
        r = talloc(talloc_tos(), struct dssetup_DsRoleDemoteDc);
 
320
        if (r == NULL) {
 
321
                return false;
 
322
        }
 
323
 
 
324
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
325
        if (pull == NULL) {
 
326
                talloc_free(r);
 
327
                return false;
 
328
        }
 
329
 
 
330
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
331
        if (p->endian) {
 
332
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
333
        }
 
334
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
335
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
336
                talloc_free(r);
 
337
                return false;
 
338
        }
 
339
 
 
340
        if (DEBUGLEVEL >= 10) {
 
341
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDemoteDc, NDR_IN, r);
 
342
        }
 
343
 
 
344
        r->out.result = _dssetup_DsRoleDemoteDc(p, r);
 
345
 
 
346
        if (p->rng_fault_state) {
 
347
                talloc_free(r);
 
348
                /* Return true here, srv_pipe_hnd.c will take care */
 
349
                return true;
 
350
        }
 
351
 
 
352
        if (DEBUGLEVEL >= 10) {
 
353
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleDemoteDc, NDR_OUT | NDR_SET_VALUES, r);
 
354
        }
 
355
 
 
356
        push = ndr_push_init_ctx(r);
 
357
        if (push == NULL) {
 
358
                talloc_free(r);
 
359
                return false;
 
360
        }
 
361
 
 
362
        /*
 
363
         * carry over the pointer count to the reply in case we are
 
364
         * using full pointer. See NDR specification for full pointers
 
365
         */
 
366
        push->ptr_count = pull->ptr_count;
 
367
 
 
368
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
369
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
370
                talloc_free(r);
 
371
                return false;
 
372
        }
 
373
 
 
374
        p->out_data.rdata = ndr_push_blob(push);
 
375
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
376
 
 
377
        talloc_free(r);
 
378
 
 
379
        return true;
 
380
}
 
381
 
 
382
static bool api_dssetup_DsRoleGetDcOperationProgress(struct pipes_struct *p)
 
383
{
 
384
        const struct ndr_interface_call *call;
 
385
        struct ndr_pull *pull;
 
386
        struct ndr_push *push;
 
387
        enum ndr_err_code ndr_err;
 
388
        struct dssetup_DsRoleGetDcOperationProgress *r;
 
389
 
 
390
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS];
 
391
 
 
392
        r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationProgress);
 
393
        if (r == NULL) {
 
394
                return false;
 
395
        }
 
396
 
 
397
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
398
        if (pull == NULL) {
 
399
                talloc_free(r);
 
400
                return false;
 
401
        }
 
402
 
 
403
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
404
        if (p->endian) {
 
405
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
406
        }
 
407
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
408
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
409
                talloc_free(r);
 
410
                return false;
 
411
        }
 
412
 
 
413
        if (DEBUGLEVEL >= 10) {
 
414
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetDcOperationProgress, NDR_IN, r);
 
415
        }
 
416
 
 
417
        r->out.result = _dssetup_DsRoleGetDcOperationProgress(p, r);
 
418
 
 
419
        if (p->rng_fault_state) {
 
420
                talloc_free(r);
 
421
                /* Return true here, srv_pipe_hnd.c will take care */
 
422
                return true;
 
423
        }
 
424
 
 
425
        if (DEBUGLEVEL >= 10) {
 
426
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetDcOperationProgress, NDR_OUT | NDR_SET_VALUES, r);
 
427
        }
 
428
 
 
429
        push = ndr_push_init_ctx(r);
 
430
        if (push == NULL) {
 
431
                talloc_free(r);
 
432
                return false;
 
433
        }
 
434
 
 
435
        /*
 
436
         * carry over the pointer count to the reply in case we are
 
437
         * using full pointer. See NDR specification for full pointers
 
438
         */
 
439
        push->ptr_count = pull->ptr_count;
 
440
 
 
441
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
442
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
443
                talloc_free(r);
 
444
                return false;
 
445
        }
 
446
 
 
447
        p->out_data.rdata = ndr_push_blob(push);
 
448
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
449
 
 
450
        talloc_free(r);
 
451
 
 
452
        return true;
 
453
}
 
454
 
 
455
static bool api_dssetup_DsRoleGetDcOperationResults(struct pipes_struct *p)
 
456
{
 
457
        const struct ndr_interface_call *call;
 
458
        struct ndr_pull *pull;
 
459
        struct ndr_push *push;
 
460
        enum ndr_err_code ndr_err;
 
461
        struct dssetup_DsRoleGetDcOperationResults *r;
 
462
 
 
463
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS];
 
464
 
 
465
        r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationResults);
 
466
        if (r == NULL) {
 
467
                return false;
 
468
        }
 
469
 
 
470
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
471
        if (pull == NULL) {
 
472
                talloc_free(r);
 
473
                return false;
 
474
        }
 
475
 
 
476
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
477
        if (p->endian) {
 
478
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
479
        }
 
480
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
481
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
482
                talloc_free(r);
 
483
                return false;
 
484
        }
 
485
 
 
486
        if (DEBUGLEVEL >= 10) {
 
487
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetDcOperationResults, NDR_IN, r);
 
488
        }
 
489
 
 
490
        r->out.result = _dssetup_DsRoleGetDcOperationResults(p, r);
 
491
 
 
492
        if (p->rng_fault_state) {
 
493
                talloc_free(r);
 
494
                /* Return true here, srv_pipe_hnd.c will take care */
 
495
                return true;
 
496
        }
 
497
 
 
498
        if (DEBUGLEVEL >= 10) {
 
499
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleGetDcOperationResults, NDR_OUT | NDR_SET_VALUES, r);
 
500
        }
 
501
 
 
502
        push = ndr_push_init_ctx(r);
 
503
        if (push == NULL) {
 
504
                talloc_free(r);
 
505
                return false;
 
506
        }
 
507
 
 
508
        /*
 
509
         * carry over the pointer count to the reply in case we are
 
510
         * using full pointer. See NDR specification for full pointers
 
511
         */
 
512
        push->ptr_count = pull->ptr_count;
 
513
 
 
514
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
515
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
516
                talloc_free(r);
 
517
                return false;
 
518
        }
 
519
 
 
520
        p->out_data.rdata = ndr_push_blob(push);
 
521
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
522
 
 
523
        talloc_free(r);
 
524
 
 
525
        return true;
 
526
}
 
527
 
 
528
static bool api_dssetup_DsRoleCancel(struct pipes_struct *p)
 
529
{
 
530
        const struct ndr_interface_call *call;
 
531
        struct ndr_pull *pull;
 
532
        struct ndr_push *push;
 
533
        enum ndr_err_code ndr_err;
 
534
        struct dssetup_DsRoleCancel *r;
 
535
 
 
536
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLECANCEL];
 
537
 
 
538
        r = talloc(talloc_tos(), struct dssetup_DsRoleCancel);
 
539
        if (r == NULL) {
 
540
                return false;
 
541
        }
 
542
 
 
543
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
544
        if (pull == NULL) {
 
545
                talloc_free(r);
 
546
                return false;
 
547
        }
 
548
 
 
549
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
550
        if (p->endian) {
 
551
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
552
        }
 
553
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
554
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
555
                talloc_free(r);
 
556
                return false;
 
557
        }
 
558
 
 
559
        if (DEBUGLEVEL >= 10) {
 
560
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleCancel, NDR_IN, r);
 
561
        }
 
562
 
 
563
        r->out.result = _dssetup_DsRoleCancel(p, r);
 
564
 
 
565
        if (p->rng_fault_state) {
 
566
                talloc_free(r);
 
567
                /* Return true here, srv_pipe_hnd.c will take care */
 
568
                return true;
 
569
        }
 
570
 
 
571
        if (DEBUGLEVEL >= 10) {
 
572
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleCancel, NDR_OUT | NDR_SET_VALUES, r);
 
573
        }
 
574
 
 
575
        push = ndr_push_init_ctx(r);
 
576
        if (push == NULL) {
 
577
                talloc_free(r);
 
578
                return false;
 
579
        }
 
580
 
 
581
        /*
 
582
         * carry over the pointer count to the reply in case we are
 
583
         * using full pointer. See NDR specification for full pointers
 
584
         */
 
585
        push->ptr_count = pull->ptr_count;
 
586
 
 
587
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
588
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
589
                talloc_free(r);
 
590
                return false;
 
591
        }
 
592
 
 
593
        p->out_data.rdata = ndr_push_blob(push);
 
594
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
595
 
 
596
        talloc_free(r);
 
597
 
 
598
        return true;
 
599
}
 
600
 
 
601
static bool api_dssetup_DsRoleServerSaveStateForUpgrade(struct pipes_struct *p)
 
602
{
 
603
        const struct ndr_interface_call *call;
 
604
        struct ndr_pull *pull;
 
605
        struct ndr_push *push;
 
606
        enum ndr_err_code ndr_err;
 
607
        struct dssetup_DsRoleServerSaveStateForUpgrade *r;
 
608
 
 
609
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE];
 
610
 
 
611
        r = talloc(talloc_tos(), struct dssetup_DsRoleServerSaveStateForUpgrade);
 
612
        if (r == NULL) {
 
613
                return false;
 
614
        }
 
615
 
 
616
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
617
        if (pull == NULL) {
 
618
                talloc_free(r);
 
619
                return false;
 
620
        }
 
621
 
 
622
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
623
        if (p->endian) {
 
624
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
625
        }
 
626
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
627
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
628
                talloc_free(r);
 
629
                return false;
 
630
        }
 
631
 
 
632
        if (DEBUGLEVEL >= 10) {
 
633
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, NDR_IN, r);
 
634
        }
 
635
 
 
636
        r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(p, r);
 
637
 
 
638
        if (p->rng_fault_state) {
 
639
                talloc_free(r);
 
640
                /* Return true here, srv_pipe_hnd.c will take care */
 
641
                return true;
 
642
        }
 
643
 
 
644
        if (DEBUGLEVEL >= 10) {
 
645
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, NDR_OUT | NDR_SET_VALUES, r);
 
646
        }
 
647
 
 
648
        push = ndr_push_init_ctx(r);
 
649
        if (push == NULL) {
 
650
                talloc_free(r);
 
651
                return false;
 
652
        }
 
653
 
 
654
        /*
 
655
         * carry over the pointer count to the reply in case we are
 
656
         * using full pointer. See NDR specification for full pointers
 
657
         */
 
658
        push->ptr_count = pull->ptr_count;
 
659
 
 
660
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
661
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
662
                talloc_free(r);
 
663
                return false;
 
664
        }
 
665
 
 
666
        p->out_data.rdata = ndr_push_blob(push);
 
667
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
668
 
 
669
        talloc_free(r);
 
670
 
 
671
        return true;
 
672
}
 
673
 
 
674
static bool api_dssetup_DsRoleUpgradeDownlevelServer(struct pipes_struct *p)
 
675
{
 
676
        const struct ndr_interface_call *call;
 
677
        struct ndr_pull *pull;
 
678
        struct ndr_push *push;
 
679
        enum ndr_err_code ndr_err;
 
680
        struct dssetup_DsRoleUpgradeDownlevelServer *r;
 
681
 
 
682
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER];
 
683
 
 
684
        r = talloc(talloc_tos(), struct dssetup_DsRoleUpgradeDownlevelServer);
 
685
        if (r == NULL) {
 
686
                return false;
 
687
        }
 
688
 
 
689
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
690
        if (pull == NULL) {
 
691
                talloc_free(r);
 
692
                return false;
 
693
        }
 
694
 
 
695
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
696
        if (p->endian) {
 
697
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
698
        }
 
699
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
700
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
701
                talloc_free(r);
 
702
                return false;
 
703
        }
 
704
 
 
705
        if (DEBUGLEVEL >= 10) {
 
706
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, NDR_IN, r);
 
707
        }
 
708
 
 
709
        r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(p, r);
 
710
 
 
711
        if (p->rng_fault_state) {
 
712
                talloc_free(r);
 
713
                /* Return true here, srv_pipe_hnd.c will take care */
 
714
                return true;
 
715
        }
 
716
 
 
717
        if (DEBUGLEVEL >= 10) {
 
718
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, NDR_OUT | NDR_SET_VALUES, r);
 
719
        }
 
720
 
 
721
        push = ndr_push_init_ctx(r);
 
722
        if (push == NULL) {
 
723
                talloc_free(r);
 
724
                return false;
 
725
        }
 
726
 
 
727
        /*
 
728
         * carry over the pointer count to the reply in case we are
 
729
         * using full pointer. See NDR specification for full pointers
 
730
         */
 
731
        push->ptr_count = pull->ptr_count;
 
732
 
 
733
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
734
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
735
                talloc_free(r);
 
736
                return false;
 
737
        }
 
738
 
 
739
        p->out_data.rdata = ndr_push_blob(push);
 
740
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
741
 
 
742
        talloc_free(r);
 
743
 
 
744
        return true;
 
745
}
 
746
 
 
747
static bool api_dssetup_DsRoleAbortDownlevelServerUpgrade(struct pipes_struct *p)
 
748
{
 
749
        const struct ndr_interface_call *call;
 
750
        struct ndr_pull *pull;
 
751
        struct ndr_push *push;
 
752
        enum ndr_err_code ndr_err;
 
753
        struct dssetup_DsRoleAbortDownlevelServerUpgrade *r;
 
754
 
 
755
        call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE];
 
756
 
 
757
        r = talloc(talloc_tos(), struct dssetup_DsRoleAbortDownlevelServerUpgrade);
 
758
        if (r == NULL) {
 
759
                return false;
 
760
        }
 
761
 
 
762
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
763
        if (pull == NULL) {
 
764
                talloc_free(r);
 
765
                return false;
 
766
        }
 
767
 
 
768
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
769
        if (p->endian) {
 
770
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
771
        }
 
772
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
773
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
774
                talloc_free(r);
 
775
                return false;
 
776
        }
 
777
 
 
778
        if (DEBUGLEVEL >= 10) {
 
779
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, NDR_IN, r);
 
780
        }
 
781
 
 
782
        r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(p, r);
 
783
 
 
784
        if (p->rng_fault_state) {
 
785
                talloc_free(r);
 
786
                /* Return true here, srv_pipe_hnd.c will take care */
 
787
                return true;
 
788
        }
 
789
 
 
790
        if (DEBUGLEVEL >= 10) {
 
791
                NDR_PRINT_FUNCTION_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, NDR_OUT | NDR_SET_VALUES, r);
 
792
        }
 
793
 
 
794
        push = ndr_push_init_ctx(r);
 
795
        if (push == NULL) {
 
796
                talloc_free(r);
 
797
                return false;
 
798
        }
 
799
 
 
800
        /*
 
801
         * carry over the pointer count to the reply in case we are
 
802
         * using full pointer. See NDR specification for full pointers
 
803
         */
 
804
        push->ptr_count = pull->ptr_count;
 
805
 
 
806
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
807
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
808
                talloc_free(r);
 
809
                return false;
 
810
        }
 
811
 
 
812
        p->out_data.rdata = ndr_push_blob(push);
 
813
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
814
 
 
815
        talloc_free(r);
 
816
 
 
817
        return true;
 
818
}
 
819
 
 
820
 
 
821
/* Tables */
 
822
static struct api_struct api_dssetup_cmds[] = 
 
823
{
 
824
        {"DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION", NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, api_dssetup_DsRoleGetPrimaryDomainInformation},
 
825
        {"DSSETUP_DSROLEDNSNAMETOFLATNAME", NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, api_dssetup_DsRoleDnsNameToFlatName},
 
826
        {"DSSETUP_DSROLEDCASDC", NDR_DSSETUP_DSROLEDCASDC, api_dssetup_DsRoleDcAsDc},
 
827
        {"DSSETUP_DSROLEDCASREPLICA", NDR_DSSETUP_DSROLEDCASREPLICA, api_dssetup_DsRoleDcAsReplica},
 
828
        {"DSSETUP_DSROLEDEMOTEDC", NDR_DSSETUP_DSROLEDEMOTEDC, api_dssetup_DsRoleDemoteDc},
 
829
        {"DSSETUP_DSROLEGETDCOPERATIONPROGRESS", NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, api_dssetup_DsRoleGetDcOperationProgress},
 
830
        {"DSSETUP_DSROLEGETDCOPERATIONRESULTS", NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, api_dssetup_DsRoleGetDcOperationResults},
 
831
        {"DSSETUP_DSROLECANCEL", NDR_DSSETUP_DSROLECANCEL, api_dssetup_DsRoleCancel},
 
832
        {"DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE", NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, api_dssetup_DsRoleServerSaveStateForUpgrade},
 
833
        {"DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER", NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, api_dssetup_DsRoleUpgradeDownlevelServer},
 
834
        {"DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE", NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, api_dssetup_DsRoleAbortDownlevelServerUpgrade},
 
835
};
 
836
 
 
837
void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns)
 
838
{
 
839
        *fns = api_dssetup_cmds;
 
840
        *n_fns = sizeof(api_dssetup_cmds) / sizeof(struct api_struct);
 
841
}
 
842
 
 
843
NTSTATUS rpc_dssetup_init(const struct rpc_srv_callbacks *rpc_srv_cb)
 
844
{
 
845
        return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", &ndr_table_dssetup, api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct), rpc_srv_cb);
 
846
}
 
847
 
 
848
NTSTATUS rpc_dssetup_shutdown(void)
 
849
{
 
850
        return rpc_srv_unregister(&ndr_table_dssetup);
 
851
}