r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / srv_unixinfo.c
blob3fbe8158707b48728c35d16be09152674a64d1ad
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_unixinfo.h"
9 static BOOL api_unixinfo_SidToUid(pipes_struct *p)
11 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct unixinfo_SidToUid r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToUid");
18 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19 talloc_free(mem_ctx);
20 return False;
23 pull = ndr_pull_init_blob(&blob, mem_ctx);
24 if (pull == NULL) {
25 talloc_free(mem_ctx);
26 return False;
29 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
30 status = ndr_pull_unixinfo_SidToUid(pull, NDR_IN, &r);
31 if (NT_STATUS_IS_ERR(status)) {
32 talloc_free(mem_ctx);
33 return False;
36 if (DEBUGLEVEL >= 10)
37 NDR_PRINT_IN_DEBUG(unixinfo_SidToUid, &r);
39 ZERO_STRUCT(r.out);
40 r.out.uid = talloc_zero(mem_ctx, uint64_t);
41 if (r.out.uid == NULL) {
42 talloc_free(mem_ctx);
43 return False;
46 r.out.result = _unixinfo_SidToUid(p, &r);
48 if (p->rng_fault_state) {
49 talloc_free(mem_ctx);
50 /* Return True here, srv_pipe_hnd.c will take care */
51 return True;
54 if (DEBUGLEVEL >= 10)
55 NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid, &r);
57 push = ndr_push_init_ctx(mem_ctx);
58 if (push == NULL) {
59 talloc_free(mem_ctx);
60 return False;
63 status = ndr_push_unixinfo_SidToUid(push, NDR_OUT, &r);
64 if (NT_STATUS_IS_ERR(status)) {
65 talloc_free(mem_ctx);
66 return False;
69 blob = ndr_push_blob(push);
70 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
71 talloc_free(mem_ctx);
72 return False;
75 talloc_free(mem_ctx);
77 return True;
80 static BOOL api_unixinfo_UidToSid(pipes_struct *p)
82 struct ndr_pull *pull;
83 struct ndr_push *push;
84 NTSTATUS status;
85 DATA_BLOB blob;
86 struct unixinfo_UidToSid r;
87 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_UidToSid");
89 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
90 talloc_free(mem_ctx);
91 return False;
94 pull = ndr_pull_init_blob(&blob, mem_ctx);
95 if (pull == NULL) {
96 talloc_free(mem_ctx);
97 return False;
100 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
101 status = ndr_pull_unixinfo_UidToSid(pull, NDR_IN, &r);
102 if (NT_STATUS_IS_ERR(status)) {
103 talloc_free(mem_ctx);
104 return False;
107 if (DEBUGLEVEL >= 10)
108 NDR_PRINT_IN_DEBUG(unixinfo_UidToSid, &r);
110 ZERO_STRUCT(r.out);
111 r.out.sid = talloc_zero(mem_ctx, struct dom_sid);
112 if (r.out.sid == NULL) {
113 talloc_free(mem_ctx);
114 return False;
117 r.out.result = _unixinfo_UidToSid(p, &r);
119 if (p->rng_fault_state) {
120 talloc_free(mem_ctx);
121 /* Return True here, srv_pipe_hnd.c will take care */
122 return True;
125 if (DEBUGLEVEL >= 10)
126 NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid, &r);
128 push = ndr_push_init_ctx(mem_ctx);
129 if (push == NULL) {
130 talloc_free(mem_ctx);
131 return False;
134 status = ndr_push_unixinfo_UidToSid(push, NDR_OUT, &r);
135 if (NT_STATUS_IS_ERR(status)) {
136 talloc_free(mem_ctx);
137 return False;
140 blob = ndr_push_blob(push);
141 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
142 talloc_free(mem_ctx);
143 return False;
146 talloc_free(mem_ctx);
148 return True;
151 static BOOL api_unixinfo_SidToGid(pipes_struct *p)
153 struct ndr_pull *pull;
154 struct ndr_push *push;
155 NTSTATUS status;
156 DATA_BLOB blob;
157 struct unixinfo_SidToGid r;
158 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToGid");
160 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
161 talloc_free(mem_ctx);
162 return False;
165 pull = ndr_pull_init_blob(&blob, mem_ctx);
166 if (pull == NULL) {
167 talloc_free(mem_ctx);
168 return False;
171 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
172 status = ndr_pull_unixinfo_SidToGid(pull, NDR_IN, &r);
173 if (NT_STATUS_IS_ERR(status)) {
174 talloc_free(mem_ctx);
175 return False;
178 if (DEBUGLEVEL >= 10)
179 NDR_PRINT_IN_DEBUG(unixinfo_SidToGid, &r);
181 ZERO_STRUCT(r.out);
182 r.out.gid = talloc_zero(mem_ctx, uint64_t);
183 if (r.out.gid == NULL) {
184 talloc_free(mem_ctx);
185 return False;
188 r.out.result = _unixinfo_SidToGid(p, &r);
190 if (p->rng_fault_state) {
191 talloc_free(mem_ctx);
192 /* Return True here, srv_pipe_hnd.c will take care */
193 return True;
196 if (DEBUGLEVEL >= 10)
197 NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid, &r);
199 push = ndr_push_init_ctx(mem_ctx);
200 if (push == NULL) {
201 talloc_free(mem_ctx);
202 return False;
205 status = ndr_push_unixinfo_SidToGid(push, NDR_OUT, &r);
206 if (NT_STATUS_IS_ERR(status)) {
207 talloc_free(mem_ctx);
208 return False;
211 blob = ndr_push_blob(push);
212 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
213 talloc_free(mem_ctx);
214 return False;
217 talloc_free(mem_ctx);
219 return True;
222 static BOOL api_unixinfo_GidToSid(pipes_struct *p)
224 struct ndr_pull *pull;
225 struct ndr_push *push;
226 NTSTATUS status;
227 DATA_BLOB blob;
228 struct unixinfo_GidToSid r;
229 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GidToSid");
231 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
232 talloc_free(mem_ctx);
233 return False;
236 pull = ndr_pull_init_blob(&blob, mem_ctx);
237 if (pull == NULL) {
238 talloc_free(mem_ctx);
239 return False;
242 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
243 status = ndr_pull_unixinfo_GidToSid(pull, NDR_IN, &r);
244 if (NT_STATUS_IS_ERR(status)) {
245 talloc_free(mem_ctx);
246 return False;
249 if (DEBUGLEVEL >= 10)
250 NDR_PRINT_IN_DEBUG(unixinfo_GidToSid, &r);
252 ZERO_STRUCT(r.out);
253 r.out.sid = talloc_zero(mem_ctx, struct dom_sid);
254 if (r.out.sid == NULL) {
255 talloc_free(mem_ctx);
256 return False;
259 r.out.result = _unixinfo_GidToSid(p, &r);
261 if (p->rng_fault_state) {
262 talloc_free(mem_ctx);
263 /* Return True here, srv_pipe_hnd.c will take care */
264 return True;
267 if (DEBUGLEVEL >= 10)
268 NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid, &r);
270 push = ndr_push_init_ctx(mem_ctx);
271 if (push == NULL) {
272 talloc_free(mem_ctx);
273 return False;
276 status = ndr_push_unixinfo_GidToSid(push, NDR_OUT, &r);
277 if (NT_STATUS_IS_ERR(status)) {
278 talloc_free(mem_ctx);
279 return False;
282 blob = ndr_push_blob(push);
283 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
284 talloc_free(mem_ctx);
285 return False;
288 talloc_free(mem_ctx);
290 return True;
293 static BOOL api_unixinfo_GetPWUid(pipes_struct *p)
295 struct ndr_pull *pull;
296 struct ndr_push *push;
297 NTSTATUS status;
298 DATA_BLOB blob;
299 struct unixinfo_GetPWUid r;
300 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GetPWUid");
302 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
303 talloc_free(mem_ctx);
304 return False;
307 pull = ndr_pull_init_blob(&blob, mem_ctx);
308 if (pull == NULL) {
309 talloc_free(mem_ctx);
310 return False;
313 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
314 status = ndr_pull_unixinfo_GetPWUid(pull, NDR_IN, &r);
315 if (NT_STATUS_IS_ERR(status)) {
316 talloc_free(mem_ctx);
317 return False;
320 if (DEBUGLEVEL >= 10)
321 NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid, &r);
323 ZERO_STRUCT(r.out);
324 r.out.count = r.in.count;
325 r.out.infos = talloc_zero_array(mem_ctx, struct unixinfo_GetPWUidInfo, *r.in.count);
326 if (r.out.infos == NULL) {
327 talloc_free(mem_ctx);
328 return False;
331 r.out.result = _unixinfo_GetPWUid(p, &r);
333 if (p->rng_fault_state) {
334 talloc_free(mem_ctx);
335 /* Return True here, srv_pipe_hnd.c will take care */
336 return True;
339 if (DEBUGLEVEL >= 10)
340 NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid, &r);
342 push = ndr_push_init_ctx(mem_ctx);
343 if (push == NULL) {
344 talloc_free(mem_ctx);
345 return False;
348 status = ndr_push_unixinfo_GetPWUid(push, NDR_OUT, &r);
349 if (NT_STATUS_IS_ERR(status)) {
350 talloc_free(mem_ctx);
351 return False;
354 blob = ndr_push_blob(push);
355 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
356 talloc_free(mem_ctx);
357 return False;
360 talloc_free(mem_ctx);
362 return True;
366 /* Tables */
367 static struct api_struct api_unixinfo_cmds[] =
369 {"UNIXINFO_SIDTOUID", DCERPC_UNIXINFO_SIDTOUID, api_unixinfo_SidToUid},
370 {"UNIXINFO_UIDTOSID", DCERPC_UNIXINFO_UIDTOSID, api_unixinfo_UidToSid},
371 {"UNIXINFO_SIDTOGID", DCERPC_UNIXINFO_SIDTOGID, api_unixinfo_SidToGid},
372 {"UNIXINFO_GIDTOSID", DCERPC_UNIXINFO_GIDTOSID, api_unixinfo_GidToSid},
373 {"UNIXINFO_GETPWUID", DCERPC_UNIXINFO_GETPWUID, api_unixinfo_GetPWUid},
376 void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns)
378 *fns = api_unixinfo_cmds;
379 *n_fns = sizeof(api_unixinfo_cmds) / sizeof(struct api_struct);
382 NTSTATUS rpc_unixinfo_init(void)
384 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "unixinfo", "unixinfo", api_unixinfo_cmds, sizeof(api_unixinfo_cmds) / sizeof(struct api_struct));