summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr/srv_wbint.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-09-06 14:47:06 +0200
committerVolker Lendecke <vl@samba.org>2009-09-07 01:28:32 +0200
commit7159060450e4d5cd3d71e6a5c7837dcd648a6220 (patch)
tree84b5b2c3514d472cc32555682864bf24327cdf70 /source3/librpc/gen_ndr/srv_wbint.c
parentd9b7fd59b026fbad11263e8a018d654325ede0e4 (diff)
downloadsamba-7159060450e4d5cd3d71e6a5c7837dcd648a6220.tar.gz
samba-7159060450e4d5cd3d71e6a5c7837dcd648a6220.tar.bz2
samba-7159060450e4d5cd3d71e6a5c7837dcd648a6220.zip
s3:winbind: Convert WINBINDD_SET_MAPPING to the new API
Diffstat (limited to 'source3/librpc/gen_ndr/srv_wbint.c')
-rw-r--r--source3/librpc/gen_ndr/srv_wbint.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c
index a55a9a7145..e55d19cd0f 100644
--- a/source3/librpc/gen_ndr/srv_wbint.c
+++ b/source3/librpc/gen_ndr/srv_wbint.c
@@ -1537,6 +1537,79 @@ static bool api_wbint_CheckMachineAccount(pipes_struct *p)
return true;
}
+static bool api_wbint_SetMapping(pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ DATA_BLOB blob;
+ struct wbint_SetMapping *r;
+
+ call = &ndr_table_wbint.calls[NDR_WBINT_SETMAPPING];
+
+ r = talloc(talloc_tos(), struct wbint_SetMapping);
+ if (r == NULL) {
+ return false;
+ }
+
+ if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&blob, r, NULL);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(wbint_SetMapping, r);
+ }
+
+ r->out.result = _wbint_SetMapping(p, r);
+
+ if (p->rng_fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(wbint_SetMapping, r);
+ }
+
+ push = ndr_push_init_ctx(r, NULL);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ blob = ndr_push_blob(push);
+ if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+ talloc_free(r);
+ return false;
+ }
+
+ talloc_free(r);
+
+ return true;
+}
+
/* Tables */
static struct api_struct api_wbint_cmds[] =
@@ -1560,6 +1633,7 @@ static struct api_struct api_wbint_cmds[] =
{"WBINT_DSGETDCNAME", NDR_WBINT_DSGETDCNAME, api_wbint_DsGetDcName},
{"WBINT_LOOKUPRIDS", NDR_WBINT_LOOKUPRIDS, api_wbint_LookupRids},
{"WBINT_CHECKMACHINEACCOUNT", NDR_WBINT_CHECKMACHINEACCOUNT, api_wbint_CheckMachineAccount},
+ {"WBINT_SETMAPPING", NDR_WBINT_SETMAPPING, api_wbint_SetMapping},
};
void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns)
@@ -1813,6 +1887,12 @@ NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, co
return NT_STATUS_OK;
}
+ case NDR_WBINT_SETMAPPING: {
+ struct wbint_SetMapping *r = (struct wbint_SetMapping *)_r;
+ r->out.result = _wbint_SetMapping(cli->pipes_struct, r);
+ return NT_STATUS_OK;
+ }
+
default:
return NT_STATUS_NOT_IMPLEMENTED;
}