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

« back to all changes in this revision

Viewing changes to source3/librpc/gen_ndr/ndr_unixinfo.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
/* parser auto-generated by pidl */
 
2
 
 
3
#include "includes.h"
 
4
#include "librpc/gen_ndr/ndr_unixinfo.h"
 
5
 
 
6
#include "librpc/gen_ndr/ndr_security.h"
 
7
static enum ndr_err_code ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r)
 
8
{
 
9
        if (ndr_flags & NDR_SCALARS) {
 
10
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
 
11
                NDR_CHECK(ndr_push_align(ndr, 4));
 
12
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
 
13
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
 
14
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
 
15
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
 
16
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
 
17
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
 
18
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
 
19
                NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
 
20
                NDR_CHECK(ndr_push_trailer_align(ndr, 4));
 
21
        }
 
22
        if (ndr_flags & NDR_BUFFERS) {
 
23
        }
 
24
        return NDR_ERR_SUCCESS;
 
25
}
 
26
 
 
27
static enum ndr_err_code ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r)
 
28
{
 
29
        if (ndr_flags & NDR_SCALARS) {
 
30
                NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
 
31
                NDR_CHECK(ndr_pull_align(ndr, 4));
 
32
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
 
33
                NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
 
34
                NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
 
35
                if (ndr_get_array_length(ndr, &r->homedir) > ndr_get_array_size(ndr, &r->homedir)) {
 
36
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->homedir), ndr_get_array_length(ndr, &r->homedir));
 
37
                }
 
38
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t)));
 
39
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t), CH_UTF8));
 
40
                NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
 
41
                if (ndr_get_array_length(ndr, &r->shell) > ndr_get_array_size(ndr, &r->shell)) {
 
42
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->shell), ndr_get_array_length(ndr, &r->shell));
 
43
                }
 
44
                NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t)));
 
45
                NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t), CH_UTF8));
 
46
                NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
 
47
        }
 
48
        if (ndr_flags & NDR_BUFFERS) {
 
49
        }
 
50
        return NDR_ERR_SUCCESS;
 
51
}
 
52
 
 
53
_PUBLIC_ void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r)
 
54
{
 
55
        ndr_print_struct(ndr, name, "unixinfo_GetPWUidInfo");
 
56
        if (r == NULL) { ndr_print_null(ndr); return; }
 
57
        ndr->depth++;
 
58
        ndr_print_NTSTATUS(ndr, "status", r->status);
 
59
        ndr_print_string(ndr, "homedir", r->homedir);
 
60
        ndr_print_string(ndr, "shell", r->shell);
 
61
        ndr->depth--;
 
62
}
 
63
 
 
64
static enum ndr_err_code ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r)
 
65
{
 
66
        if (flags & NDR_IN) {
 
67
                NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
 
68
        }
 
69
        if (flags & NDR_OUT) {
 
70
                if (r->out.uid == NULL) {
 
71
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 
72
                }
 
73
                NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
 
74
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
 
75
        }
 
76
        return NDR_ERR_SUCCESS;
 
77
}
 
78
 
 
79
static enum ndr_err_code ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r)
 
80
{
 
81
        TALLOC_CTX *_mem_save_uid_0;
 
82
        if (flags & NDR_IN) {
 
83
                ZERO_STRUCT(r->out);
 
84
 
 
85
                NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
 
86
                NDR_PULL_ALLOC(ndr, r->out.uid);
 
87
                ZERO_STRUCTP(r->out.uid);
 
88
        }
 
89
        if (flags & NDR_OUT) {
 
90
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 
91
                        NDR_PULL_ALLOC(ndr, r->out.uid);
 
92
                }
 
93
                _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
94
                NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
 
95
                NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
 
96
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
 
97
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
 
98
        }
 
99
        return NDR_ERR_SUCCESS;
 
100
}
 
101
 
 
102
_PUBLIC_ void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r)
 
