diff options
Diffstat (limited to 'source3/librpc')
-rw-r--r-- | source3/librpc/gen_ndr/cli_wbint.c | 1647 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_wbint.h | 141 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_wbint.c | 1405 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_wbint.h | 54 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_wbint.c | 1000 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_wbint.h | 27 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/wbint.h | 169 | ||||
-rw-r--r-- | source3/librpc/idl/wbint.idl | 91 |
8 files changed, 4534 insertions, 0 deletions
diff --git a/source3/librpc/gen_ndr/cli_wbint.c b/source3/librpc/gen_ndr/cli_wbint.c new file mode 100644 index 0000000000..de6b345a0e --- /dev/null +++ b/source3/librpc/gen_ndr/cli_wbint.c @@ -0,0 +1,1647 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_wbint.h" + +struct rpccli_wbint_Ping_state { + struct wbint_Ping orig; + struct wbint_Ping tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_Ping_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + uint32_t _in_data /* [in] */, + uint32_t *_out_data /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_Ping_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_Ping_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.in_data = _in_data; + + /* Out parameters */ + state->orig.out.out_data = _out_data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Ping, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_Ping_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_PING, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_Ping_done, req); + return req; +} + +static void rpccli_wbint_Ping_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_Ping_state *state = tevent_req_data( + req, struct rpccli_wbint_Ping_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.out_data = *state->tmp.out.out_data; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Ping, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_Ping_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx) +{ + struct rpccli_wbint_Ping_state *state = tevent_req_data( + req, struct rpccli_wbint_Ping_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t in_data /* [in] */, + uint32_t *out_data /* [out] [ref] */) +{ + struct wbint_Ping r; + NTSTATUS status; + + /* In parameters */ + r.in.in_data = in_data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Ping, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_PING, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Ping, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *out_data = *r.out.out_data; + + /* Return result */ + return NT_STATUS_OK; +} + +struct rpccli_wbint_LookupSid_state { + struct wbint_LookupSid orig; + struct wbint_LookupSid tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct dom_sid *_sid /* [in] [ref] */, + enum lsa_SidType *_type /* [out] [ref] */, + const char **_domain /* [out] [ref,charset(UTF8)] */, + const char **_name /* [out] [ref,charset(UTF8)] */) +{ + struct tevent_req *req; + struct rpccli_wbint_LookupSid_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_LookupSid_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.sid = _sid; + + /* Out parameters */ + state->orig.out.type = _type; + state->orig.out.domain = _domain; + state->orig.out.name = _name; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupSid, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_LookupSid_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_LOOKUPSID, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_LookupSid_done, req); + return req; +} + +static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_LookupSid_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupSid_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.type = *state->tmp.out.type; + *state->orig.out.domain = *state->tmp.out.domain; + *state->orig.out.name = *state->tmp.out.name; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_LookupSid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_LookupSid_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupSid_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct dom_sid *sid /* [in] [ref] */, + enum lsa_SidType *type /* [out] [ref] */, + const char **domain /* [out] [ref,charset(UTF8)] */, + const char **name /* [out] [ref,charset(UTF8)] */) +{ + struct wbint_LookupSid r; + NTSTATUS status; + + /* In parameters */ + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupSid, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_LOOKUPSID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *type = *r.out.type; + *domain = *r.out.domain; + *name = *r.out.name; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_LookupName_state { + struct wbint_LookupName orig; + struct wbint_LookupName tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_LookupName_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_domain /* [in] [ref,charset(UTF8)] */, + const char *_name /* [in] [ref,charset(UTF8)] */, + uint32_t _flags /* [in] */, + enum lsa_SidType *_type /* [out] [ref] */, + struct dom_sid *_sid /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_LookupName_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_LookupName_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.domain = _domain; + state->orig.in.name = _name; + state->orig.in.flags = _flags; + + /* Out parameters */ + state->orig.out.type = _type; + state->orig.out.sid = _sid; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupName, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_LookupName_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_LOOKUPNAME, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_LookupName_done, req); + return req; +} + +static void rpccli_wbint_LookupName_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_LookupName_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupName_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.type = *state->tmp.out.type; + *state->orig.out.sid = *state->tmp.out.sid; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupName, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_LookupName_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_LookupName_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupName_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *domain /* [in] [ref,charset(UTF8)] */, + const char *name /* [in] [ref,charset(UTF8)] */, + uint32_t flags /* [in] */, + enum lsa_SidType *type /* [out] [ref] */, + struct dom_sid *sid /* [out] [ref] */) +{ + struct wbint_LookupName r; + NTSTATUS status; + + /* In parameters */ + r.in.domain = domain; + r.in.name = name; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupName, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_LOOKUPNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *type = *r.out.type; + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_Sid2Uid_state { + struct wbint_Sid2Uid orig; + struct wbint_Sid2Uid tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *_sid /* [in] [ref] */, + uint64_t *_uid /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_Sid2Uid_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_Sid2Uid_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.dom_name = _dom_name; + state->orig.in.sid = _sid; + + /* Out parameters */ + state->orig.out.uid = _uid; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_Sid2Uid_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_SID2UID, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_Sid2Uid_done, req); + return req; +} + +static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data( + req, struct rpccli_wbint_Sid2Uid_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.uid = *state->tmp.out.uid; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_Sid2Uid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data( + req, struct rpccli_wbint_Sid2Uid_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *sid /* [in] [ref] */, + uint64_t *uid /* [out] [ref] */) +{ + struct wbint_Sid2Uid r; + NTSTATUS status; + + /* In parameters */ + r.in.dom_name = dom_name; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_SID2UID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *uid = *r.out.uid; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_Sid2Gid_state { + struct wbint_Sid2Gid orig; + struct wbint_Sid2Gid tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *_sid /* [in] [ref] */, + uint64_t *_gid /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_Sid2Gid_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_Sid2Gid_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.dom_name = _dom_name; + state->orig.in.sid = _sid; + + /* Out parameters */ + state->orig.out.gid = _gid; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_Sid2Gid_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_SID2GID, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_Sid2Gid_done, req); + return req; +} + +static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data( + req, struct rpccli_wbint_Sid2Gid_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.gid = *state->tmp.out.gid; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_Sid2Gid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data( + req, struct rpccli_wbint_Sid2Gid_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *sid /* [in] [ref] */, + uint64_t *gid /* [out] [ref] */) +{ + struct wbint_Sid2Gid r; + NTSTATUS status; + + /* In parameters */ + r.in.dom_name = dom_name; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_SID2GID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *gid = *r.out.gid; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_Uid2Sid_state { + struct wbint_Uid2Sid orig; + struct wbint_Uid2Sid tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t _uid /* [in] */, + struct dom_sid *_sid /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_Uid2Sid_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_Uid2Sid_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.dom_name = _dom_name; + state->orig.in.uid = _uid; + + /* Out parameters */ + state->orig.out.sid = _sid; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_Uid2Sid_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_UID2SID, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_Uid2Sid_done, req); + return req; +} + +static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data( + req, struct rpccli_wbint_Uid2Sid_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.sid = *state->tmp.out.sid; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_Uid2Sid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data( + req, struct rpccli_wbint_Uid2Sid_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t uid /* [in] */, + struct dom_sid *sid /* [out] [ref] */) +{ + struct wbint_Uid2Sid r; + NTSTATUS status; + + /* In parameters */ + r.in.dom_name = dom_name; + r.in.uid = uid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_UID2SID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_Gid2Sid_state { + struct wbint_Gid2Sid orig; + struct wbint_Gid2Sid tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t _gid /* [in] */, + struct dom_sid *_sid /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_Gid2Sid_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_Gid2Sid_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.dom_name = _dom_name; + state->orig.in.gid = _gid; + + /* Out parameters */ + state->orig.out.sid = _sid; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_Gid2Sid_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_GID2SID, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_Gid2Sid_done, req); + return req; +} + +static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data( + req, struct rpccli_wbint_Gid2Sid_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.sid = *state->tmp.out.sid; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_Gid2Sid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data( + req, struct rpccli_wbint_Gid2Sid_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t gid /* [in] */, + struct dom_sid *sid /* [out] [ref] */) +{ + struct wbint_Gid2Sid r; + NTSTATUS status; + + /* In parameters */ + r.in.dom_name = dom_name; + r.in.gid = gid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_GID2SID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_QueryUser_state { + struct wbint_QueryUser orig; + struct wbint_QueryUser tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct dom_sid *_sid /* [in] [ref] */, + struct wbint_userinfo *_info /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_QueryUser_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_QueryUser_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.sid = _sid; + + /* Out parameters */ + state->orig.out.info = _info; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_QueryUser, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_QueryUser_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_QUERYUSER, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req); + return req; +} + +static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_QueryUser_state *state = tevent_req_data( + req, struct rpccli_wbint_QueryUser_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.info = *state->tmp.out.info; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_QueryUser_state *state = tevent_req_data( + req, struct rpccli_wbint_QueryUser_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct dom_sid *sid /* [in] [ref] */, + struct wbint_userinfo *info /* [out] [ref] */) +{ + struct wbint_QueryUser r; + NTSTATUS status; + + /* In parameters */ + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_QueryUser, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_QUERYUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_LookupUserAliases_state { + struct wbint_LookupUserAliases orig; + struct wbint_LookupUserAliases tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct wbint_SidArray *_sids /* [in] [ref] */, + struct wbint_RidArray *_rids /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_LookupUserAliases_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_LookupUserAliases_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.sids = _sids; + + /* Out parameters */ + state->orig.out.rids = _rids; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_LookupUserAliases_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_LOOKUPUSERALIASES, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req); + return req; +} + +static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupUserAliases_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.rids = *state->tmp.out.rids; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupUserAliases_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct wbint_SidArray *sids /* [in] [ref] */, + struct wbint_RidArray *rids /* [out] [ref] */) +{ + struct wbint_LookupUserAliases r; + NTSTATUS status; + + /* In parameters */ + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_LOOKUPUSERALIASES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +struct rpccli_wbint_LookupUserGroups_state { + struct wbint_LookupUserGroups orig; + struct wbint_LookupUserGroups tmp; + TALLOC_CTX *out_mem_ctx; + NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); +}; + +static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq); + +struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct dom_sid *_sid /* [in] [ref] */, + struct wbint_SidArray *_sids /* [out] [ref] */) +{ + struct tevent_req *req; + struct rpccli_wbint_LookupUserGroups_state *state; + struct tevent_req *subreq; + + req = tevent_req_create(mem_ctx, &state, + struct rpccli_wbint_LookupUserGroups_state); + if (req == NULL) { + return NULL; + } + state->out_mem_ctx = NULL; + state->dispatch_recv = cli->dispatch_recv; + + /* In parameters */ + state->orig.in.sid = _sid; + + /* Out parameters */ + state->orig.out.sids = _sids; + + /* Result */ + ZERO_STRUCT(state->orig.out.result); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &state->orig); + } + + state->out_mem_ctx = talloc_named_const(state, 0, + "rpccli_wbint_LookupUserGroups_out_memory"); + if (tevent_req_nomem(state->out_mem_ctx, req)) { + return tevent_req_post(req, ev); + } + + /* make a temporary copy, that we pass to the dispatch function */ + state->tmp = state->orig; + + subreq = cli->dispatch_send(state, ev, cli, + &ndr_table_wbint, + NDR_WBINT_LOOKUPUSERGROUPS, + &state->tmp); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req); + return req; +} + +static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq) +{ + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupUserGroups_state); + NTSTATUS status; + TALLOC_CTX *mem_ctx; + + if (state->out_mem_ctx) { + mem_ctx = state->out_mem_ctx; + } else { + mem_ctx = state; + } + + status = state->dispatch_recv(subreq, mem_ctx); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + + /* Copy out parameters */ + *state->orig.out.sids = *state->tmp.out.sids; + + /* Copy result */ + state->orig.out.result = state->tmp.out.result; + + /* Reset temporary structure */ + ZERO_STRUCT(state->tmp); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &state->orig); + } + + tevent_req_done(req); +} + +NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result) +{ + struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data( + req, struct rpccli_wbint_LookupUserGroups_state); + NTSTATUS status; + + if (tevent_req_is_nterror(req, &status)) { + tevent_req_received(req); + return status; + } + + /* Steal possbile out parameters to the callers context */ + talloc_steal(mem_ctx, state->out_mem_ctx); + + /* Return result */ + *result = state->orig.out.result; + + tevent_req_received(req); + return NT_STATUS_OK; +} + +NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct dom_sid *sid /* [in] [ref] */, + struct wbint_SidArray *sids /* [out] [ref] */) +{ + struct wbint_LookupUserGroups r; + NTSTATUS status; + + /* In parameters */ + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &r); + } + + status = cli->dispatch(cli, + mem_ctx, + &ndr_table_wbint, + NDR_WBINT_LOOKUPUSERGROUPS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sids = *r.out.sids; + + /* Return result */ + return r.out.result; +} + diff --git a/source3/librpc/gen_ndr/cli_wbint.h b/source3/librpc/gen_ndr/cli_wbint.h new file mode 100644 index 0000000000..e9927c1c35 --- /dev/null +++ b/source3/librpc/gen_ndr/cli_wbint.h @@ -0,0 +1,141 @@ +#include "librpc/gen_ndr/ndr_wbint.h" +#ifndef __CLI_WBINT__ +#define __CLI_WBINT__ +struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + uint32_t _in_data /* [in] */, + uint32_t *_out_data /* [out] [ref] */); +NTSTATUS rpccli_wbint_Ping_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t in_data /* [in] */, + uint32_t *out_data /* [out] [ref] */); +struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct dom_sid *_sid /* [in] [ref] */, + enum lsa_SidType *_type /* [out] [ref] */, + const char **_domain /* [out] [ref,charset(UTF8)] */, + const char **_name /* [out] [ref,charset(UTF8)] */); +NTSTATUS rpccli_wbint_LookupSid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct dom_sid *sid /* [in] [ref] */, + enum lsa_SidType *type /* [out] [ref] */, + const char **domain /* [out] [ref,charset(UTF8)] */, + const char **name /* [out] [ref,charset(UTF8)] */); +struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_domain /* [in] [ref,charset(UTF8)] */, + const char *_name /* [in] [ref,charset(UTF8)] */, + uint32_t _flags /* [in] */, + enum lsa_SidType *_type /* [out] [ref] */, + struct dom_sid *_sid /* [out] [ref] */); +NTSTATUS rpccli_wbint_LookupName_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *domain /* [in] [ref,charset(UTF8)] */, + const char *name /* [in] [ref,charset(UTF8)] */, + uint32_t flags /* [in] */, + enum lsa_SidType *type /* [out] [ref] */, + struct dom_sid *sid /* [out] [ref] */); +struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *_sid /* [in] [ref] */, + uint64_t *_uid /* [out] [ref] */); +NTSTATUS rpccli_wbint_Sid2Uid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *sid /* [in] [ref] */, + uint64_t *uid /* [out] [ref] */); +struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *_sid /* [in] [ref] */, + uint64_t *_gid /* [out] [ref] */); +NTSTATUS rpccli_wbint_Sid2Gid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + struct dom_sid *sid /* [in] [ref] */, + uint64_t *gid /* [out] [ref] */); +struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t _uid /* [in] */, + struct dom_sid *_sid /* [out] [ref] */); +NTSTATUS rpccli_wbint_Uid2Sid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t uid /* [in] */, + struct dom_sid *sid /* [out] [ref] */); +struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + const char *_dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t _gid /* [in] */, + struct dom_sid *_sid /* [out] [ref] */); +NTSTATUS rpccli_wbint_Gid2Sid_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *dom_name /* [in] [unique,charset(UTF8)] */, + uint64_t gid /* [in] */, + struct dom_sid *sid /* [out] [ref] */); +struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct dom_sid *_sid /* [in] [ref] */, + struct wbint_userinfo *_info /* [out] [ref] */); +NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct dom_sid *sid /* [in] [ref] */, + struct wbint_userinfo *info /* [out] [ref] */); +struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct wbint_SidArray *_sids /* [in] [ref] */, + struct wbint_RidArray *_rids /* [out] [ref] */); +NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct wbint_SidArray *sids /* [in] [ref] */, + struct wbint_RidArray *rids /* [out] [ref] */); +struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct rpc_pipe_client *cli, + struct dom_sid *_sid /* [in] [ref] */, + struct wbint_SidArray *_sids /* [out] [ref] */); +NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + NTSTATUS *result); +NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct dom_sid *sid /* [in] [ref] */, + struct wbint_SidArray *sids /* [out] [ref] */); +#endif /* __CLI_WBINT__ */ diff --git a/source3/librpc/gen_ndr/ndr_wbint.c b/source3/librpc/gen_ndr/ndr_wbint.c new file mode 100644 index 0000000000..5a8c1c33d7 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_wbint.c @@ -0,0 +1,1405 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_wbint.h" + +#include "librpc/gen_ndr/ndr_lsa.h" +_PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfo(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->acct_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->full_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->homedir)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->shell)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->user_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->group_sid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->acct_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->acct_name, ndr_charset_length(r->acct_name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + if (r->full_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->full_name, ndr_charset_length(r->full_name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + if (r->homedir) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + if (r->shell) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfo(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfo *r) +{ + uint32_t _ptr_acct_name; + TALLOC_CTX *_mem_save_acct_name_0; + uint32_t _ptr_full_name; + TALLOC_CTX *_mem_save_full_name_0; + uint32_t _ptr_homedir; + TALLOC_CTX *_mem_save_homedir_0; + uint32_t _ptr_shell; + TALLOC_CTX *_mem_save_shell_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_acct_name)); + if (_ptr_acct_name) { + NDR_PULL_ALLOC(ndr, r->acct_name); + } else { + r->acct_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_full_name)); + if (_ptr_full_name) { + NDR_PULL_ALLOC(ndr, r->full_name); + } else { + r->full_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir)); + if (_ptr_homedir) { + NDR_PULL_ALLOC(ndr, r->homedir); + } else { + r->homedir = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell)); + if (_ptr_shell) { + NDR_PULL_ALLOC(ndr, r->shell); + } else { + r->shell = NULL; + } + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->user_sid)); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->group_sid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->acct_name) { + _mem_save_acct_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->acct_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->acct_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->acct_name)); + if (ndr_get_array_length(ndr, &r->acct_name) > ndr_get_array_size(ndr, &r->acct_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->acct_name), ndr_get_array_length(ndr, &r->acct_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->acct_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->acct_name, ndr_get_array_length(ndr, &r->acct_name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_name_0, 0); + } + if (r->full_name) { + _mem_save_full_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->full_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->full_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->full_name)); + if (ndr_get_array_length(ndr, &r->full_name) > ndr_get_array_size(ndr, &r->full_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->full_name), ndr_get_array_length(ndr, &r->full_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->full_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->full_name, ndr_get_array_length(ndr, &r->full_name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_full_name_0, 0); + } + if (r->homedir) { + _mem_save_homedir_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->homedir, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir)); + if (ndr_get_array_length(ndr, &r->homedir) > ndr_get_array_size(ndr, &r->homedir)) { + 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)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_homedir_0, 0); + } + if (r->shell) { + _mem_save_shell_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->shell, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->shell)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->shell)); + if (ndr_get_array_length(ndr, &r->shell) > ndr_get_array_size(ndr, &r->shell)) { + 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)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_shell_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_userinfo(struct ndr_print *ndr, const char *name, const struct wbint_userinfo *r) +{ + ndr_print_struct(ndr, name, "wbint_userinfo"); + ndr->depth++; + ndr_print_ptr(ndr, "acct_name", r->acct_name); + ndr->depth++; + if (r->acct_name) { + ndr_print_string(ndr, "acct_name", r->acct_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "full_name", r->full_name); + ndr->depth++; + if (r->full_name) { + ndr_print_string(ndr, "full_name", r->full_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "homedir", r->homedir); + ndr->depth++; + if (r->homedir) { + ndr_print_string(ndr, "homedir", r->homedir); + } + ndr->depth--; + ndr_print_ptr(ndr, "shell", r->shell); + ndr->depth++; + if (r->shell) { + ndr_print_string(ndr, "shell", r->shell); + } + ndr->depth--; + ndr_print_hyper(ndr, "primary_gid", r->primary_gid); + ndr_print_dom_sid(ndr, "user_sid", &r->user_sid); + ndr_print_dom_sid(ndr, "group_sid", &r->group_sid); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_wbint_SidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_SidArray *r) +{ + uint32_t cntr_sids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_wbint_SidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_SidArray *r) +{ + uint32_t cntr_sids_0; + TALLOC_CTX *_mem_save_sids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_SidArray(struct ndr_print *ndr, const char *name, const struct wbint_SidArray *r) +{ + uint32_t cntr_sids_0; + ndr_print_struct(ndr, name, "wbint_SidArray"); + ndr->depth++; + ndr_print_uint32(ndr, "num_sids", r->num_sids); + ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids); + ndr->depth++; + for (cntr_sids_0=0;cntr_sids_0<r->num_sids;cntr_sids_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_sids_0) != -1) { + ndr_print_dom_sid(ndr, "sids", &r->sids[cntr_sids_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_wbint_RidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_RidArray *r) +{ + uint32_t cntr_rids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids)); + for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_wbint_RidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_RidArray *r) +{ + uint32_t cntr_rids_0; + TALLOC_CTX *_mem_save_rids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids)); + NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + if (r->rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids)); + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_RidArray(struct ndr_print *ndr, const char *name, const struct wbint_RidArray *r) +{ + uint32_t cntr_rids_0; + ndr_print_struct(ndr, name, "wbint_RidArray"); + ndr->depth++; + ndr_print_uint32(ndr, "num_rids", r->num_rids); + ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids); + ndr->depth++; + for (cntr_rids_0=0;cntr_rids_0<r->num_rids;cntr_rids_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_rids_0) != -1) { + ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_Ping(struct ndr_push *ndr, int flags, const struct wbint_Ping *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data)); + } + if (flags & NDR_OUT) { + if (r->out.out_data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_Ping(struct ndr_pull *ndr, int flags, struct wbint_Ping *r) +{ + TALLOC_CTX *_mem_save_out_data_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data)); + NDR_PULL_ALLOC(ndr, r->out.out_data); + ZERO_STRUCTP(r->out.out_data); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.out_data); + } + _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r) +{ + ndr_print_struct(ndr, name, "wbint_Ping"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_Ping"); + ndr->depth++; + ndr_print_uint32(ndr, "in_data", r->in.in_data); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_Ping"); + ndr->depth++; + ndr_print_ptr(ndr, "out_data", r->out.out_data); + ndr->depth++; + ndr_print_uint32(ndr, "out_data", *r->out.out_data); + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_LookupSid(struct ndr_push *ndr, int flags, const struct wbint_LookupSid *r) +{ + if (flags & NDR_IN) { + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type)); + if (r->out.domain == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domain)); + if (*r->out.domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.domain, ndr_charset_length(*r->out.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + if (r->out.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name)); + if (*r->out.name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name, ndr_charset_length(*r->out.name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_LookupSid(struct ndr_pull *ndr, int flags, struct wbint_LookupSid *r) +{ + uint32_t _ptr_domain; + uint32_t _ptr_name; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_type_0; + TALLOC_CTX *_mem_save_domain_0; + TALLOC_CTX *_mem_save_domain_1; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_name_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.type); + ZERO_STRUCTP(r->out.type); + NDR_PULL_ALLOC(ndr, r->out.domain); + ZERO_STRUCTP(r->out.domain); + NDR_PULL_ALLOC(ndr, r->out.name); + ZERO_STRUCTP(r->out.name); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.type); + } + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domain); + } + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domain, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, *r->out.domain); + } else { + *r->out.domain = NULL; + } + if (*r->out.domain) { + _mem_save_domain_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.domain)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.domain)); + if (ndr_get_array_length(ndr, r->out.domain) > ndr_get_array_size(ndr, r->out.domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.domain), ndr_get_array_length(ndr, r->out.domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.domain, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, *r->out.name); + } else { + *r->out.name = NULL; + } + if (*r->out.name) { + _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.name)); + if (ndr_get_array_length(ndr, r->out.name) > ndr_get_array_size(ndr, r->out.name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.name), ndr_get_array_length(ndr, r->out.name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_LookupSid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSid *r) +{ + ndr_print_struct(ndr, name, "wbint_LookupSid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_LookupSid"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_LookupSid"); + ndr->depth++; + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "type", *r->out.type); + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->out.domain); + ndr->depth++; + ndr_print_ptr(ndr, "domain", *r->out.domain); + ndr->depth++; + if (*r->out.domain) { + ndr_print_string(ndr, "domain", *r->out.domain); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "name", r->out.name); + ndr->depth++; + ndr_print_ptr(ndr, "name", *r->out.name); + ndr->depth++; + if (*r->out.name) { + ndr_print_string(ndr, "name", *r->out.name); + } + ndr->depth--; + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_LookupName(struct ndr_push *ndr, int flags, const struct wbint_LookupName *r) +{ + if (flags & NDR_IN) { + if (r->in.domain == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + if (r->in.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.type == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type)); + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_LookupName(struct ndr_pull *ndr, int flags, struct wbint_LookupName *r) +{ + TALLOC_CTX *_mem_save_type_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain)); + if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain), ndr_get_array_length(ndr, &r->in.domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t), CH_UTF8)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name)); + if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t), CH_UTF8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.type); + ZERO_STRUCTP(r->out.type); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.type); + } + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_LookupName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupName *r) +{ + ndr_print_struct(ndr, name, "wbint_LookupName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_LookupName"); + ndr->depth++; + ndr_print_ptr(ndr, "domain", r->in.domain); + ndr->depth++; + ndr_print_string(ndr, "domain", r->in.domain); + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_string(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_LookupName"); + ndr->depth++; + ndr_print_ptr(ndr, "type", r->out.type); + ndr->depth++; + ndr_print_lsa_SidType(ndr, "type", *r->out.type); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->out.sid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_Sid2Uid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Uid *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name)); + if (r->in.dom_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.uid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_Sid2Uid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Uid *r) +{ + uint32_t _ptr_dom_name; + TALLOC_CTX *_mem_save_dom_name_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_uid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name)); + if (_ptr_dom_name) { + NDR_PULL_ALLOC(ndr, r->in.dom_name); + } else { + r->in.dom_name = NULL; + } + if (r->in.dom_name) { + _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name)); + if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.uid); + ZERO_STRUCTP(r->out.uid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.uid); + } + _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_Sid2Uid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Uid *r) +{ + ndr_print_struct(ndr, name, "wbint_Sid2Uid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_Sid2Uid"); + ndr->depth++; + ndr_print_ptr(ndr, "dom_name", r->in.dom_name); + ndr->depth++; + if (r->in.dom_name) { + ndr_print_string(ndr, "dom_name", r->in.dom_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_Sid2Uid"); + ndr->depth++; + ndr_print_ptr(ndr, "uid", r->out.uid); + ndr->depth++; + ndr_print_hyper(ndr, "uid", *r->out.uid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_Sid2Gid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Gid *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name)); + if (r->in.dom_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.gid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_Sid2Gid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Gid *r) +{ + uint32_t _ptr_dom_name; + TALLOC_CTX *_mem_save_dom_name_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_gid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name)); + if (_ptr_dom_name) { + NDR_PULL_ALLOC(ndr, r->in.dom_name); + } else { + r->in.dom_name = NULL; + } + if (r->in.dom_name) { + _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name)); + if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.gid); + ZERO_STRUCTP(r->out.gid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.gid); + } + _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_Sid2Gid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Gid *r) +{ + ndr_print_struct(ndr, name, "wbint_Sid2Gid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_Sid2Gid"); + ndr->depth++; + ndr_print_ptr(ndr, "dom_name", r->in.dom_name); + ndr->depth++; + if (r->in.dom_name) { + ndr_print_string(ndr, "dom_name", r->in.dom_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_Sid2Gid"); + ndr->depth++; + ndr_print_ptr(ndr, "gid", r->out.gid); + ndr->depth++; + ndr_print_hyper(ndr, "gid", *r->out.gid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_Uid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Uid2Sid *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name)); + if (r->in.dom_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid)); + } + if (flags & NDR_OUT) { + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_Uid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Uid2Sid *r) +{ + uint32_t _ptr_dom_name; + TALLOC_CTX *_mem_save_dom_name_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name)); + if (_ptr_dom_name) { + NDR_PULL_ALLOC(ndr, r->in.dom_name); + } else { + r->in.dom_name = NULL; + } + if (r->in.dom_name) { + _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name)); + if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0); + } + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid)); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_Uid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Uid2Sid *r) +{ + ndr_print_struct(ndr, name, "wbint_Uid2Sid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_Uid2Sid"); + ndr->depth++; + ndr_print_ptr(ndr, "dom_name", r->in.dom_name); + ndr->depth++; + if (r->in.dom_name) { + ndr_print_string(ndr, "dom_name", r->in.dom_name); + } + ndr->depth--; + ndr_print_hyper(ndr, "uid", r->in.uid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_Uid2Sid"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->out.sid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_Gid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Gid2Sid *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name)); + if (r->in.dom_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8)); + } + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid)); + } + if (flags & NDR_OUT) { + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_Gid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Gid2Sid *r) +{ + uint32_t _ptr_dom_name; + TALLOC_CTX *_mem_save_dom_name_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name)); + if (_ptr_dom_name) { + NDR_PULL_ALLOC(ndr, r->in.dom_name); + } else { + r->in.dom_name = NULL; + } + if (r->in.dom_name) { + _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name)); + if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0); + } + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid)); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_Gid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Gid2Sid *r) +{ + ndr_print_struct(ndr, name, "wbint_Gid2Sid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_Gid2Sid"); + ndr->depth++; + ndr_print_ptr(ndr, "dom_name", r->in.dom_name); + ndr->depth++; + if (r->in.dom_name) { + ndr_print_string(ndr, "dom_name", r->in.dom_name); + } + ndr->depth--; + ndr_print_hyper(ndr, "gid", r->in.gid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_Gid2Sid"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->out.sid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_QueryUser(struct ndr_push *ndr, int flags, const struct wbint_QueryUser *r) +{ + if (flags & NDR_IN) { + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_QueryUser(struct ndr_pull *ndr, int flags, struct wbint_QueryUser *r) +{ + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_QueryUser(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUser *r) +{ + ndr_print_struct(ndr, name, "wbint_QueryUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_QueryUser"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_QueryUser"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_wbint_userinfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_LookupUserAliases(struct ndr_push *ndr, int flags, const struct wbint_LookupUserAliases *r) +{ + if (flags & NDR_IN) { + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids)); + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_LookupUserAliases(struct ndr_pull *ndr, int flags, struct wbint_LookupUserAliases *r) +{ + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_rids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserAliases *r) +{ + ndr_print_struct(ndr, name, "wbint_LookupUserAliases"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_LookupUserAliases"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_wbint_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_LookupUserAliases"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_wbint_RidArray(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_wbint_LookupUserGroups(struct ndr_push *ndr, int flags, const struct wbint_LookupUserGroups *r) +{ + if (flags & NDR_IN) { + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_wbint_LookupUserGroups(struct ndr_pull *ndr, int flags, struct wbint_LookupUserGroups *r) +{ + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sids); + ZERO_STRUCTP(r->out.sids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r) +{ + ndr_print_struct(ndr, name, "wbint_LookupUserGroups"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "wbint_LookupUserGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "wbint_LookupUserGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_wbint_SidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call wbint_calls[] = { + { + "wbint_Ping", + sizeof(struct wbint_Ping), + (ndr_push_flags_fn_t) ndr_push_wbint_Ping, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Ping, + (ndr_print_function_t) ndr_print_wbint_Ping, + false, + }, + { + "wbint_LookupSid", + sizeof(struct wbint_LookupSid), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupSid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSid, + (ndr_print_function_t) ndr_print_wbint_LookupSid, + false, + }, + { + "wbint_LookupName", + sizeof(struct wbint_LookupName), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupName, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupName, + (ndr_print_function_t) ndr_print_wbint_LookupName, + false, + }, + { + "wbint_Sid2Uid", + sizeof(struct wbint_Sid2Uid), + (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Uid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Uid, + (ndr_print_function_t) ndr_print_wbint_Sid2Uid, + false, + }, + { + "wbint_Sid2Gid", + sizeof(struct wbint_Sid2Gid), + (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Gid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Gid, + (ndr_print_function_t) ndr_print_wbint_Sid2Gid, + false, + }, + { + "wbint_Uid2Sid", + sizeof(struct wbint_Uid2Sid), + (ndr_push_flags_fn_t) ndr_push_wbint_Uid2Sid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Uid2Sid, + (ndr_print_function_t) ndr_print_wbint_Uid2Sid, + false, + }, + { + "wbint_Gid2Sid", + sizeof(struct wbint_Gid2Sid), + (ndr_push_flags_fn_t) ndr_push_wbint_Gid2Sid, + (ndr_pull_flags_fn_t) ndr_pull_wbint_Gid2Sid, + (ndr_print_function_t) ndr_print_wbint_Gid2Sid, + false, + }, + { + "wbint_QueryUser", + sizeof(struct wbint_QueryUser), + (ndr_push_flags_fn_t) ndr_push_wbint_QueryUser, + (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUser, + (ndr_print_function_t) ndr_print_wbint_QueryUser, + false, + }, + { + "wbint_LookupUserAliases", + sizeof(struct wbint_LookupUserAliases), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserAliases, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserAliases, + (ndr_print_function_t) ndr_print_wbint_LookupUserAliases, + false, + }, + { + "wbint_LookupUserGroups", + sizeof(struct wbint_LookupUserGroups), + (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups, + (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups, + (ndr_print_function_t) ndr_print_wbint_LookupUserGroups, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const wbint_endpoint_strings[] = { + "ncalrpc:", +}; + +static const struct ndr_interface_string_array wbint_endpoints = { + .count = 1, + .names = wbint_endpoint_strings +}; + +static const char * const wbint_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array wbint_authservices = { + .count = 1, + .names = wbint_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_wbint = { + .name = "wbint", + .syntax_id = { + {0xbf09192c,0xed60,0x4928,{0x9d,0xff},{0xd0,0xd7,0xbc,0xb0,0x3e,0xd8}}, + NDR_WBINT_VERSION + }, + .helpstring = NDR_WBINT_HELPSTRING, + .num_calls = 10, + .calls = wbint_calls, + .endpoints = &wbint_endpoints, + .authservices = &wbint_authservices +}; + diff --git a/source3/librpc/gen_ndr/ndr_wbint.h b/source3/librpc/gen_ndr/ndr_wbint.h new file mode 100644 index 0000000000..6fd6b1d74d --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_wbint.h @@ -0,0 +1,54 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/wbint.h" + +#ifndef _HEADER_NDR_wbint +#define _HEADER_NDR_wbint + +#define NDR_WBINT_UUID "bf09192c-ed60-4928-9dff-d0d7bcb03ed8" +#define NDR_WBINT_VERSION 1.0 +#define NDR_WBINT_NAME "wbint" +#define NDR_WBINT_HELPSTRING "winbind parent-child protocol" +extern const struct ndr_interface_table ndr_table_wbint; +#define NDR_WBINT_PING (0x00) + +#define NDR_WBINT_LOOKUPSID (0x01) + +#define NDR_WBINT_LOOKUPNAME (0x02) + +#define NDR_WBINT_SID2UID (0x03) + +#define NDR_WBINT_SID2GID (0x04) + +#define NDR_WBINT_UID2SID (0x05) + +#define NDR_WBINT_GID2SID (0x06) + +#define NDR_WBINT_QUERYUSER (0x07) + +#define NDR_WBINT_LOOKUPUSERALIASES (0x08) + +#define NDR_WBINT_LOOKUPUSERGROUPS (0x09) + +#define NDR_WBINT_CALL_COUNT (10) +enum ndr_err_code ndr_push_wbint_userinfo(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfo *r); +enum ndr_err_code ndr_pull_wbint_userinfo(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfo *r); +void ndr_print_wbint_userinfo(struct ndr_print *ndr, const char *name, const struct wbint_userinfo *r); +enum ndr_err_code ndr_push_wbint_SidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_SidArray *r); +enum ndr_err_code ndr_pull_wbint_SidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_SidArray *r); +void ndr_print_wbint_SidArray(struct ndr_print *ndr, const char *name, const struct wbint_SidArray *r); +enum ndr_err_code ndr_push_wbint_RidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_RidArray *r); +enum ndr_err_code ndr_pull_wbint_RidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_RidArray *r); +void ndr_print_wbint_RidArray(struct ndr_print *ndr, const char *name, const struct wbint_RidArray *r); +void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r); +void ndr_print_wbint_LookupSid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSid *r); +void ndr_print_wbint_LookupName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupName *r); +void ndr_print_wbint_Sid2Uid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Uid *r); +void ndr_print_wbint_Sid2Gid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Gid *r); +void ndr_print_wbint_Uid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Uid2Sid *r); +void ndr_print_wbint_Gid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Gid2Sid *r); +void ndr_print_wbint_QueryUser(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUser *r); +void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserAliases *r); +void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r); +#endif /* _HEADER_NDR_wbint */ diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c new file mode 100644 index 0000000000..95c0619058 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_wbint.c @@ -0,0 +1,1000 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_wbint.h" + +static bool api_wbint_Ping(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_Ping *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_PING]; + + r = talloc(talloc_tos(), struct wbint_Ping); + 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_Ping, r); + } + + ZERO_STRUCT(r->out); + r->out.out_data = talloc_zero(r, uint32_t); + if (r->out.out_data == NULL) { + talloc_free(r); + return false; + } + + _wbint_Ping(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_Ping, 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; +} + +static bool api_wbint_LookupSid(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_LookupSid *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPSID]; + + r = talloc(talloc_tos(), struct wbint_LookupSid); + 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_LookupSid, r); + } + + ZERO_STRUCT(r->out); + r->out.type = talloc_zero(r, enum lsa_SidType); + if (r->out.type == NULL) { + talloc_free(r); + return false; + } + + r->out.domain = talloc_zero(r, const char *); + if (r->out.domain == NULL) { + talloc_free(r); + return false; + } + + r->out.name = talloc_zero(r, const char *); + if (r->out.name == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_LookupSid(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_LookupSid, 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; +} + +static bool api_wbint_LookupName(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_LookupName *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPNAME]; + + r = talloc(talloc_tos(), struct wbint_LookupName); + 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_LookupName, r); + } + + ZERO_STRUCT(r->out); + r->out.type = talloc_zero(r, enum lsa_SidType); + if (r->out.type == NULL) { + talloc_free(r); + return false; + } + + r->out.sid = talloc_zero(r, struct dom_sid); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_LookupName(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_LookupName, 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; +} + +static bool api_wbint_Sid2Uid(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_Sid2Uid *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_SID2UID]; + + r = talloc(talloc_tos(), struct wbint_Sid2Uid); + 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_Sid2Uid, r); + } + + ZERO_STRUCT(r->out); + r->out.uid = talloc_zero(r, uint64_t); + if (r->out.uid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_Sid2Uid(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_Sid2Uid, 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; +} + +static bool api_wbint_Sid2Gid(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_Sid2Gid *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_SID2GID]; + + r = talloc(talloc_tos(), struct wbint_Sid2Gid); + 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_Sid2Gid, r); + } + + ZERO_STRUCT(r->out); + r->out.gid = talloc_zero(r, uint64_t); + if (r->out.gid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_Sid2Gid(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_Sid2Gid, 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; +} + +static bool api_wbint_Uid2Sid(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_Uid2Sid *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_UID2SID]; + + r = talloc(talloc_tos(), struct wbint_Uid2Sid); + 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_Uid2Sid, r); + } + + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(r, struct dom_sid); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_Uid2Sid(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_Uid2Sid, 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; +} + +static bool api_wbint_Gid2Sid(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_Gid2Sid *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_GID2SID]; + + r = talloc(talloc_tos(), struct wbint_Gid2Sid); + 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_Gid2Sid, r); + } + + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(r, struct dom_sid); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_Gid2Sid(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_Gid2Sid, 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; +} + +static bool api_wbint_QueryUser(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_QueryUser *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSER]; + + r = talloc(talloc_tos(), struct wbint_QueryUser); + 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_QueryUser, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct wbint_userinfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_QueryUser(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_QueryUser, 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; +} + +static bool api_wbint_LookupUserAliases(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_LookupUserAliases *r; + + call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERALIASES]; + + r = talloc(talloc_tos(), struct wbint_LookupUserAliases); + 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_LookupUserAliases, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct wbint_RidArray); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _wbint_LookupUserAliases(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_LookupUserAliases, 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; +} + +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[] = +{ + {"WBINT_PING", NDR_WBINT_PING, api_wbint_Ping}, + {"WBINT_LOOKUPSID", NDR_WBINT_LOOKUPSID, api_wbint_LookupSid}, + {"WBINT_LOOKUPNAME", NDR_WBINT_LOOKUPNAME, api_wbint_LookupName}, + {"WBINT_SID2UID", NDR_WBINT_SID2UID, api_wbint_Sid2Uid}, + {"WBINT_SID2GID", NDR_WBINT_SID2GID, api_wbint_Sid2Gid}, + {"WBINT_UID2SID", NDR_WBINT_UID2SID, api_wbint_Uid2Sid}, + {"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) +{ + *fns = api_wbint_cmds; + *n_fns = sizeof(api_wbint_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r) +{ + if (cli->pipes_struct == NULL) { + return NT_STATUS_INVALID_PARAMETER; + } + + switch (opnum) + { + case NDR_WBINT_PING: { + struct wbint_Ping *r = (struct wbint_Ping *)_r; + ZERO_STRUCT(r->out); + r->out.out_data = talloc_zero(mem_ctx, uint32_t); + if (r->out.out_data == NULL) { + return NT_STATUS_NO_MEMORY; + } + + _wbint_Ping(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_LOOKUPSID: { + struct wbint_LookupSid *r = (struct wbint_LookupSid *)_r; + ZERO_STRUCT(r->out); + r->out.type = talloc_zero(mem_ctx, enum lsa_SidType); + if (r->out.type == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.domain = talloc_zero(mem_ctx, const char *); + if (r->out.domain == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.name = talloc_zero(mem_ctx, const char *); + if (r->out.name == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_LookupSid(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_LOOKUPNAME: { + struct wbint_LookupName *r = (struct wbint_LookupName *)_r; + ZERO_STRUCT(r->out); + r->out.type = talloc_zero(mem_ctx, enum lsa_SidType); + if (r->out.type == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.sid = talloc_zero(mem_ctx, struct dom_sid); + if (r->out.sid == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_LookupName(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_SID2UID: { + struct wbint_Sid2Uid *r = (struct wbint_Sid2Uid *)_r; + ZERO_STRUCT(r->out); + r->out.uid = talloc_zero(mem_ctx, uint64_t); + if (r->out.uid == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_Sid2Uid(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_SID2GID: { + struct wbint_Sid2Gid *r = (struct wbint_Sid2Gid *)_r; + ZERO_STRUCT(r->out); + r->out.gid = talloc_zero(mem_ctx, uint64_t); + if (r->out.gid == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_Sid2Gid(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_UID2SID: { + struct wbint_Uid2Sid *r = (struct wbint_Uid2Sid *)_r; + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(mem_ctx, struct dom_sid); + if (r->out.sid == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_Uid2Sid(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_GID2SID: { + struct wbint_Gid2Sid *r = (struct wbint_Gid2Sid *)_r; + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(mem_ctx, struct dom_sid); + if (r->out.sid == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_Gid2Sid(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_QUERYUSER: { + struct wbint_QueryUser *r = (struct wbint_QueryUser *)_r; + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(mem_ctx, struct wbint_userinfo); + if (r->out.info == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_QueryUser(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_WBINT_LOOKUPUSERALIASES: { + struct wbint_LookupUserAliases *r = (struct wbint_LookupUserAliases *)_r; + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray); + if (r->out.rids == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.result = _wbint_LookupUserAliases(cli->pipes_struct, r); + 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; + } +} + +NTSTATUS rpc_wbint_init(void) +{ + return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wbint", "wbint", &ndr_table_wbint, api_wbint_cmds, sizeof(api_wbint_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_wbint.h b/source3/librpc/gen_ndr/srv_wbint.h new file mode 100644 index 0000000000..20ca316375 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_wbint.h @@ -0,0 +1,27 @@ +#include "librpc/gen_ndr/ndr_wbint.h" +#ifndef __SRV_WBINT__ +#define __SRV_WBINT__ +void _wbint_Ping(pipes_struct *p, struct wbint_Ping *r); +NTSTATUS _wbint_LookupSid(pipes_struct *p, struct wbint_LookupSid *r); +NTSTATUS _wbint_LookupName(pipes_struct *p, struct wbint_LookupName *r); +NTSTATUS _wbint_Sid2Uid(pipes_struct *p, struct wbint_Sid2Uid *r); +NTSTATUS _wbint_Sid2Gid(pipes_struct *p, struct wbint_Sid2Gid *r); +NTSTATUS _wbint_Uid2Sid(pipes_struct *p, struct wbint_Uid2Sid *r); +NTSTATUS _wbint_Gid2Sid(pipes_struct *p, struct wbint_Gid2Sid *r); +NTSTATUS _wbint_QueryUser(pipes_struct *p, struct wbint_QueryUser *r); +NTSTATUS _wbint_LookupUserAliases(pipes_struct *p, struct wbint_LookupUserAliases *r); +NTSTATUS _wbint_LookupUserGroups(pipes_struct *p, struct wbint_LookupUserGroups *r); +void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r); +void _wbint_Ping(pipes_struct *p, struct wbint_Ping *r); +NTSTATUS _wbint_LookupSid(pipes_struct *p, struct wbint_LookupSid *r); +NTSTATUS _wbint_LookupName(pipes_struct *p, struct wbint_LookupName *r); +NTSTATUS _wbint_Sid2Uid(pipes_struct *p, struct wbint_Sid2Uid *r); +NTSTATUS _wbint_Sid2Gid(pipes_struct *p, struct wbint_Sid2Gid *r); +NTSTATUS _wbint_Uid2Sid(pipes_struct *p, struct wbint_Uid2Sid *r); +NTSTATUS _wbint_Gid2Sid(pipes_struct *p, struct wbint_Gid2Sid *r); +NTSTATUS _wbint_QueryUser(pipes_struct *p, struct wbint_QueryUser *r); +NTSTATUS _wbint_LookupUserAliases(pipes_struct *p, struct wbint_LookupUserAliases *r); +NTSTATUS _wbint_LookupUserGroups(pipes_struct *p, struct wbint_LookupUserGroups *r); +NTSTATUS rpc_wbint_init(void); +#endif /* __SRV_WBINT__ */ diff --git a/source3/librpc/gen_ndr/wbint.h b/source3/librpc/gen_ndr/wbint.h new file mode 100644 index 0000000000..28382ec346 --- /dev/null +++ b/source3/librpc/gen_ndr/wbint.h @@ -0,0 +1,169 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#include "libcli/util/ntstatus.h" + +#include "librpc/gen_ndr/lsa.h" +#ifndef _HEADER_wbint +#define _HEADER_wbint + +struct wbint_userinfo { + const char *acct_name;/* [unique,charset(UTF8)] */ + const char *full_name;/* [unique,charset(UTF8)] */ + const char *homedir;/* [unique,charset(UTF8)] */ + const char *shell;/* [unique,charset(UTF8)] */ + uint64_t primary_gid; + struct dom_sid user_sid; + struct dom_sid group_sid; +}/* [public] */; + +struct wbint_SidArray { + uint32_t num_sids; + struct dom_sid *sids;/* [size_is(num_sids)] */ +}/* [public] */; + +struct wbint_RidArray { + uint32_t num_rids; + uint32_t *rids;/* [size_is(num_rids)] */ +}/* [public] */; + + +struct wbint_Ping { + struct { + uint32_t in_data; + } in; + + struct { + uint32_t *out_data;/* [ref] */ + } out; + +}; + + +struct wbint_LookupSid { + struct { + struct dom_sid *sid;/* [ref] */ + } in; + + struct { + enum lsa_SidType *type;/* [ref] */ + const char **domain;/* [ref,charset(UTF8)] */ + const char **name;/* [ref,charset(UTF8)] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_LookupName { + struct { + const char *domain;/* [ref,charset(UTF8)] */ + const char *name;/* [ref,charset(UTF8)] */ + uint32_t flags; + } in; + + struct { + enum lsa_SidType *type;/* [ref] */ + struct dom_sid *sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_Sid2Uid { + struct { + const char *dom_name;/* [unique,charset(UTF8)] */ + struct dom_sid *sid;/* [ref] */ + } in; + + struct { + uint64_t *uid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_Sid2Gid { + struct { + const char *dom_name;/* [unique,charset(UTF8)] */ + struct dom_sid *sid;/* [ref] */ + } in; + + struct { + uint64_t *gid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_Uid2Sid { + struct { + const char *dom_name;/* [unique,charset(UTF8)] */ + uint64_t uid; + } in; + + struct { + struct dom_sid *sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_Gid2Sid { + struct { + const char *dom_name;/* [unique,charset(UTF8)] */ + uint64_t gid; + } in; + + struct { + struct dom_sid *sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_QueryUser { + struct { + struct dom_sid *sid;/* [ref] */ + } in; + + struct { + struct wbint_userinfo *info;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_LookupUserAliases { + struct { + struct wbint_SidArray *sids;/* [ref] */ + } in; + + struct { + struct wbint_RidArray *rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct wbint_LookupUserGroups { + struct { + struct dom_sid *sid;/* [ref] */ + } in; + + struct { + struct wbint_SidArray *sids;/* [ref] */ + NTSTATUS result; + } out; + +}; + +#endif /* _HEADER_wbint */ diff --git a/source3/librpc/idl/wbint.idl b/source3/librpc/idl/wbint.idl new file mode 100644 index 0000000000..f994126711 --- /dev/null +++ b/source3/librpc/idl/wbint.idl @@ -0,0 +1,91 @@ +#include "idl_types.h" +import "lsa.idl"; + +[ + uuid("bf09192c-ed60-4928-9dff-d0d7bcb03ed8"), + endpoint("ncalrpc:"), + pointer_default(unique), + version(1.0), + helpstring("winbind parent-child protocol") +] +interface wbint +{ + void wbint_Ping( + [in] uint32 in_data, + [out] uint32 *out_data + ); + + NTSTATUS wbint_LookupSid( + [in] dom_sid *sid, + [out] lsa_SidType *type, + [out,string,charset(UTF8)] char **domain, + [out,string,charset(UTF8)] char **name + ); + + NTSTATUS wbint_LookupName( + [in,string,charset(UTF8)] char *domain, + [in,string,charset(UTF8)] char *name, + [in] uint32 flags, + [out] lsa_SidType *type, + [out] dom_sid *sid + ); + + NTSTATUS wbint_Sid2Uid( + [in,unique,string,charset(UTF8)] char *dom_name, + [in] dom_sid *sid, + [out] hyper *uid + ); + + NTSTATUS wbint_Sid2Gid( + [in,unique,string,charset(UTF8)] char *dom_name, + [in] dom_sid *sid, + [out] hyper *gid + ); + + NTSTATUS wbint_Uid2Sid( + [in,unique,string,charset(UTF8)] char *dom_name, + [in] hyper uid, + [out] dom_sid *sid + ); + + NTSTATUS wbint_Gid2Sid( + [in,unique,string,charset(UTF8)] char *dom_name, + [in] hyper gid, + [out] dom_sid *sid + ); + + typedef [public] struct { + [string,charset(UTF8)] char *acct_name; + [string,charset(UTF8)] char *full_name; + [string,charset(UTF8)] char *homedir; + [string,charset(UTF8)] char *shell; + hyper primary_gid; + dom_sid user_sid; + dom_sid group_sid; + } wbint_userinfo; + + NTSTATUS wbint_QueryUser( + [in] dom_sid *sid, + [out] wbint_userinfo *info + ); + + typedef [public] struct { + uint32 num_sids; + [size_is(num_sids)] dom_sid sids[]; + } wbint_SidArray; + + typedef [public] struct { + uint32 num_rids; + [size_is(num_rids)] uint32 rids[]; + } wbint_RidArray; + + NTSTATUS wbint_LookupUserAliases( + [in] wbint_SidArray *sids, + [out] wbint_RidArray *rids + ); + + NTSTATUS wbint_LookupUserGroups( + [in] dom_sid *sid, + [out] wbint_SidArray *sids + ); +}
\ No newline at end of file |