~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source3/librpc/gen_ndr/srv_msgsvc.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_msgsvc.h"
 
9
 
 
10
static bool api_NetrMessageNameAdd(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 NetrMessageNameAdd *r;
 
17
 
 
18
        call = &ndr_table_msgsvc.calls[NDR_NETRMESSAGENAMEADD];
 
19
 
 
20
        r = talloc(talloc_tos(), struct NetrMessageNameAdd);
 
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(NetrMessageNameAdd, NDR_IN, r);
 
43
        }
 
44
 
 
45
        _NetrMessageNameAdd(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(NetrMessageNameAdd, 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_NetrMessageNameEnum(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 NetrMessageNameEnum *r;
 
90
 
 
91
        call = &ndr_table_msgsvc.calls[NDR_NETRMESSAGENAMEENUM];
 
92
 
 
93
        r = talloc(talloc_tos(), struct NetrMessageNameEnum);
 
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(NetrMessageNameEnum, NDR_IN, r);
 
116
        }
 
117
 
 
118
        _NetrMessageNameEnum(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(NetrMessageNameEnum, 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_NetrMessageNameGetInfo(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 NetrMessageNameGetInfo *r;
 
163
 
 
164
        call = &ndr_table_msgsvc.calls[NDR_NETRMESSAGENAMEGETINFO];
 
165
 
 
166
        r = talloc(talloc_tos(), struct NetrMessageNameGetInfo);
 
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(NetrMessageNameGetInfo, NDR_IN, r);
 
189
        }
 
190
 
 
191
        _NetrMessageNameGetInfo(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(NetrMessageNameGetInfo, 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_NetrMessageNameDel(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 NetrMessageNameDel *r;
 
236
 
 
237
        call = &ndr_table_msgsvc.calls[NDR_NETRMESSAGENAMEDEL];
 
238
 
 
239
        r = talloc(talloc_tos(), struct NetrMessageNameDel);
 
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(NetrMessageNameDel, NDR_IN, r);
 
262
        }
 
263
 
 
264
        _NetrMessageNameDel(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(NetrMessageNameDel, 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
 
 
303
/* Tables */
 
304
static struct api_struct api_msgsvc_cmds[] = 
 
305
{
 
306
        {"NETRMESSAGENAMEADD", NDR_NETRMESSAGENAMEADD, api_NetrMessageNameAdd},
 
307
        {"NETRMESSAGENAMEENUM", NDR_NETRMESSAGENAMEENUM, api_NetrMessageNameEnum},
 
308
        {"NETRMESSAGENAMEGETINFO", NDR_NETRMESSAGENAMEGETINFO, api_NetrMessageNameGetInfo},
 
309
        {"NETRMESSAGENAMEDEL", NDR_NETRMESSAGENAMEDEL, api_NetrMessageNameDel},
 
310
};
 
311
 
 
312
void msgsvc_get_pipe_fns(struct api_struct **fns, int *n_fns)
 
313
{
 
314
        *fns = api_msgsvc_cmds;
 
315
        *n_fns = sizeof(api_msgsvc_cmds) / sizeof(struct api_struct);
 
316
}
 
317
 
 
318
NTSTATUS rpc_msgsvc_init(const struct rpc_srv_callbacks *rpc_srv_cb)
 
319
{
 
320
        return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "msgsvc", "msgsvc", &ndr_table_msgsvc, api_msgsvc_cmds, sizeof(api_msgsvc_cmds) / sizeof(struct api_struct), rpc_srv_cb);
 
321
}
 
322
 
 
323
NTSTATUS rpc_msgsvc_shutdown(void)
 
324
{
 
325
        return rpc_srv_unregister(&ndr_table_msgsvc);
 
326
}
 
327
static bool api_NetrSendMessage(struct pipes_struct *p)
 
328
{
 
329
        const struct ndr_interface_call *call;
 
330
        struct ndr_pull *pull;
 
331
        struct ndr_push *push;
 
332
        enum ndr_err_code ndr_err;
 
333
        struct NetrSendMessage *r;
 
334
 
 
335
        call = &ndr_table_msgsvcsend.calls[NDR_NETRSENDMESSAGE];
 
336
 
 
337
        r = talloc(talloc_tos(), struct NetrSendMessage);
 
338
        if (r == NULL) {
 
339
                return false;
 
340
        }
 
341
 
 
342
        pull = ndr_pull_init_blob(&p->in_data.data, r);
 
343
        if (pull == NULL) {
 
344
                talloc_free(r);
 
345
                return false;
 
346
        }
 
347
 
 
348
        pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
349
        if (p->endian) {
 
350
                pull->flags |= LIBNDR_FLAG_BIGENDIAN;
 
351
        }
 
352
        ndr_err = call->ndr_pull(pull, NDR_IN, r);
 
353
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
354
                talloc_free(r);
 
355
                return false;
 
356
        }
 
357
 
 
358
        if (DEBUGLEVEL >= 10) {
 
359
                NDR_PRINT_FUNCTION_DEBUG(NetrSendMessage, NDR_IN, r);
 
360
        }
 
361
 
 
362
        _NetrSendMessage(p, r);
 
363
 
 
364
        if (p->rng_fault_state) {
 
365
                talloc_free(r);
 
366
                /* Return true here, srv_pipe_hnd.c will take care */
 
367
                return true;
 
368
        }
 
369
 
 
370
        if (DEBUGLEVEL >= 10) {
 
371
                NDR_PRINT_FUNCTION_DEBUG(NetrSendMessage, NDR_OUT | NDR_SET_VALUES, r);
 
372
        }
 
373
 
 
374
        push = ndr_push_init_ctx(r);
 
375
        if (push == NULL) {
 
376
                talloc_free(r);
 
377
                return false;
 
378
        }
 
379
 
 
380
        /*
 
381
         * carry over the pointer count to the reply in case we are
 
382
         * using full pointer. See NDR specification for full pointers
 
383
         */
 
384
        push->ptr_count = pull->ptr_count;
 
385
 
 
386
        ndr_err = call->ndr_push(push, NDR_OUT, r);
 
387
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 
388
                talloc_free(r);
 
389
                return false;
 
390
        }
 
391
 
 
392
        p->out_data.rdata = ndr_push_blob(push);
 
393
        talloc_steal(p->mem_ctx, p->out_data.rdata.data);
 
394
 
 
395
        talloc_free(r);
 
396
 
 
397
        return true;
 
398
}
 
399
 
 
400
 
 
401
/* Tables */
 
402
static struct api_struct api_msgsvcsend_cmds[] = 
 
403
{
 
404
        {"NETRSENDMESSAGE", NDR_NETRSENDMESSAGE, api_NetrSendMessage},
 
405
};
 
406
 
 
407
void msgsvcsend_get_pipe_fns(struct api_struct **fns, int *n_fns)
 
408
{
 
409
        *fns = api_msgsvcsend_cmds;
 
410
        *n_fns = sizeof(api_msgsvcsend_cmds) / sizeof(struct api_struct);
 
411
}
 
412
 
 
413
NTSTATUS rpc_msgsvcsend_init(const struct rpc_srv_callbacks *rpc_srv_cb)
 
414
{
 
415
        return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "msgsvcsend", "msgsvcsend", &ndr_table_msgsvcsend, api_msgsvcsend_cmds, sizeof(api_msgsvcsend_cmds) / sizeof(struct api_struct), rpc_srv_cb);
 
416
}
 
417
 
 
418
NTSTATUS rpc_msgsvcsend_shutdown(void)
 
419
{
 
420
        return rpc_srv_unregister(&ndr_table_msgsvcsend);
 
421
}