103
{
 
104
        ndr_print_struct(ndr, name, "unixinfo_SidToUid");
 
105
        if (r == NULL) { ndr_print_null(ndr); return; }
 
106
        ndr->depth++;
 
107
        if (flags & NDR_SET_VALUES) {
 
108
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
109
        }
 
110
        if (flags & NDR_IN) {
 
111
                ndr_print_struct(ndr, "in", "unixinfo_SidToUid");
 
112
                ndr->depth++;
 
113
                ndr_print_dom_sid(ndr, "sid", &r->in.sid);
 
114
                ndr->depth--;
 
115
        }
 
116
        if (flags & NDR_OUT) {
 
117
                ndr_print_struct(ndr, "out", "unixinfo_SidToUid");
 
118
                ndr->depth++;
 
119
                ndr_print_ptr(ndr, "uid", r->out.uid);
 
120
                ndr->depth++;
 
121
                ndr_print_hyper(ndr, "uid", *r->out.uid);
 
122
                ndr->depth--;
 
123
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
 
124
                ndr->depth--;
 
125
        }
 
126
        ndr->depth--;
 
127
}
 
128
 
 
129
static enum ndr_err_code ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r)
 
130
{
 
131
        if (flags & NDR_IN) {
 
132
                NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
 
133
        }
 
134
        if (flags & NDR_OUT) {
 
135
                if (r->out.sid == NULL) {
 
136
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 
137
                }
 
138
                NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
 
139
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
 
140
        }
 
141
        return NDR_ERR_SUCCESS;
 
142
}
 
143
 
 
144
static enum ndr_err_code ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r)
 
145
{
 
146
        TALLOC_CTX *_mem_save_sid_0;
 
147
        if (flags & NDR_IN) {
 
148
                ZERO_STRUCT(r->out);
 
149
 
 
150
                NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
 
151
                NDR_PULL_ALLOC(ndr, r->out.sid);
 
152
                ZERO_STRUCTP(r->out.sid);
 
153
        }
 
154
        if (flags & NDR_OUT) {
 
155
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 
156
                        NDR_PULL_ALLOC(ndr, r->out.sid);
 
157
                }
 
158
                _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
159
                NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
 
160
                NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
 
161
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
 
162
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
 
163
        }
 
164
        return NDR_ERR_SUCCESS;
 
165
}
 
166
 
 
167
_PUBLIC_ void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r)
 
168
{
 
169
        ndr_print_struct(ndr, name, "unixinfo_UidToSid");
 
170
        if (r == NULL) { ndr_print_null(ndr); return; }
 
171
        ndr->depth++;
 
172
        if (flags & NDR_SET_VALUES) {
 
173
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
174
        }
 
175
        if (flags & NDR_IN) {
 
176
                ndr_print_struct(ndr, "in", "unixinfo_UidToSid");
 
177
                ndr->depth++;
 
178
                ndr_print_hyper(ndr, "uid", r->in.uid);
 
179
                ndr->depth--;
 
180
        }
 
181
        if (flags & NDR_OUT) {
 
182
                ndr_print_struct(ndr, "out", "unixinfo_UidToSid");
 
183
                ndr->depth++;
 
184
                ndr_print_ptr(ndr, "sid", r->out.sid);
 
185
                ndr->depth++;
 
186
                ndr_print_dom_sid(ndr, "sid", r->out.sid);
 
187
                ndr->depth--;
 
188
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
 
189
                ndr->depth--;
 
190
        }
 
191
        ndr->depth--;
 
192
}
 
193
 
 
194
static enum ndr_err_code ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r)
 
195
{
 
196
        if (flags & NDR_IN) {
 
197
                NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
 
198
        }
 
199
        if (flags & NDR_OUT) {
 
200
                if (r->out.gid == NULL) {
 
201
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 
202
                }
 
203
                NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
 
204
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
 
205
        }
 
206
        return NDR_ERR_SUCCESS;
 
207
}
 
208
 
 
209
static enum ndr_err_code ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r)
 
210
{
 
211
        TALLOC_CTX *_mem_save_gid_0;
 
212
        if (flags & NDR_IN) {
 
213
                ZERO_STRUCT(r->out);
 
214
 
 
215
                NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->in.sid));
 
216
                NDR_PULL_ALLOC(ndr, r->out.gid);
 
217
                ZERO_STRUCTP(r->out.gid);
 
218
        }
 
219
        if (flags & NDR_OUT) {
 
220
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 
221
                        NDR_PULL_ALLOC(ndr, r->out.gid);
 
222
                }
 
223
                _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
224
                NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
 
225
                NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
 
226
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
 
227
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
 
228
        }
 
229
        return NDR_ERR_SUCCESS;
 
230
}
 
231
 
 
232
_PUBLIC_ void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r)
 
