r18692: Dump debug data when DEBUGLEVEL >= 10
[Samba.git] / source3 / librpc / gen_ndr / srv_unixinfo.c
blob2195e7964f5bce27f3f02e7870b71a24d90a5048
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 return False;
27 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
28 status = ndr_pull_unixinfo_SidToUid(pull, NDR_IN, &r);
29 if (NT_STATUS_IS_ERR(status)) {
30 talloc_free(mem_ctx);
31 return False;
34 if (DEBUGLEVEL >= 10)
35 NDR_PRINT_IN_DEBUG(unixinfo_SidToUid, &r);
37 ZERO_STRUCT(r.out);
38 r.out.uid = talloc_size(mem_ctx, sizeof(*r.out.uid));
39 if (r.out.uid == NULL) {
40 talloc_free(mem_ctx);
41 return False;
44 r.out.result = _unixinfo_SidToUid(p, r.in.sid, r.out.uid);
46 if (DEBUGLEVEL >= 10)
47 NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid, &r);
49 push = ndr_push_init_ctx(mem_ctx);
50 if (push == NULL) {
51 talloc_free(mem_ctx);
52 return False;
55 status = ndr_push_unixinfo_SidToUid(push, NDR_OUT, &r);
56 if (NT_STATUS_IS_ERR(status)) {
57 talloc_free(mem_ctx);
58 return False;
61 blob = ndr_push_blob(push);
62 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
63 talloc_free(mem_ctx);
64 return False;
67 talloc_free(mem_ctx);
69 return True;
72 static BOOL api_unixinfo_UidToSid(pipes_struct *p)
74 struct ndr_pull *pull;
75 struct ndr_push *push;
76 NTSTATUS status;
77 DATA_BLOB blob;
78 struct unixinfo_UidToSid r;
79 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_UidToSid");
81 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
82 talloc_free(mem_ctx);
83 return False;
86 pull = ndr_pull_init_blob(&blob, mem_ctx);
87 if (pull == NULL)
88 return False;
90 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
91 status = ndr_pull_unixinfo_UidToSid(pull, NDR_IN, &r);
92 if (NT_STATUS_IS_ERR(status)) {
93 talloc_free(mem_ctx);
94 return False;
97 if (DEBUGLEVEL >= 10)
98 NDR_PRINT_IN_DEBUG(unixinfo_UidToSid, &r);
100 ZERO_STRUCT(r.out);
101 r.out.sid = talloc_size(mem_ctx, sizeof(*r.out.sid));
102 if (r.out.sid == NULL) {
103 talloc_free(mem_ctx);
104 return False;
107 r.out.result = _unixinfo_UidToSid(p, r.in.uid, r.out.sid);
109 if (DEBUGLEVEL >= 10)
110 NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid, &r);
112 push = ndr_push_init_ctx(mem_ctx);
113 if (push == NULL) {
114 talloc_free(mem_ctx);
115 return False;
118 status = ndr_push_unixinfo_UidToSid(push, NDR_OUT, &r);
119 if (NT_STATUS_IS_ERR(status)) {
120 talloc_free(mem_ctx);
121 return False;
124 blob = ndr_push_blob(push);
125 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
126 talloc_free(mem_ctx);
127 return False;
130 talloc_free(mem_ctx);
132 return True;
135 static BOOL api_unixinfo_SidToGid(pipes_struct *p)
137 struct ndr_pull *pull;
138 struct ndr_push *push;
139 NTSTATUS status;
140 DATA_BLOB blob;
141 struct unixinfo_SidToGid r;
142 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToGid");
144 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
145 talloc_free(mem_ctx);
146 return False;
149 pull = ndr_pull_init_blob(&blob, mem_ctx);
150 if (pull == NULL)
151 return False;
153 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
154 status = ndr_pull_unixinfo_SidToGid(pull, NDR_IN, &r);
155 if (NT_STATUS_IS_ERR(status)) {
156 talloc_free(mem_ctx);
157 return False;
160 if (DEBUGLEVEL >= 10)
161 NDR_PRINT_IN_DEBUG(unixinfo_SidToGid, &r);
163 ZERO_STRUCT(r.out);
164 r.out.gid = talloc_size(mem_ctx, sizeof(*r.out.gid));
165 if (r.out.gid == NULL) {
166 talloc_free(mem_ctx);
167 return False;
170 r.out.result = _unixinfo_SidToGid(p, r.in.sid, r.out.gid);
172 if (DEBUGLEVEL >= 10)
173 NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid, &r);
175 push = ndr_push_init_ctx(mem_ctx);
176 if (push == NULL) {
177 talloc_free(mem_ctx);
178 return False;
181 status = ndr_push_unixinfo_SidToGid(push, NDR_OUT, &r);
182 if (NT_STATUS_IS_ERR(status)) {
183 talloc_free(mem_ctx);
184 return False;
187 blob = ndr_push_blob(push);
188 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
189 talloc_free(mem_ctx);
190 return False;
193 talloc_free(mem_ctx);
195 return True;
198 static BOOL api_unixinfo_GidToSid(pipes_struct *p)
200 struct ndr_pull *pull;
201 struct ndr_push *push;
202 NTSTATUS status;
203 DATA_BLOB blob;
204 struct unixinfo_GidToSid r;
205 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GidToSid");
207 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
208 talloc_free(mem_ctx);
209 return False;
212 pull = ndr_pull_init_blob(&blob, mem_ctx);
213 if (pull == NULL)
214 return False;
216 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
217 status = ndr_pull_unixinfo_GidToSid(pull, NDR_IN, &r);
218 if (NT_STATUS_IS_ERR(status)) {
219 talloc_free(mem_ctx);
220 return False;
223 if (DEBUGLEVEL >= 10)
224 NDR_PRINT_IN_DEBUG(unixinfo_GidToSid, &r);
226 ZERO_STRUCT(r.out);
227 r.out.sid = talloc_size(mem_ctx, sizeof(*r.out.sid));
228 if (r.out.sid == NULL) {
229 talloc_free(mem_ctx);
230 return False;
233 r.out.result = _unixinfo_GidToSid(p, r.in.gid, r.out.sid);
235 if (DEBUGLEVEL >= 10)
236 NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid, &r);
238 push = ndr_push_init_ctx(mem_ctx);
239 if (push == NULL) {
240 talloc_free(mem_ctx);
241 return False;
244 status = ndr_push_unixinfo_GidToSid(push, NDR_OUT, &r);
245 if (NT_STATUS_IS_ERR(status)) {
246 talloc_free(mem_ctx);
247 return False;
250 blob = ndr_push_blob(push);
251 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
252 talloc_free(mem_ctx);
253 return False;
256 talloc_free(mem_ctx);
258 return True;
261 static BOOL api_unixinfo_GetPWUid(pipes_struct *p)
263 struct ndr_pull *pull;
264 struct ndr_push *push;
265 NTSTATUS status;
266 DATA_BLOB blob;
267 struct unixinfo_GetPWUid r;
268 TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GetPWUid");
270 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
271 talloc_free(mem_ctx);
272 return False;
275 pull = ndr_pull_init_blob(&blob, mem_ctx);
276 if (pull == NULL)
277 return False;
279 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
280 status = ndr_pull_unixinfo_GetPWUid(pull, NDR_IN, &r);
281 if (NT_STATUS_IS_ERR(status)) {
282 talloc_free(mem_ctx);
283 return False;
286 if (DEBUGLEVEL >= 10)
287 NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid, &r);
289 ZERO_STRUCT(r.out);
290 r.out.count = r.in.count;
291 r.out.infos = talloc_array_size(mem_ctx, sizeof(*r.out.infos), *r.in.count);
292 if (r.out.infos == NULL) {
293 talloc_free(mem_ctx);
294 return False;
297 r.out.result = _unixinfo_GetPWUid(p, r.in.count, r.in.uids, r.out.infos);
299 if (DEBUGLEVEL >= 10)
300 NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid, &r);
302 push = ndr_push_init_ctx(mem_ctx);
303 if (push == NULL) {
304 talloc_free(mem_ctx);
305 return False;
308 status = ndr_push_unixinfo_GetPWUid(push, NDR_OUT, &r);
309 if (NT_STATUS_IS_ERR(status)) {
310 talloc_free(mem_ctx);
311 return False;
314 blob = ndr_push_blob(push);
315 if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) {
316 talloc_free(mem_ctx);
317 return False;
320 talloc_free(mem_ctx);
322 return True;
326 /* Tables */
327 static struct api_struct api_unixinfo_cmds[] =
329 {"UNIXINFO_SIDTOUID", DCERPC_UNIXINFO_SIDTOUID, api_unixinfo_SidToUid},
330 {"UNIXINFO_UIDTOSID", DCERPC_UNIXINFO_UIDTOSID, api_unixinfo_UidToSid},
331 {"UNIXINFO_SIDTOGID", DCERPC_UNIXINFO_SIDTOGID, api_unixinfo_SidToGid},
332 {"UNIXINFO_GIDTOSID", DCERPC_UNIXINFO_GIDTOSID, api_unixinfo_GidToSid},
333 {"UNIXINFO_GETPWUID", DCERPC_UNIXINFO_GETPWUID, api_unixinfo_GetPWUid},
336 void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns)
338 *fns = api_unixinfo_cmds;
339 *n_fns = sizeof(api_unixinfo_cmds) / sizeof(struct api_struct);
342 NTSTATUS rpc_unixinfo_init(void)
344 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "unixinfo", "unixinfo", api_unixinfo_cmds, sizeof(api_unixinfo_cmds) / sizeof(struct api_struct));