diff options
author | Volker Lendecke <vl@samba.org> | 2009-08-04 16:07:01 -0400 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-08-05 03:21:25 -0400 |
commit | 1dc1ac00512a28bdc025b00fbfa676b0f5b15751 (patch) | |
tree | 5f84b6351c3fb3f8a1248bc8bdf4d792dbb95a43 /source3/librpc/gen_ndr/srv_wbint.c | |
parent | 718a26fd29036cc200cdc1c320733eafe84d2337 (diff) | |
download | samba-1dc1ac00512a28bdc025b00fbfa676b0f5b15751.tar.gz samba-1dc1ac00512a28bdc025b00fbfa676b0f5b15751.tar.bz2 samba-1dc1ac00512a28bdc025b00fbfa676b0f5b15751.zip |
s3:winbind: Add async wb_lookupusergroups
Diffstat (limited to 'source3/librpc/gen_ndr/srv_wbint.c')
-rw-r--r-- | source3/librpc/gen_ndr/srv_wbint.c | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c index 19d2d2eabf..95c0619058 100644 --- a/source3/librpc/gen_ndr/srv_wbint.c +++ b/source3/librpc/gen_ndr/srv_wbint.c @@ -744,6 +744,86 @@ static bool api_wbint_LookupUserAliases(pipes_struct *p) return true; } +static bool api_wbint_LookupUserGroups(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_LookupUserGroups *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERGROUPS]; + + r = talloc(talloc_tos(), struct wbint_LookupUserGroups); + 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_LookupUserGroups, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = talloc_zero(r, struct wbint_SidArray); + if (r->out.sids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_LookupUserGroups(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_LookupUserGroups, 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[] = @@ -757,6 +837,7 @@ static struct api_struct api_wbint_cmds[] = {"WBINT_GID2SID", NDR_WBINT_GID2SID, api_wbint_Gid2Sid}, {"WBINT_QUERYUSER", NDR_WBINT_QUERYUSER, api_wbint_QueryUser}, {"WBINT_LOOKUPUSERALIASES", NDR_WBINT_LOOKUPUSERALIASES, api_wbint_LookupUserAliases}, + {"WBINT_LOOKUPUSERGROUPS", NDR_WBINT_LOOKUPUSERGROUPS, api_wbint_LookupUserGroups}, }; void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns) @@ -896,6 +977,18 @@ NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, co return NT_STATUS_OK; } + case NDR_WBINT_LOOKUPUSERGROUPS: { + struct wbint_LookupUserGroups *r = (struct wbint_LookupUserGroups *)_r; + ZERO_STRUCT(r->out); + r->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray); + if (r->out.sids == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_LookupUserGroups(cli->pipes_struct, r); + return NT_STATUS_OK; + } + default: return NT_STATUS_NOT_IMPLEMENTED; } |