summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr/srv_wbint.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/librpc/gen_ndr/srv_wbint.c')
-rw-r--r--source3/librpc/gen_ndr/srv_wbint.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c
index 7a76f53959..a04aa8245f 100644
--- a/source3/librpc/gen_ndr/srv_wbint.c
+++ b/source3/librpc/gen_ndr/srv_wbint.c
@@ -504,6 +504,86 @@ static bool api_wbint_Uid2Sid(pipes_struct *p)
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;
+}
+
/* Tables */
static struct api_struct api_wbint_cmds[] =
@@ -514,6 +594,7 @@ static struct api_struct api_wbint_cmds[] =
{"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},
};
void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns)
@@ -617,6 +698,18 @@ NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, co
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;
+ }
+
default:
return NT_STATUS_NOT_IMPLEMENTED;
}