233
{
 
234
        ndr_print_struct(ndr, name, "unixinfo_SidToGid");
 
235
        if (r == NULL) { ndr_print_null(ndr); return; }
 
236
        ndr->depth++;
 
237
        if (flags & NDR_SET_VALUES) {
 
238
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
239
        }
 
240
        if (flags & NDR_IN) {
 
241
                ndr_print_struct(ndr, "in", "unixinfo_SidToGid");
 
242
                ndr->depth++;
 
243
                ndr_print_dom_sid(ndr, "sid", &r->in.sid);
 
244
                ndr->depth--;
 
245
        }
 
246
        if (flags & NDR_OUT) {
 
247
                ndr_print_struct(ndr, "out", "unixinfo_SidToGid");
 
248
                ndr->depth++;
 
249
                ndr_print_ptr(ndr, "gid", r->out.gid);
 
250
                ndr->depth++;
 
251
                ndr_print_hyper(ndr, "gid", *r->out.gid);
 
252
                ndr->depth--;
 
253
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
 
254
                ndr->depth--;
 
255
        }
 
256
        ndr->depth--;
 
257
}
 
258
 
 
259
static enum ndr_err_code ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r)
 
260
{
 
261
        if (flags & NDR_IN) {
 
262
                NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
 
263
        }
 
264
        if (flags & NDR_OUT) {
 
265
                if (r->out.sid == NULL) {
 
266
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 
267
                }
 
268
                NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
 
269
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
 
270
        }
 
271
        return NDR_ERR_SUCCESS;
 
272
}
 
273
 
 
274
static enum ndr_err_code ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r)
 
275
{
 
276
        TALLOC_CTX *_mem_save_sid_0;
 
277
        if (flags & NDR_IN) {
 
278
                ZERO_STRUCT(r->out);
 
279
 
 
280
                NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
 
281
                NDR_PULL_ALLOC(ndr, r->out.sid);
 
282
                ZERO_STRUCTP(r->out.sid);
 
283
        }
 
284
        if (flags & NDR_OUT) {
 
285
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 
286
                        NDR_PULL_ALLOC(ndr, r->out.sid);
 
287
                }
 
288
                _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
289
                NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
 
290
                NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
 
291
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
 
292
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
 
293
        }
 
294
        return NDR_ERR_SUCCESS;
 
295
}
 
296
 
 
297
_PUBLIC_ void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r)
 
298
{
 
299
        ndr_print_struct(ndr, name, "unixinfo_GidToSid");
 
300
        if (r == NULL) { ndr_print_null(ndr); return; }
 
301
        ndr->depth++;
 
302
        if (flags & NDR_SET_VALUES) {
 
303
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
304
        }
 
305
        if (flags & NDR_IN) {
 
306
                ndr_print_struct(ndr, "in", "unixinfo_GidToSid");
 
307
                ndr->depth++;
 
308
                ndr_print_hyper(ndr, "gid", r->in.gid);
 
309
                ndr->depth--;
 
310
        }
 
311
        if (flags & NDR_OUT) {
 
312
                ndr_print_struct(ndr, "out", "unixinfo_GidToSid");
 
313
                ndr->depth++;
 
314
                ndr_print_ptr(ndr, "sid", r->out.sid);
 
315
                ndr->depth++;
 
316
                ndr_print_dom_sid(ndr, "sid", r->out.sid);
 
317
                ndr->depth--;
 
318
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
 
319
                ndr->depth--;
 
320
        }
 
321
        ndr->depth--;
 
322
}
 
323
 
 
324
static enum ndr_err_code ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r)
 
325
{
 
326
        uint32_t cntr_uids_0;
 
327
        uint32_t cntr_infos_0;
 
328
        if (flags & NDR_IN) {
 
329
                if (r->in.count == NULL) {
 
330
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 
331
                }
 
332
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
 
333
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, *r->in.count));
 
334
                for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
 
335
                        NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uids[cntr_uids_0]));
 
336
                }
 
337
        }
 
338
        if (flags & NDR_OUT) {
 
339
                if (r->out.count == NULL) {
 
340
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 
341
                }
 
342
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
 
343
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, *r->out.count));
 
344
                for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) {
 
345
                        NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0]));
 
346
                }
 
347
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
 
348
        }
 
349
        return NDR_ERR_SUCCESS;
 
