From 48e2a2bfb75cdc914345b498012e82331546f0c0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 13 Sep 2006 16:28:25 +0000 Subject: r18481: Use pidl-generated server side code for dfs. (This used to be commit 3f337c104d42321595161d0283b39357df252a8e) --- source3/librpc/gen_ndr/srv_dfs.c | 1201 ++++++++++ source3/librpc/gen_ndr/srv_dfs.h | 29 + source3/librpc/gen_ndr/srv_lsa.c | 4233 +++++++++++++++++++++++++++++++++ source3/librpc/gen_ndr/srv_lsa.h | 88 + source3/librpc/gen_ndr/srv_unixinfo.c | 280 +++ source3/librpc/gen_ndr/srv_unixinfo.h | 11 + 6 files changed, 5842 insertions(+) create mode 100644 source3/librpc/gen_ndr/srv_dfs.c create mode 100644 source3/librpc/gen_ndr/srv_dfs.h create mode 100644 source3/librpc/gen_ndr/srv_lsa.c create mode 100644 source3/librpc/gen_ndr/srv_lsa.h create mode 100644 source3/librpc/gen_ndr/srv_unixinfo.c create mode 100644 source3/librpc/gen_ndr/srv_unixinfo.h (limited to 'source3/librpc/gen_ndr') diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c new file mode 100644 index 0000000000..75f3cd3949 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_dfs.c @@ -0,0 +1,1201 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_dfs.h" + +static BOOL api_dfs_GetManagerVersion(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_GetManagerVersion r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetManagerVersion"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_GetManagerVersion(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + _dfs_GetManagerVersion(p, r.out.exist_flag); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_GetManagerVersion(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Add(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Add r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Add"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Add(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Add(p, r.in.path, r.in.server, r.in.share, r.in.comment, r.in.flags); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Add(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Remove(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Remove r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Remove"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Remove(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Remove(p, r.in.path, r.in.server, r.in.share); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Remove(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_SetInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_SetInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_SetInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_SetInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_SetInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_GetInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_GetInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_GetInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_GetInfo(p, r.in.path, r.in.server, r.in.share, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_GetInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Enum(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Enum r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Enum"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Enum(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.info = r.in.info; + r.out.total = r.in.total; + r.out.result = _dfs_Enum(p, r.in.level, r.in.bufsize, r.in.info, r.in.unknown, r.in.total); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Enum(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Rename(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Rename r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Rename"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Rename(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Rename(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Rename(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Move(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Move r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Move"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Move(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Move(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Move(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_ManagerGetConfigInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_ManagerGetConfigInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerGetConfigInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_ManagerGetConfigInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_ManagerGetConfigInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_ManagerGetConfigInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_ManagerSendSiteInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_ManagerSendSiteInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerSendSiteInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_ManagerSendSiteInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_ManagerSendSiteInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_ManagerSendSiteInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_AddFtRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_AddFtRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddFtRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_AddFtRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_AddFtRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_AddFtRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_RemoveFtRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_RemoveFtRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_RemoveFtRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_RemoveFtRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_RemoveFtRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_RemoveFtRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_AddStdRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_AddStdRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddStdRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_AddStdRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_AddStdRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_AddStdRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_RemoveStdRoot(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_RemoveStdRoot r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_RemoveStdRoot"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_RemoveStdRoot(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_RemoveStdRoot(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_RemoveStdRoot(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_ManagerInitialize(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_ManagerInitialize r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_ManagerInitialize"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_ManagerInitialize(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_ManagerInitialize(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_ManagerInitialize(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_AddStdRootForced(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_AddStdRootForced r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_AddStdRootForced"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_AddStdRootForced(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_AddStdRootForced(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_AddStdRootForced(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_GetDcAddress(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_GetDcAddress r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_GetDcAddress"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_GetDcAddress(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_GetDcAddress(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_GetDcAddress(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_SetDcAddress(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_SetDcAddress r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetDcAddress"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_SetDcAddress(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_SetDcAddress(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_SetDcAddress(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_FlushFtTable(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_FlushFtTable r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_FlushFtTable"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_FlushFtTable(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_FlushFtTable(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_FlushFtTable(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Add2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Add2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Add2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Add2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Add2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Add2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_Remove2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_Remove2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_Remove2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_Remove2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_Remove2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_Remove2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_EnumEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_EnumEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_EnumEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_EnumEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.info = r.in.info; + r.out.total = r.in.total; + r.out.result = _dfs_EnumEx(p, r.in.name, r.in.level, r.in.bufsize, r.in.info, r.in.total); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_EnumEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_dfs_SetInfo2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct dfs_SetInfo2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_dfs_SetInfo2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_dfs_SetInfo2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _dfs_SetInfo2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_dfs_SetInfo2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_netdfs_cmds[] = +{ + {"DFS_GETMANAGERVERSION", DCERPC_DFS_GETMANAGERVERSION, api_dfs_GetManagerVersion}, + {"DFS_ADD", DCERPC_DFS_ADD, api_dfs_Add}, + {"DFS_REMOVE", DCERPC_DFS_REMOVE, api_dfs_Remove}, + {"DFS_SETINFO", DCERPC_DFS_SETINFO, api_dfs_SetInfo}, + {"DFS_GETINFO", DCERPC_DFS_GETINFO, api_dfs_GetInfo}, + {"DFS_ENUM", DCERPC_DFS_ENUM, api_dfs_Enum}, + {"DFS_RENAME", DCERPC_DFS_RENAME, api_dfs_Rename}, + {"DFS_MOVE", DCERPC_DFS_MOVE, api_dfs_Move}, + {"DFS_MANAGERGETCONFIGINFO", DCERPC_DFS_MANAGERGETCONFIGINFO, api_dfs_ManagerGetConfigInfo}, + {"DFS_MANAGERSENDSITEINFO", DCERPC_DFS_MANAGERSENDSITEINFO, api_dfs_ManagerSendSiteInfo}, + {"DFS_ADDFTROOT", DCERPC_DFS_ADDFTROOT, api_dfs_AddFtRoot}, + {"DFS_REMOVEFTROOT", DCERPC_DFS_REMOVEFTROOT, api_dfs_RemoveFtRoot}, + {"DFS_ADDSTDROOT", DCERPC_DFS_ADDSTDROOT, api_dfs_AddStdRoot}, + {"DFS_REMOVESTDROOT", DCERPC_DFS_REMOVESTDROOT, api_dfs_RemoveStdRoot}, + {"DFS_MANAGERINITIALIZE", DCERPC_DFS_MANAGERINITIALIZE, api_dfs_ManagerInitialize}, + {"DFS_ADDSTDROOTFORCED", DCERPC_DFS_ADDSTDROOTFORCED, api_dfs_AddStdRootForced}, + {"DFS_GETDCADDRESS", DCERPC_DFS_GETDCADDRESS, api_dfs_GetDcAddress}, + {"DFS_SETDCADDRESS", DCERPC_DFS_SETDCADDRESS, api_dfs_SetDcAddress}, + {"DFS_FLUSHFTTABLE", DCERPC_DFS_FLUSHFTTABLE, api_dfs_FlushFtTable}, + {"DFS_ADD2", DCERPC_DFS_ADD2, api_dfs_Add2}, + {"DFS_REMOVE2", DCERPC_DFS_REMOVE2, api_dfs_Remove2}, + {"DFS_ENUMEX", DCERPC_DFS_ENUMEX, api_dfs_EnumEx}, + {"DFS_SETINFO2", DCERPC_DFS_SETINFO2, api_dfs_SetInfo2}, +}; + +void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_netdfs_cmds; + *n_fns = sizeof(api_netdfs_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netdfs", "netdfs", api_netdfs_cmds, sizeof(api_netdfs_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_dfs.h b/source3/librpc/gen_ndr/srv_dfs.h new file mode 100644 index 0000000000..6806be07e6 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_dfs.h @@ -0,0 +1,29 @@ +#include "librpc/gen_ndr/ndr_dfs.h" +#ifndef __SRV_NETDFS__ +#define __SRV_NETDFS__ +void _dfs_GetManagerVersion(pipes_struct *p, uint32_t *exist_flag); +WERROR _dfs_Add(pipes_struct *p, const char *path, const char *server, const char *share, const char *comment, uint32_t flags); +WERROR _dfs_Remove(pipes_struct *p, const char *path, const char *server, const char *share); +WERROR _dfs_SetInfo(pipes_struct *p); +WERROR _dfs_GetInfo(pipes_struct *p, const char *path, const char *server, const char *share, uint32_t level, union dfs_Info *info); +WERROR _dfs_Enum(pipes_struct *p, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *unknown, uint32_t *total); +WERROR _dfs_Rename(pipes_struct *p); +WERROR _dfs_Move(pipes_struct *p); +WERROR _dfs_ManagerGetConfigInfo(pipes_struct *p); +WERROR _dfs_ManagerSendSiteInfo(pipes_struct *p); +WERROR _dfs_AddFtRoot(pipes_struct *p); +WERROR _dfs_RemoveFtRoot(pipes_struct *p); +WERROR _dfs_AddStdRoot(pipes_struct *p); +WERROR _dfs_RemoveStdRoot(pipes_struct *p); +WERROR _dfs_ManagerInitialize(pipes_struct *p); +WERROR _dfs_AddStdRootForced(pipes_struct *p); +WERROR _dfs_GetDcAddress(pipes_struct *p); +WERROR _dfs_SetDcAddress(pipes_struct *p); +WERROR _dfs_FlushFtTable(pipes_struct *p); +WERROR _dfs_Add2(pipes_struct *p); +WERROR _dfs_Remove2(pipes_struct *p); +WERROR _dfs_EnumEx(pipes_struct *p, const char *name, uint32_t level, uint32_t bufsize, struct dfs_EnumStruct *info, uint32_t *total); +WERROR _dfs_SetInfo2(pipes_struct *p); +void netdfs_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_NETDFS__ */ diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c new file mode 100644 index 0000000000..20d564b65f --- /dev/null +++ b/source3/librpc/gen_ndr/srv_lsa.c @@ -0,0 +1,4233 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_lsa.h" + +static BOOL api_lsa_Close(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_Close r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_Close"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_Close(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.handle = r.in.handle; + r.out.result = _lsa_Close(p, r.in.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_Close(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_Delete(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_Delete r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_Delete"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_Delete(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_Delete(p, r.in.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_Delete(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumPrivs(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumPrivs r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumPrivs"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumPrivs(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumPrivs(p, r.in.handle, r.in.resume_handle, r.in.max_count, r.out.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumPrivs(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QuerySecurity(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QuerySecurity r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QuerySecurity"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QuerySecurity(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QuerySecurity(p, r.in.handle, r.in.sec_info, r.out.sdbuf); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QuerySecurity(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetSecObj(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetSecObj r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetSecObj"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetSecObj(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetSecObj(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetSecObj(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_ChangePassword(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_ChangePassword r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_ChangePassword"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_ChangePassword(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_ChangePassword(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_ChangePassword(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenPolicy(p, r.in.system_name, r.in.attr, r.in.access_mask, r.out.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryInfoPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryInfoPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryInfoPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryInfoPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryInfoPolicy(p, r.in.handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryInfoPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetInfoPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetInfoPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetInfoPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetInfoPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetInfoPolicy(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetInfoPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_ClearAuditLog(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_ClearAuditLog r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_ClearAuditLog"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_ClearAuditLog(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_ClearAuditLog(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_ClearAuditLog(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateAccount(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.acct_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumAccounts(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumAccounts r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumAccounts"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumAccounts(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumAccounts(p, r.in.handle, r.in.resume_handle, r.in.num_entries, r.out.sids); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumAccounts(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateTrustedDomain(p, r.in.handle, r.in.info, r.in.access_mask, r.out.trustdom_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumTrustDom(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumTrustDom r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumTrustDom"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumTrustDom(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumTrustDom(p, r.in.handle, r.in.resume_handle, r.in.max_size, r.out.domains); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumTrustDom(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupSids(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupSids r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupSids"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupSids(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.names = r.in.names; + r.out.count = r.in.count; + r.out.result = _lsa_LookupSids(p, r.in.handle, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupSids(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateSecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateSecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateSecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateSecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateSecret(p, r.in.handle, r.in.name, r.in.access_mask, r.out.sec_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateSecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenAccount(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.acct_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumPrivsAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumPrivsAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumPrivsAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumPrivsAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_EnumPrivsAccount(p, r.in.handle, r.out.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumPrivsAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_AddPrivilegesToAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_AddPrivilegesToAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_AddPrivilegesToAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_AddPrivilegesToAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_AddPrivilegesToAccount(p, r.in.handle, r.in.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_AddPrivilegesToAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_RemovePrivilegesFromAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_RemovePrivilegesFromAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_RemovePrivilegesFromAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_RemovePrivilegesFromAccount(p, r.in.handle, r.in.remove_all, r.in.privs); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_RemovePrivilegesFromAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_GetQuotasForAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_GetQuotasForAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_GetQuotasForAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_GetQuotasForAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_GetQuotasForAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_GetQuotasForAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetQuotasForAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetQuotasForAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetQuotasForAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetQuotasForAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetQuotasForAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetQuotasForAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_GetSystemAccessAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_GetSystemAccessAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_GetSystemAccessAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_GetSystemAccessAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_GetSystemAccessAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_GetSystemAccessAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetSystemAccessAccount(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetSystemAccessAccount r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetSystemAccessAccount"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetSystemAccessAccount(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetSystemAccessAccount(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetSystemAccessAccount(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenTrustedDomain(p, r.in.handle, r.in.sid, r.in.access_mask, r.out.trustdom_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryTrustedDomainInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryTrustedDomainInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryTrustedDomainInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryTrustedDomainInfo(p, r.in.trustdom_handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryTrustedDomainInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetInformationTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetInformationTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetInformationTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetInformationTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetInformationTrustedDomain(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetInformationTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenSecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenSecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenSecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenSecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenSecret(p, r.in.handle, r.in.name, r.in.access_mask, r.out.sec_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenSecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetSecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetSecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetSecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetSecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetSecret(p, r.in.sec_handle, r.in.new_val, r.in.old_val); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetSecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QuerySecret(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QuerySecret r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QuerySecret"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QuerySecret(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.new_val = r.in.new_val; + r.out.new_mtime = r.in.new_mtime; + r.out.old_val = r.in.old_val; + r.out.old_mtime = r.in.old_mtime; + r.out.result = _lsa_QuerySecret(p, r.in.sec_handle, r.in.new_val, r.in.new_mtime, r.in.old_val, r.in.old_mtime); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QuerySecret(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupPrivValue(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupPrivValue r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupPrivValue"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupPrivValue(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LookupPrivValue(p, r.in.handle, r.in.name, r.out.luid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupPrivValue(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupPrivName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupPrivName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupPrivName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupPrivName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LookupPrivName(p, r.in.handle, r.in.luid, r.out.name); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupPrivName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupPrivDisplayName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupPrivDisplayName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupPrivDisplayName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupPrivDisplayName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.language_id = r.in.language_id; + r.out.result = _lsa_LookupPrivDisplayName(p, r.in.handle, r.in.name, r.out.disp_name, r.in.language_id, r.in.unknown); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupPrivDisplayName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_DeleteObject(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_DeleteObject r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_DeleteObject"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_DeleteObject(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_DeleteObject(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_DeleteObject(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumAccountsWithUserRight(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumAccountsWithUserRight r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumAccountsWithUserRight"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumAccountsWithUserRight(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_EnumAccountsWithUserRight(p, r.in.handle, r.in.name, r.out.sids); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumAccountsWithUserRight(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumAccountRights(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumAccountRights r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumAccountRights"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumAccountRights(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_EnumAccountRights(p, r.in.handle, r.in.sid, r.out.rights); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumAccountRights(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_AddAccountRights(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_AddAccountRights r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_AddAccountRights"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_AddAccountRights(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_AddAccountRights(p, r.in.handle, r.in.sid, r.in.rights); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_AddAccountRights(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_RemoveAccountRights(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_RemoveAccountRights r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_RemoveAccountRights"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_RemoveAccountRights(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_RemoveAccountRights(p, r.in.handle, r.in.sid, r.in.unknown, r.in.rights); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_RemoveAccountRights(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfoBySid r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryTrustedDomainInfoBySid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryTrustedDomainInfoBySid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryTrustedDomainInfoBySid(p, r.in.handle, r.in.dom_sid, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryTrustedDomainInfoBySid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetTrustedDomainInfo(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetTrustedDomainInfo r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetTrustedDomainInfo"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetTrustedDomainInfo(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetTrustedDomainInfo(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetTrustedDomainInfo(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_DeleteTrustedDomain(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_DeleteTrustedDomain r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_DeleteTrustedDomain"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_DeleteTrustedDomain(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_DeleteTrustedDomain(p, r.in.handle, r.in.dom_sid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_DeleteTrustedDomain(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_StorePrivateData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_StorePrivateData r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_StorePrivateData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_StorePrivateData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_StorePrivateData(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_StorePrivateData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_RetrievePrivateData(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_RetrievePrivateData r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_RetrievePrivateData"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_RetrievePrivateData(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_RetrievePrivateData(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_RetrievePrivateData(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenPolicy2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenPolicy2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenPolicy2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenPolicy2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenPolicy2(p, r.in.system_name, r.in.attr, r.in.access_mask, r.out.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenPolicy2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_GetUserName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_GetUserName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_GetUserName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_GetUserName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.account_name = r.in.account_name; + r.out.authority_name = r.in.authority_name; + r.out.result = _lsa_GetUserName(p, r.in.system_name, r.in.account_name, r.in.authority_name); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_GetUserName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryInfoPolicy2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryInfoPolicy2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryInfoPolicy2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryInfoPolicy2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryInfoPolicy2(p, r.in.handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryInfoPolicy2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetInfoPolicy2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetInfoPolicy2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetInfoPolicy2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetInfoPolicy2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetInfoPolicy2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetInfoPolicy2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryTrustedDomainInfoByName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryTrustedDomainInfoByName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryTrustedDomainInfoByName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryTrustedDomainInfoByName(p, r.in.handle, r.in.trusted_domain, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryTrustedDomainInfoByName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetTrustedDomainInfoByName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetTrustedDomainInfoByName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetTrustedDomainInfoByName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetTrustedDomainInfoByName(p, r.in.handle, r.in.trusted_domain, r.in.level, r.in.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetTrustedDomainInfoByName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_EnumTrustedDomainsEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_EnumTrustedDomainsEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_EnumTrustedDomainsEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_EnumTrustedDomainsEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.resume_handle = r.in.resume_handle; + r.out.result = _lsa_EnumTrustedDomainsEx(p, r.in.handle, r.in.resume_handle, r.out.domains, r.in.max_size); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_EnumTrustedDomainsEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateTrustedDomainEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateTrustedDomainEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateTrustedDomainEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateTrustedDomainEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateTrustedDomainEx(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateTrustedDomainEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CloseTrustedDomainEx(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CloseTrustedDomainEx r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CloseTrustedDomainEx"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CloseTrustedDomainEx(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.handle = r.in.handle; + r.out.result = _lsa_CloseTrustedDomainEx(p, r.in.handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CloseTrustedDomainEx(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_QueryDomainInformationPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_QueryDomainInformationPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_QueryDomainInformationPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_QueryDomainInformationPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_QueryDomainInformationPolicy(p, r.in.handle, r.in.level, r.out.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_QueryDomainInformationPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_SetDomainInformationPolicy(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_SetDomainInformationPolicy r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_SetDomainInformationPolicy"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_SetDomainInformationPolicy(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_SetDomainInformationPolicy(p, r.in.handle, r.in.level, r.in.info); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_SetDomainInformationPolicy(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_OpenTrustedDomainByName(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_OpenTrustedDomainByName r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_OpenTrustedDomainByName"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_OpenTrustedDomainByName(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_OpenTrustedDomainByName(p, r.in.handle, r.in.name, r.in.access_mask, r.out.trustdom_handle); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_OpenTrustedDomainByName(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_TestCall(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_TestCall r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_TestCall"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_TestCall(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_TestCall(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_TestCall(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupSids2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupSids2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupSids2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupSids2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.names = r.in.names; + r.out.count = r.in.count; + r.out.result = _lsa_LookupSids2(p, r.in.handle, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupSids2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames2(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CreateTrustedDomainEx2(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CreateTrustedDomainEx2 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CreateTrustedDomainEx2"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CreateTrustedDomainEx2(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CreateTrustedDomainEx2(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CreateTrustedDomainEx2(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRWRITE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRWRITE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRWRITE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRWRITE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRWRITE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRWRITE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRREAD(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRREAD r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRREAD"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRREAD(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRREAD(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRREAD(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRENUMERATE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRENUMERATE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRENUMERATE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRENUMERATE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRENUMERATE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRENUMERATE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRWRITEDOMAINCREDENTIALS r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRWRITEDOMAINCREDENTIALS"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRWRITEDOMAINCREDENTIALS(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRWRITEDOMAINCREDENTIALS(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRREADDOMAINCREDENTIALS r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRREADDOMAINCREDENTIALS"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRREADDOMAINCREDENTIALS(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRREADDOMAINCREDENTIALS(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRDELETE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRDELETE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRDELETE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRDELETE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRDELETE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRDELETE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRGETTARGETINFO(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRGETTARGETINFO r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRGETTARGETINFO"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRGETTARGETINFO(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRGETTARGETINFO(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRGETTARGETINFO(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRPROFILELOADED(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRPROFILELOADED r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRPROFILELOADED"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRPROFILELOADED(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRPROFILELOADED(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRPROFILELOADED(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames3(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames3 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames3"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames3(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames3(p, r.in.handle, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames3(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRGETSESSIONTYPES r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRGETSESSIONTYPES"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRGETSESSIONTYPES(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRGETSESSIONTYPES(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRGETSESSIONTYPES(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARREGISTERAUDITEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARREGISTERAUDITEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARREGISTERAUDITEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARREGISTERAUDITEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARREGISTERAUDITEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARGENAUDITEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARGENAUDITEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARGENAUDITEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARGENAUDITEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARGENAUDITEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARGENAUDITEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARUNREGISTERAUDITEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARUNREGISTERAUDITEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARUNREGISTERAUDITEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARUNREGISTERAUDITEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARUNREGISTERAUDITEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARQUERYFORESTTRUSTINFORMATION r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARQUERYFORESTTRUSTINFORMATION"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARQUERYFORESTTRUSTINFORMATION(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARQUERYFORESTTRUSTINFORMATION(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARQUERYFORESTTRUSTINFORMATION(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARSETFORESTTRUSTINFORMATION r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARSETFORESTTRUSTINFORMATION"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARSETFORESTTRUSTINFORMATION(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARSETFORESTTRUSTINFORMATION(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_CREDRRENAME(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_CREDRRENAME r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_CREDRRENAME"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_CREDRRENAME(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_CREDRRENAME(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_CREDRRENAME(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupSids3(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupSids3 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupSids3"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupSids3(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.names = r.in.names; + r.out.count = r.in.count; + r.out.result = _lsa_LookupSids3(p, r.in.sids, r.out.domains, r.in.names, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupSids3(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LookupNames4(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LookupNames4 r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LookupNames4"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LookupNames4(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.sids = r.in.sids; + r.out.count = r.in.count; + r.out.result = _lsa_LookupNames4(p, r.in.num_names, r.in.names, r.out.domains, r.in.sids, r.in.level, r.in.count, r.in.unknown1, r.in.unknown2); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LookupNames4(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSAROPENPOLICYSCE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSAROPENPOLICYSCE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSAROPENPOLICYSCE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSAROPENPOLICYSCE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSAROPENPOLICYSCE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct lsa_LSARADTREPORTSECURITYEVENT r; + TALLOC_CTX *mem_ctx = talloc_init("api_lsa_LSARADTREPORTSECURITYEVENT"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_lsa_LSARADTREPORTSECURITYEVENT(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _lsa_LSARADTREPORTSECURITYEVENT(p); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_lsa_LSARADTREPORTSECURITYEVENT(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_lsarpc_cmds[] = +{ + {"LSA_CLOSE", DCERPC_LSA_CLOSE, api_lsa_Close}, + {"LSA_DELETE", DCERPC_LSA_DELETE, api_lsa_Delete}, + {"LSA_ENUMPRIVS", DCERPC_LSA_ENUMPRIVS, api_lsa_EnumPrivs}, + {"LSA_QUERYSECURITY", DCERPC_LSA_QUERYSECURITY, api_lsa_QuerySecurity}, + {"LSA_SETSECOBJ", DCERPC_LSA_SETSECOBJ, api_lsa_SetSecObj}, + {"LSA_CHANGEPASSWORD", DCERPC_LSA_CHANGEPASSWORD, api_lsa_ChangePassword}, + {"LSA_OPENPOLICY", DCERPC_LSA_OPENPOLICY, api_lsa_OpenPolicy}, + {"LSA_QUERYINFOPOLICY", DCERPC_LSA_QUERYINFOPOLICY, api_lsa_QueryInfoPolicy}, + {"LSA_SETINFOPOLICY", DCERPC_LSA_SETINFOPOLICY, api_lsa_SetInfoPolicy}, + {"LSA_CLEARAUDITLOG", DCERPC_LSA_CLEARAUDITLOG, api_lsa_ClearAuditLog}, + {"LSA_CREATEACCOUNT", DCERPC_LSA_CREATEACCOUNT, api_lsa_CreateAccount}, + {"LSA_ENUMACCOUNTS", DCERPC_LSA_ENUMACCOUNTS, api_lsa_EnumAccounts}, + {"LSA_CREATETRUSTEDDOMAIN", DCERPC_LSA_CREATETRUSTEDDOMAIN, api_lsa_CreateTrustedDomain}, + {"LSA_ENUMTRUSTDOM", DCERPC_LSA_ENUMTRUSTDOM, api_lsa_EnumTrustDom}, + {"LSA_LOOKUPNAMES", DCERPC_LSA_LOOKUPNAMES, api_lsa_LookupNames}, + {"LSA_LOOKUPSIDS", DCERPC_LSA_LOOKUPSIDS, api_lsa_LookupSids}, + {"LSA_CREATESECRET", DCERPC_LSA_CREATESECRET, api_lsa_CreateSecret}, + {"LSA_OPENACCOUNT", DCERPC_LSA_OPENACCOUNT, api_lsa_OpenAccount}, + {"LSA_ENUMPRIVSACCOUNT", DCERPC_LSA_ENUMPRIVSACCOUNT, api_lsa_EnumPrivsAccount}, + {"LSA_ADDPRIVILEGESTOACCOUNT", DCERPC_LSA_ADDPRIVILEGESTOACCOUNT, api_lsa_AddPrivilegesToAccount}, + {"LSA_REMOVEPRIVILEGESFROMACCOUNT", DCERPC_LSA_REMOVEPRIVILEGESFROMACCOUNT, api_lsa_RemovePrivilegesFromAccount}, + {"LSA_GETQUOTASFORACCOUNT", DCERPC_LSA_GETQUOTASFORACCOUNT, api_lsa_GetQuotasForAccount}, + {"LSA_SETQUOTASFORACCOUNT", DCERPC_LSA_SETQUOTASFORACCOUNT, api_lsa_SetQuotasForAccount}, + {"LSA_GETSYSTEMACCESSACCOUNT", DCERPC_LSA_GETSYSTEMACCESSACCOUNT, api_lsa_GetSystemAccessAccount}, + {"LSA_SETSYSTEMACCESSACCOUNT", DCERPC_LSA_SETSYSTEMACCESSACCOUNT, api_lsa_SetSystemAccessAccount}, + {"LSA_OPENTRUSTEDDOMAIN", DCERPC_LSA_OPENTRUSTEDDOMAIN, api_lsa_OpenTrustedDomain}, + {"LSA_QUERYTRUSTEDDOMAININFO", DCERPC_LSA_QUERYTRUSTEDDOMAININFO, api_lsa_QueryTrustedDomainInfo}, + {"LSA_SETINFORMATIONTRUSTEDDOMAIN", DCERPC_LSA_SETINFORMATIONTRUSTEDDOMAIN, api_lsa_SetInformationTrustedDomain}, + {"LSA_OPENSECRET", DCERPC_LSA_OPENSECRET, api_lsa_OpenSecret}, + {"LSA_SETSECRET", DCERPC_LSA_SETSECRET, api_lsa_SetSecret}, + {"LSA_QUERYSECRET", DCERPC_LSA_QUERYSECRET, api_lsa_QuerySecret}, + {"LSA_LOOKUPPRIVVALUE", DCERPC_LSA_LOOKUPPRIVVALUE, api_lsa_LookupPrivValue}, + {"LSA_LOOKUPPRIVNAME", DCERPC_LSA_LOOKUPPRIVNAME, api_lsa_LookupPrivName}, + {"LSA_LOOKUPPRIVDISPLAYNAME", DCERPC_LSA_LOOKUPPRIVDISPLAYNAME, api_lsa_LookupPrivDisplayName}, + {"LSA_DELETEOBJECT", DCERPC_LSA_DELETEOBJECT, api_lsa_DeleteObject}, + {"LSA_ENUMACCOUNTSWITHUSERRIGHT", DCERPC_LSA_ENUMACCOUNTSWITHUSERRIGHT, api_lsa_EnumAccountsWithUserRight}, + {"LSA_ENUMACCOUNTRIGHTS", DCERPC_LSA_ENUMACCOUNTRIGHTS, api_lsa_EnumAccountRights}, + {"LSA_ADDACCOUNTRIGHTS", DCERPC_LSA_ADDACCOUNTRIGHTS, api_lsa_AddAccountRights}, + {"LSA_REMOVEACCOUNTRIGHTS", DCERPC_LSA_REMOVEACCOUNTRIGHTS, api_lsa_RemoveAccountRights}, + {"LSA_QUERYTRUSTEDDOMAININFOBYSID", DCERPC_LSA_QUERYTRUSTEDDOMAININFOBYSID, api_lsa_QueryTrustedDomainInfoBySid}, + {"LSA_SETTRUSTEDDOMAININFO", DCERPC_LSA_SETTRUSTEDDOMAININFO, api_lsa_SetTrustedDomainInfo}, + {"LSA_DELETETRUSTEDDOMAIN", DCERPC_LSA_DELETETRUSTEDDOMAIN, api_lsa_DeleteTrustedDomain}, + {"LSA_STOREPRIVATEDATA", DCERPC_LSA_STOREPRIVATEDATA, api_lsa_StorePrivateData}, + {"LSA_RETRIEVEPRIVATEDATA", DCERPC_LSA_RETRIEVEPRIVATEDATA, api_lsa_RetrievePrivateData}, + {"LSA_OPENPOLICY2", DCERPC_LSA_OPENPOLICY2, api_lsa_OpenPolicy2}, + {"LSA_GETUSERNAME", DCERPC_LSA_GETUSERNAME, api_lsa_GetUserName}, + {"LSA_QUERYINFOPOLICY2", DCERPC_LSA_QUERYINFOPOLICY2, api_lsa_QueryInfoPolicy2}, + {"LSA_SETINFOPOLICY2", DCERPC_LSA_SETINFOPOLICY2, api_lsa_SetInfoPolicy2}, + {"LSA_QUERYTRUSTEDDOMAININFOBYNAME", DCERPC_LSA_QUERYTRUSTEDDOMAININFOBYNAME, api_lsa_QueryTrustedDomainInfoByName}, + {"LSA_SETTRUSTEDDOMAININFOBYNAME", DCERPC_LSA_SETTRUSTEDDOMAININFOBYNAME, api_lsa_SetTrustedDomainInfoByName}, + {"LSA_ENUMTRUSTEDDOMAINSEX", DCERPC_LSA_ENUMTRUSTEDDOMAINSEX, api_lsa_EnumTrustedDomainsEx}, + {"LSA_CREATETRUSTEDDOMAINEX", DCERPC_LSA_CREATETRUSTEDDOMAINEX, api_lsa_CreateTrustedDomainEx}, + {"LSA_CLOSETRUSTEDDOMAINEX", DCERPC_LSA_CLOSETRUSTEDDOMAINEX, api_lsa_CloseTrustedDomainEx}, + {"LSA_QUERYDOMAININFORMATIONPOLICY", DCERPC_LSA_QUERYDOMAININFORMATIONPOLICY, api_lsa_QueryDomainInformationPolicy}, + {"LSA_SETDOMAININFORMATIONPOLICY", DCERPC_LSA_SETDOMAININFORMATIONPOLICY, api_lsa_SetDomainInformationPolicy}, + {"LSA_OPENTRUSTEDDOMAINBYNAME", DCERPC_LSA_OPENTRUSTEDDOMAINBYNAME, api_lsa_OpenTrustedDomainByName}, + {"LSA_TESTCALL", DCERPC_LSA_TESTCALL, api_lsa_TestCall}, + {"LSA_LOOKUPSIDS2", DCERPC_LSA_LOOKUPSIDS2, api_lsa_LookupSids2}, + {"LSA_LOOKUPNAMES2", DCERPC_LSA_LOOKUPNAMES2, api_lsa_LookupNames2}, + {"LSA_CREATETRUSTEDDOMAINEX2", DCERPC_LSA_CREATETRUSTEDDOMAINEX2, api_lsa_CreateTrustedDomainEx2}, + {"LSA_CREDRWRITE", DCERPC_LSA_CREDRWRITE, api_lsa_CREDRWRITE}, + {"LSA_CREDRREAD", DCERPC_LSA_CREDRREAD, api_lsa_CREDRREAD}, + {"LSA_CREDRENUMERATE", DCERPC_LSA_CREDRENUMERATE, api_lsa_CREDRENUMERATE}, + {"LSA_CREDRWRITEDOMAINCREDENTIALS", DCERPC_LSA_CREDRWRITEDOMAINCREDENTIALS, api_lsa_CREDRWRITEDOMAINCREDENTIALS}, + {"LSA_CREDRREADDOMAINCREDENTIALS", DCERPC_LSA_CREDRREADDOMAINCREDENTIALS, api_lsa_CREDRREADDOMAINCREDENTIALS}, + {"LSA_CREDRDELETE", DCERPC_LSA_CREDRDELETE, api_lsa_CREDRDELETE}, + {"LSA_CREDRGETTARGETINFO", DCERPC_LSA_CREDRGETTARGETINFO, api_lsa_CREDRGETTARGETINFO}, + {"LSA_CREDRPROFILELOADED", DCERPC_LSA_CREDRPROFILELOADED, api_lsa_CREDRPROFILELOADED}, + {"LSA_LOOKUPNAMES3", DCERPC_LSA_LOOKUPNAMES3, api_lsa_LookupNames3}, + {"LSA_CREDRGETSESSIONTYPES", DCERPC_LSA_CREDRGETSESSIONTYPES, api_lsa_CREDRGETSESSIONTYPES}, + {"LSA_LSARREGISTERAUDITEVENT", DCERPC_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT}, + {"LSA_LSARGENAUDITEVENT", DCERPC_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT}, + {"LSA_LSARUNREGISTERAUDITEVENT", DCERPC_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT}, + {"LSA_LSARQUERYFORESTTRUSTINFORMATION", DCERPC_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_LSARQUERYFORESTTRUSTINFORMATION}, + {"LSA_LSARSETFORESTTRUSTINFORMATION", DCERPC_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION}, + {"LSA_CREDRRENAME", DCERPC_LSA_CREDRRENAME, api_lsa_CREDRRENAME}, + {"LSA_LOOKUPSIDS3", DCERPC_LSA_LOOKUPSIDS3, api_lsa_LookupSids3}, + {"LSA_LOOKUPNAMES4", DCERPC_LSA_LOOKUPNAMES4, api_lsa_LookupNames4}, + {"LSA_LSAROPENPOLICYSCE", DCERPC_LSA_LSAROPENPOLICYSCE, api_lsa_LSAROPENPOLICYSCE}, + {"LSA_LSARADTREGISTERSECURITYEVENTSOURCE", DCERPC_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE}, + {"LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE", DCERPC_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE}, + {"LSA_LSARADTREPORTSECURITYEVENT", DCERPC_LSA_LSARADTREPORTSECURITYEVENT, api_lsa_LSARADTREPORTSECURITYEVENT}, +}; + +void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_lsarpc_cmds; + *n_fns = sizeof(api_lsarpc_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_lsa.h b/source3/librpc/gen_ndr/srv_lsa.h new file mode 100644 index 0000000000..b6fdf5f1d3 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_lsa.h @@ -0,0 +1,88 @@ +#include "librpc/gen_ndr/ndr_lsa.h" +#ifndef __SRV_LSARPC__ +#define __SRV_LSARPC__ +NTSTATUS _lsa_Close(pipes_struct *p, struct policy_handle *handle); +NTSTATUS _lsa_Delete(pipes_struct *p, struct policy_handle *handle); +NTSTATUS _lsa_EnumPrivs(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, uint32_t max_count, struct lsa_PrivArray *privs); +NTSTATUS _lsa_QuerySecurity(pipes_struct *p, struct policy_handle *handle, uint32_t sec_info, struct sec_desc_buf *sdbuf); +NTSTATUS _lsa_SetSecObj(pipes_struct *p); +NTSTATUS _lsa_ChangePassword(pipes_struct *p); +NTSTATUS _lsa_OpenPolicy(pipes_struct *p, uint16_t *system_name, struct lsa_ObjectAttribute *attr, uint32_t access_mask, struct policy_handle *handle); +NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_PolicyInformation *info); +NTSTATUS _lsa_SetInfoPolicy(pipes_struct *p); +NTSTATUS _lsa_ClearAuditLog(pipes_struct *p); +NTSTATUS _lsa_CreateAccount(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, struct policy_handle *acct_handle); +NTSTATUS _lsa_EnumAccounts(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, uint32_t num_entries, struct lsa_SidArray *sids); +NTSTATUS _lsa_CreateTrustedDomain(pipes_struct *p, struct policy_handle *handle, struct lsa_DomainInfo *info, uint32_t access_mask, struct policy_handle *trustdom_handle); +NTSTATUS _lsa_EnumTrustDom(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, uint32_t max_size, struct lsa_DomainList *domains); +NTSTATUS _lsa_LookupNames(pipes_struct *p, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray *sids, uint16_t level, uint32_t *count); +NTSTATUS _lsa_LookupSids(pipes_struct *p, struct policy_handle *handle, struct lsa_SidArray *sids, struct lsa_RefDomainList *domains, struct lsa_TransNameArray *names, uint16_t level, uint32_t *count); +NTSTATUS _lsa_CreateSecret(pipes_struct *p, struct policy_handle *handle, struct lsa_String name, uint32_t access_mask, struct policy_handle *sec_handle); +NTSTATUS _lsa_OpenAccount(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, struct policy_handle *acct_handle); +NTSTATUS _lsa_EnumPrivsAccount(pipes_struct *p, struct policy_handle *handle, struct lsa_PrivilegeSet *privs); +NTSTATUS _lsa_AddPrivilegesToAccount(pipes_struct *p, struct policy_handle *handle, struct lsa_PrivilegeSet *privs); +NTSTATUS _lsa_RemovePrivilegesFromAccount(pipes_struct *p, struct policy_handle *handle, uint8_t remove_all, struct lsa_PrivilegeSet *privs); +NTSTATUS _lsa_GetQuotasForAccount(pipes_struct *p); +NTSTATUS _lsa_SetQuotasForAccount(pipes_struct *p); +NTSTATUS _lsa_GetSystemAccessAccount(pipes_struct *p); +NTSTATUS _lsa_SetSystemAccessAccount(pipes_struct *p); +NTSTATUS _lsa_OpenTrustedDomain(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, struct policy_handle *trustdom_handle); +NTSTATUS _lsa_QueryTrustedDomainInfo(pipes_struct *p, struct policy_handle *trustdom_handle, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_SetInformationTrustedDomain(pipes_struct *p); +NTSTATUS _lsa_OpenSecret(pipes_struct *p, struct policy_handle *handle, struct lsa_String name, uint32_t access_mask, struct policy_handle *sec_handle); +NTSTATUS _lsa_SetSecret(pipes_struct *p, struct policy_handle *sec_handle, struct lsa_DATA_BUF *new_val, struct lsa_DATA_BUF *old_val); +NTSTATUS _lsa_QuerySecret(pipes_struct *p, struct policy_handle *sec_handle, struct lsa_DATA_BUF_PTR *new_val, NTTIME *new_mtime, struct lsa_DATA_BUF_PTR *old_val, NTTIME *old_mtime); +NTSTATUS _lsa_LookupPrivValue(pipes_struct *p, struct policy_handle *handle, struct lsa_String *name, struct lsa_LUID *luid); +NTSTATUS _lsa_LookupPrivName(pipes_struct *p, struct policy_handle *handle, struct lsa_LUID *luid, struct lsa_StringLarge *name); +NTSTATUS _lsa_LookupPrivDisplayName(pipes_struct *p, struct policy_handle *handle, struct lsa_String *name, struct lsa_StringLarge *disp_name, uint16_t *language_id, uint16_t unknown); +NTSTATUS _lsa_DeleteObject(pipes_struct *p); +NTSTATUS _lsa_EnumAccountsWithUserRight(pipes_struct *p, struct policy_handle *handle, struct lsa_String *name, struct lsa_SidArray *sids); +NTSTATUS _lsa_EnumAccountRights(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, struct lsa_RightSet *rights); +NTSTATUS _lsa_AddAccountRights(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, struct lsa_RightSet *rights); +NTSTATUS _lsa_RemoveAccountRights(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t unknown, struct lsa_RightSet *rights); +NTSTATUS _lsa_QueryTrustedDomainInfoBySid(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *dom_sid, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_SetTrustedDomainInfo(pipes_struct *p); +NTSTATUS _lsa_DeleteTrustedDomain(pipes_struct *p, struct policy_handle *handle, struct dom_sid2 *dom_sid); +NTSTATUS _lsa_StorePrivateData(pipes_struct *p); +NTSTATUS _lsa_RetrievePrivateData(pipes_struct *p); +NTSTATUS _lsa_OpenPolicy2(pipes_struct *p, const char *system_name, struct lsa_ObjectAttribute *attr, uint32_t access_mask, struct policy_handle *handle); +NTSTATUS _lsa_GetUserName(pipes_struct *p, const char *system_name, struct lsa_String *account_name, struct lsa_StringPointer *authority_name); +NTSTATUS _lsa_QueryInfoPolicy2(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_PolicyInformation *info); +NTSTATUS _lsa_SetInfoPolicy2(pipes_struct *p); +NTSTATUS _lsa_QueryTrustedDomainInfoByName(pipes_struct *p, struct policy_handle *handle, struct lsa_String trusted_domain, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_SetTrustedDomainInfoByName(pipes_struct *p, struct policy_handle *handle, struct lsa_String trusted_domain, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); +NTSTATUS _lsa_EnumTrustedDomainsEx(pipes_struct *p, struct policy_handle *handle, uint32_t *resume_handle, struct lsa_DomainListEx *domains, uint32_t max_size); +NTSTATUS _lsa_CreateTrustedDomainEx(pipes_struct *p); +NTSTATUS _lsa_CloseTrustedDomainEx(pipes_struct *p, struct policy_handle *handle); +NTSTATUS _lsa_QueryDomainInformationPolicy(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_DomainInformationPolicy *info); +NTSTATUS _lsa_SetDomainInformationPolicy(pipes_struct *p, struct policy_handle *handle, uint16_t level, union lsa_DomainInformationPolicy *info); +NTSTATUS _lsa_OpenTrustedDomainByName(pipes_struct *p, struct policy_handle *handle, struct lsa_String name, uint32_t access_mask, struct policy_handle *trustdom_handle); +NTSTATUS _lsa_TestCall(pipes_struct *p); +NTSTATUS _lsa_LookupSids2(pipes_struct *p, struct policy_handle *handle, struct lsa_SidArray *sids, struct lsa_RefDomainList *domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_LookupNames2(pipes_struct *p, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray2 *sids, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_CreateTrustedDomainEx2(pipes_struct *p); +NTSTATUS _lsa_CREDRWRITE(pipes_struct *p); +NTSTATUS _lsa_CREDRREAD(pipes_struct *p); +NTSTATUS _lsa_CREDRENUMERATE(pipes_struct *p); +NTSTATUS _lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p); +NTSTATUS _lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p); +NTSTATUS _lsa_CREDRDELETE(pipes_struct *p); +NTSTATUS _lsa_CREDRGETTARGETINFO(pipes_struct *p); +NTSTATUS _lsa_CREDRPROFILELOADED(pipes_struct *p); +NTSTATUS _lsa_LookupNames3(pipes_struct *p, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray3 *sids, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_CREDRGETSESSIONTYPES(pipes_struct *p); +NTSTATUS _lsa_LSARREGISTERAUDITEVENT(pipes_struct *p); +NTSTATUS _lsa_LSARGENAUDITEVENT(pipes_struct *p); +NTSTATUS _lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p); +NTSTATUS _lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p); +NTSTATUS _lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p); +NTSTATUS _lsa_CREDRRENAME(pipes_struct *p); +NTSTATUS _lsa_LookupSids3(pipes_struct *p, struct lsa_SidArray *sids, struct lsa_RefDomainList *domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_LookupNames4(pipes_struct *p, uint32_t num_names, struct lsa_String *names, struct lsa_RefDomainList *domains, struct lsa_TransSidArray3 *sids, uint16_t level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); +NTSTATUS _lsa_LSAROPENPOLICYSCE(pipes_struct *p); +NTSTATUS _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p); +NTSTATUS _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p); +NTSTATUS _lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p); +void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_LSARPC__ */ diff --git a/source3/librpc/gen_ndr/srv_unixinfo.c b/source3/librpc/gen_ndr/srv_unixinfo.c new file mode 100644 index 0000000000..1c58e94405 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_unixinfo.c @@ -0,0 +1,280 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_unixinfo.h" + +static BOOL api_unixinfo_SidToUid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_SidToUid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToUid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_SidToUid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_SidToUid(p, r.in.sid, r.out.uid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_SidToUid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_UidToSid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_UidToSid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_UidToSid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_UidToSid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_UidToSid(p, r.in.uid, r.out.sid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_UidToSid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_SidToGid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_SidToGid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_SidToGid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_SidToGid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_SidToGid(p, r.in.sid, r.out.gid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_SidToGid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_GidToSid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_GidToSid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GidToSid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_GidToSid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.result = _unixinfo_GidToSid(p, r.in.gid, r.out.sid); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_GidToSid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + +static BOOL api_unixinfo_GetPWUid(pipes_struct *p) +{ + struct ndr_pull *pull; + struct ndr_push *push; + NTSTATUS status; + DATA_BLOB blob; + struct unixinfo_GetPWUid r; + TALLOC_CTX *mem_ctx = talloc_init("api_unixinfo_GetPWUid"); + + if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + pull = ndr_pull_init_blob(&blob, mem_ctx); + if (pull == NULL) + return False; + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + status = ndr_pull_unixinfo_GetPWUid(pull, NDR_IN, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + r.out.count = r.in.count; + r.out.result = _unixinfo_GetPWUid(p, r.in.count, r.in.uids, r.out.infos); + + push = ndr_push_init_ctx(mem_ctx); + if (push == NULL) { + talloc_free(mem_ctx); + return False; + } + + status = ndr_push_unixinfo_GetPWUid(push, NDR_OUT, &r); + if (NT_STATUS_IS_ERR(status)) { + talloc_free(mem_ctx); + return False; + } + + blob = ndr_push_blob(push); + if (!prs_init_data_blob(&p->out_data.rdata, &blob, p->mem_ctx)) { + talloc_free(mem_ctx); + return False; + } + + talloc_free(mem_ctx); + + return True; +} + + +/* Tables */ +static struct api_struct api_unixinfo_cmds[] = +{ + {"UNIXINFO_SIDTOUID", DCERPC_UNIXINFO_SIDTOUID, api_unixinfo_SidToUid}, + {"UNIXINFO_UIDTOSID", DCERPC_UNIXINFO_UIDTOSID, api_unixinfo_UidToSid}, + {"UNIXINFO_SIDTOGID", DCERPC_UNIXINFO_SIDTOGID, api_unixinfo_SidToGid}, + {"UNIXINFO_GIDTOSID", DCERPC_UNIXINFO_GIDTOSID, api_unixinfo_GidToSid}, + {"UNIXINFO_GETPWUID", DCERPC_UNIXINFO_GETPWUID, api_unixinfo_GetPWUid}, +}; + +void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_unixinfo_cmds; + *n_fns = sizeof(api_unixinfo_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_netdfs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "unixinfo", "unixinfo", api_unixinfo_cmds, sizeof(api_unixinfo_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_unixinfo.h b/source3/librpc/gen_ndr/srv_unixinfo.h new file mode 100644 index 0000000000..751b85162d --- /dev/null +++ b/source3/librpc/gen_ndr/srv_unixinfo.h @@ -0,0 +1,11 @@ +#include "librpc/gen_ndr/ndr_unixinfo.h" +#ifndef __SRV_UNIXINFO__ +#define __SRV_UNIXINFO__ +NTSTATUS _unixinfo_SidToUid(pipes_struct *p, struct dom_sid sid, uint64_t *uid); +NTSTATUS _unixinfo_UidToSid(pipes_struct *p, uint64_t uid, struct dom_sid *sid); +NTSTATUS _unixinfo_SidToGid(pipes_struct *p, struct dom_sid sid, uint64_t *gid); +NTSTATUS _unixinfo_GidToSid(pipes_struct *p, uint64_t gid, struct dom_sid *sid); +NTSTATUS _unixinfo_GetPWUid(pipes_struct *p, uint32_t *count, uint64_t *uids, struct unixinfo_GetPWUidInfo *infos); +void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_netdfs_init(void); +#endif /* __SRV_UNIXINFO__ */ -- cgit