350
}
 
351
 
 
352
static enum ndr_err_code ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r)
 
353
{
 
354
        uint32_t cntr_uids_0;
 
355
        uint32_t cntr_infos_0;
 
356
        TALLOC_CTX *_mem_save_count_0;
 
357
        TALLOC_CTX *_mem_save_uids_0;
 
358
        TALLOC_CTX *_mem_save_infos_0;
 
359
        if (flags & NDR_IN) {
 
360
                ZERO_STRUCT(r->out);
 
361
 
 
362
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 
363
                        NDR_PULL_ALLOC(ndr, r->in.count);
 
364
                }
 
365
                _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
366
                NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
 
367
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
 
368
                if (*r->in.count > 1023) {
 
369
                        return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
 
370
                }
 
371
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
 
372
                NDR_CHECK(ndr_pull_array_size(ndr, &r->in.uids));
 
373
                NDR_PULL_ALLOC_N(ndr, r->in.uids, ndr_get_array_size(ndr, &r->in.uids));
 
374
                _mem_save_uids_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
375
                NDR_PULL_SET_MEM_CTX(ndr, r->in.uids, 0);
 
376
                for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
 
377
                        NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uids[cntr_uids_0]));
 
378
                }
 
379
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uids_0, 0);
 
380
                NDR_PULL_ALLOC(ndr, r->out.count);
 
381
                *r->out.count = *r->in.count;
 
382
                if (r->in.uids) {
 
383
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count));
 
384
                }
 
385
        }
 
386
        if (flags & NDR_OUT) {
 
387
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 
388
                        NDR_PULL_ALLOC(ndr, r->out.count);
 
389
                }
 
390
                _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
391
                NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
 
392
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
 
393
                if (*r->out.count > 1023) {
 
394
                        return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
 
395
                }
 
396
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
 
397
                NDR_CHECK(ndr_pull_array_size(ndr, &r->out.infos));
 
398
                NDR_PULL_ALLOC_N(ndr, r->out.infos, ndr_get_array_size(ndr, &r->out.infos));
 
399
                _mem_save_infos_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
400
                NDR_PULL_SET_MEM_CTX(ndr, r->out.infos, 0);
 
401
                for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) {
 
402
                        NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0]));
 
403
                }
 
404
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_0, 0);
 
405
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
 
406
                if (r->out.infos) {
 
407
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count));
 
408
                }
 
409
        }
 
410
        return NDR_ERR_SUCCESS;
 
411
}
 
412
 
 
413
_PUBLIC_ void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r)
 
414
{
 
415
        uint32_t cntr_uids_0;
 
416
        uint32_t cntr_infos_0;
 
417
        ndr_print_struct(ndr, name, "unixinfo_GetPWUid");
 
418
        if (r == NULL) { ndr_print_null(ndr); return; }
 
419
        ndr->depth++;
 
420
        if (flags & NDR_SET_VALUES) {
 
421
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
422
        }
 
423
        if (flags & NDR_IN) {
 
424
                ndr_print_struct(ndr, "in", "unixinfo_GetPWUid");
 
425
                ndr->depth++;
 
426
                ndr_print_ptr(ndr, "count", r->in.count);
 
427
                ndr->depth++;
 
428
                ndr_print_uint32(ndr, "count", *r->in.count);
 
429
                ndr->depth--;
 
430
                ndr->print(ndr, "%s: ARRAY(%d)", "uids", (int)*r->in.count);
 
431
                ndr->depth++;
 
432
                for (cntr_uids_0=0;cntr_uids_0<*r->in.count;cntr_uids_0++) {
 
433
                        ndr_print_hyper(ndr, "uids", r->in.uids[cntr_uids_0]);
 
434
                }
 
435
                ndr->depth--;
 
436
                ndr->depth--;
 
437
        }
 
438
        if (flags & NDR_OUT) {
 
439
                ndr_print_struct(ndr, "out", "unixinfo_GetPWUid");
 
440
                ndr->depth++;
 
441
                ndr_print_ptr(ndr, "count", r->out.count);
 
442
                ndr->depth++;
 
443
                ndr_print_uint32(ndr, "count", *r->out.count);
 
444
                ndr->depth--;
 
445
                ndr->print(ndr, "%s: ARRAY(%d)", "infos", (int)*r->out.count);
 
446
                ndr->depth++;
 
447
                for (cntr_infos_0=0;cntr_infos_0<*r->out.count;cntr_infos_0++) {
 
448
                        ndr_print_unixinfo_GetPWUidInfo(ndr, "infos", &r->out.infos[cntr_infos_0]);
 
449
                }
 
450
                ndr->depth--;
 
451
                ndr_print_NTSTATUS(ndr, "result", r->out.result);
 
452
                ndr->depth--;
 
453
        }
 
454
        ndr->depth--;
 
455
}
 
456
 
 
457
static const struct ndr_interface_call unixinfo_calls[] = {
 
458
        {
 
459
                "unixinfo_SidToUid",
 
460
                sizeof(struct unixinfo_SidToUid),
 
461
                (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToUid,
 
462
                (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToUid,
 
463
                (ndr_print_function_t) ndr_print_unixinfo_SidToUid,
 
464
                { 0, NULL },
 
465
                { 0, NULL },
 
466
        },
 
467
        {
 
468
                "unixinfo_UidToSid",
 
469
                sizeof(struct unixinfo_UidToSid),
 
470
                (ndr_push_flags_fn_t) ndr_push_unixinfo_UidToSid,
 
471
                (ndr_pull_flags_fn_t) ndr_pull_unixinfo_UidToSid,
 
472
                (ndr_print_function_t) ndr_print_unixinfo_UidToSid,
 
473
                { 0, NULL },
 
474
                { 0, NULL },
 
475
        },
 
476
        {
 
477
                "unixinfo_SidToGid",
 
478
                sizeof(struct unixinfo_SidToGid),
 
479
                (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToGid,
 
480
                (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToGid,
 
481
                (ndr_print_function_t) ndr_print_unixinfo_SidToGid,
 
482
                { 0, NULL },
 
483
                { 0, NULL },
 
484
        },
 
485
        {
 
486
                "unixinfo_GidToSid",
 
487
                sizeof(struct unixinfo_GidToSid),
 
488
                (ndr_push_flags_fn_t) ndr_push_unixinfo_GidToSid,
 
489
                (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GidToSid,
 
490
                (ndr_print_function_t) ndr_print_unixinfo_GidToSid,
 
491
                { 0, NULL },
 
492
                { 0, NULL },
 
493
        },
 
494
        {
 
495
                "unixinfo_GetPWUid",
 
496
                sizeof(struct unixinfo_GetPWUid),
 
497
                (ndr_push_flags_fn_t) ndr_push_unixinfo_GetPWUid,
 
498
                (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GetPWUid,
 
499
                (ndr_print_function_t) ndr_print_unixinfo_GetPWUid,
 
500
                { 0, NULL },
 
501
                { 0, NULL },
 
502
        },
 
503
        { NULL, 0, NULL, NULL, NULL }
 
504
};
 
505
 
 
506
static const char * const unixinfo_endpoint_strings[] = {
 
507
        "ncacn_np:[\\pipe\\unixinfo]", 
 
508
        "ncacn_ip_tcp:", 
 
509
        "ncalrpc:", 
 
510
};
 
511
 
 
512
static const struct ndr_interface_string_array unixinfo_endpoints = {
 
513
        .count  = 3,
 
514
        .names  = unixinfo_endpoint_strings
 
515
};
 
516
 
 
517
static const char * const unixinfo_authservice_strings[] = {
 
518
        "host", 
 
519
};
 
520
 
 
521
static const struct ndr_interface_string_array unixinfo_authservices = {
 
522
        .count  = 1,
 
523
        .names  = unixinfo_authservice_strings
 
524
};
 
525
 
 
526
 
 
527
const struct ndr_interface_table ndr_table_unixinfo = {
 
528
        .name           = "unixinfo",
 
529
        .syntax_id      = {
 
530
                {0x9c54e310,0xa955,0x4885,{0xbd,0x31},{0x78,0x78,0x71,0x47,0xdf,0xa6}},
 
531
                NDR_UNIXINFO_VERSION
 
532
        },
 
533
        .helpstring     = NDR_UNIXINFO_HELPSTRING,
 
534
        .num_calls      = 5,
 
535
        .calls          = unixinfo_calls,
 
536
        .endpoints      = &unixinfo_endpoints,
 
537
        .authservices   = &unixinfo_authservices
 
538
};
 
539