[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-test-1869-g3a32082
Günther Deschner
gd at samba.org
Mon Feb 4 21:13:30 GMT 2008
The branch, v3-2-test has been updated
via 3a32082ef5bb0152545b391ce4cb8ca3a28939da (commit)
via 81e2e3a288fb40bf4ba1b83adf459a0cf6f02ed2 (commit)
via ba167f3c9ce17ff458d8292e73ce3deafdd2e240 (commit)
via c1892bb134084dda935c9846562bcdb082de2f91 (commit)
via 9b2aeeb36903591ea55cfdfe22f32d69703daaf1 (commit)
via 235e440ae6f31f05802e4c8d01174aac880c56cd (commit)
via d7cd8bd2ad5635b0b0823fec08e263f37dea807b (commit)
via c07be0f1a9856dbbb80d0dbacf7b86024eed4436 (commit)
via 6b2f205844b1e2af4c74247fed13d6e383319067 (commit)
via f914fd377165f5580e5cfd0c6a92bbb0216f7352 (commit)
via 33acd160c9c9a82aa39b2ed259e24bbe602d56c6 (commit)
via fc29364abe10d3ec249602cb3437e50294f5de76 (commit)
via b6b226e6365477f855de1e549ef32df452838031 (commit)
via bdf8d562621e1a09bf83e2009dec24966e7fdf22 (commit)
from feddc1447d585fd108d22a36bccc576fa81197ef (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 3a32082ef5bb0152545b391ce4cb8ca3a28939da
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 22:06:27 2008 +0100
Remove unused marshalling for LSA_DELETE_OBJECT.
Guenther
commit 81e2e3a288fb40bf4ba1b83adf459a0cf6f02ed2
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 22:05:48 2008 +0100
Use pidl for (dummy) _lsa_DeleteObject().
Guenther
commit ba167f3c9ce17ff458d8292e73ce3deafdd2e240
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 22:04:36 2008 +0100
Re-run make idl.
Guenther
commit c1892bb134084dda935c9846562bcdb082de2f91
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 22:03:07 2008 +0100
Add IDL for lsa_DeleteObject() (based on samba3 rpc code).
Guenther
commit 9b2aeeb36903591ea55cfdfe22f32d69703daaf1
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 22:02:22 2008 +0100
Remove unused marshalling for LSA_QUERY_SEC_OBJ.
Guenther
commit 235e440ae6f31f05802e4c8d01174aac880c56cd
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:58:34 2008 +0100
Remove some wrong checks for policy handles in rpcclient.
Guenther
commit d7cd8bd2ad5635b0b0823fec08e263f37dea807b
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:56:14 2008 +0100
Fill in IDL for lsa_SetSecObj() (based from samba3 rpc).
Guenther
commit c07be0f1a9856dbbb80d0dbacf7b86024eed4436
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:40:15 2008 +0100
Use rpccli_lsa_QuerySecurity() in rpcclient.
Guenther
commit 6b2f205844b1e2af4c74247fed13d6e383319067
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:13:19 2008 +0100
Use pidl for _lsa_QuerySecurity().
Guenther
commit f914fd377165f5580e5cfd0c6a92bbb0216f7352
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:12:12 2008 +0100
Re-run make idl.
Guenther
commit 33acd160c9c9a82aa39b2ed259e24bbe602d56c6
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:11:08 2008 +0100
Fix IDL for lsa_QuerySecurity().
Guenther
commit fc29364abe10d3ec249602cb3437e50294f5de76
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:00:38 2008 +0100
Use pidl for _lsa_OpenPolicy2().
Guenther
commit b6b226e6365477f855de1e549ef32df452838031
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 21:00:16 2008 +0100
Use pidl for _lsa_OpenPolicy().
Guenther
commit bdf8d562621e1a09bf83e2009dec24966e7fdf22
Author: Günther Deschner <gd at samba.org>
Date: Mon Feb 4 19:43:07 2008 +0100
Use rpccli_samr_Connect2() all over the place.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/include/rpc_lsa.h | 28 -------
source/libnet/libnet_join.c | 12 ++-
source/librpc/gen_ndr/cli_lsa.c | 19 +++--
source/librpc/gen_ndr/cli_lsa.h | 10 ++-
source/librpc/gen_ndr/lsa.h | 13 +++-
source/librpc/gen_ndr/ndr_lsa.c | 140 +++++++++++++++++++++++++++++----
source/librpc/gen_ndr/srv_lsa.c | 4 +-
source/librpc/idl/lsa.idl | 14 ++-
source/rpc_client/cli_lsarpc.c | 42 ----------
source/rpc_parse/parse_lsa.c | 91 ---------------------
source/rpc_server/srv_lsa.c | 96 +---------------------
source/rpc_server/srv_lsa_nt.c | 65 +++++----------
source/rpcclient/cmd_lsarpc.c | 15 ++--
source/rpcclient/cmd_samr.c | 8 +-
source/utils/net_domain.c | 12 ++-
source/utils/net_rpc.c | 167 +++++++++++++++++++++++++--------------
source/utils/net_rpc_join.c | 7 +-
source/utils/net_rpc_sh_acct.c | 9 +-
source/winbindd/winbindd_cm.c | 27 ++++---
19 files changed, 352 insertions(+), 427 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index 371c3eb..2825efc 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -270,24 +270,6 @@ typedef struct lsa_r_open_pol2_info
POLICY_VIEW_LOCAL_INFORMATION |\
POLICY_LOOKUP_NAMES )
-/* LSA_Q_QUERY_SEC_OBJ - LSA query security */
-typedef struct lsa_query_sec_obj_info
-{
- POLICY_HND pol; /* policy handle */
- uint32 sec_info;
-
-} LSA_Q_QUERY_SEC_OBJ;
-
-/* LSA_R_QUERY_SEC_OBJ - probably an open */
-typedef struct r_lsa_query_sec_obj_info
-{
- uint32 ptr;
- SEC_DESC_BUF *buf;
-
- NTSTATUS status; /* return status */
-
-} LSA_R_QUERY_SEC_OBJ;
-
/* LSA_Q_QUERY_INFO - LSA query info policy */
typedef struct lsa_query_info
{
@@ -926,14 +908,4 @@ typedef struct lsa_r_removeprivs
NTSTATUS status;
} LSA_R_REMOVEPRIVS;
-/*******************************************************/
-
-typedef struct {
- POLICY_HND handle;
-} LSA_Q_DELETE_OBJECT;
-
-typedef struct {
- NTSTATUS status;
-} LSA_R_DELETE_OBJECT;
-
#endif /* _RPC_LSA_H */
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 737474d..f855a57 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -671,8 +671,10 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
goto done;
}
- status = rpccli_samr_connect(pipe_hnd, mem_ctx,
- SEC_RIGHTS_MAXIMUM_ALLOWED, &sam_pol);
+ status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
+ pipe_hnd->cli->desthost,
+ SEC_RIGHTS_MAXIMUM_ALLOWED,
+ &sam_pol);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
@@ -849,8 +851,10 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
goto done;
}
- status = rpccli_samr_connect(pipe_hnd, mem_ctx,
- SEC_RIGHTS_MAXIMUM_ALLOWED, &sam_pol);
+ status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
+ pipe_hnd->cli->desthost,
+ SEC_RIGHTS_MAXIMUM_ALLOWED,
+ &sam_pol);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
diff --git a/source/librpc/gen_ndr/cli_lsa.c b/source/librpc/gen_ndr/cli_lsa.c
index 76370ca..3599d9f 100644
--- a/source/librpc/gen_ndr/cli_lsa.c
+++ b/source/librpc/gen_ndr/cli_lsa.c
@@ -135,7 +135,7 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
uint32_t sec_info,
- struct sec_desc_buf *sdbuf)
+ struct sec_desc_buf **sdbuf)
{
struct lsa_QuerySecurity r;
NTSTATUS status;
@@ -168,21 +168,25 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli,
}
/* Return variables */
- if (sdbuf && r.out.sdbuf) {
- *sdbuf = *r.out.sdbuf;
- }
+ *sdbuf = *r.out.sdbuf;
/* Return result */
return r.out.result;
}
NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx)
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle,
+ uint32_t sec_info,
+ struct sec_desc_buf *sdbuf)
{
struct lsa_SetSecObj r;
NTSTATUS status;
/* In parameters */
+ r.in.handle = handle;
+ r.in.sec_info = sec_info;
+ r.in.sdbuf = sdbuf;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_SetSecObj, &r);
@@ -1488,12 +1492,14 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
}
NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx)
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle **handle)
{
struct lsa_DeleteObject r;
NTSTATUS status;
/* In parameters */
+ r.in.handle = handle;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r);
@@ -1519,6 +1525,7 @@ NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
}
/* Return variables */
+ *handle = *r.out.handle;
/* Return result */
return r.out.result;
diff --git a/source/librpc/gen_ndr/cli_lsa.h b/source/librpc/gen_ndr/cli_lsa.h
index c45aed1..4997f5c 100644
--- a/source/librpc/gen_ndr/cli_lsa.h
+++ b/source/librpc/gen_ndr/cli_lsa.h
@@ -17,9 +17,12 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
uint32_t sec_info,
- struct sec_desc_buf *sdbuf);
+ struct sec_desc_buf **sdbuf);
NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx);
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle,
+ uint32_t sec_info,
+ struct sec_desc_buf *sdbuf);
NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx);
NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli,
@@ -163,7 +166,8 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
uint16_t *language_id,
uint16_t unknown);
NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx);
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle **handle);
NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
diff --git a/source/librpc/gen_ndr/lsa.h b/source/librpc/gen_ndr/lsa.h
index 7aa00b1..32e6739 100644
--- a/source/librpc/gen_ndr/lsa.h
+++ b/source/librpc/gen_ndr/lsa.h
@@ -625,7 +625,7 @@ struct lsa_QuerySecurity {
} in;
struct {
- struct sec_desc_buf *sdbuf;/* [unique] */
+ struct sec_desc_buf **sdbuf;/* [ref] */
NTSTATUS result;
} out;
@@ -634,6 +634,12 @@ struct lsa_QuerySecurity {
struct lsa_SetSecObj {
struct {
+ struct policy_handle *handle;/* [ref] */
+ uint32_t sec_info;
+ struct sec_desc_buf *sdbuf;/* [ref] */
+ } in;
+
+ struct {
NTSTATUS result;
} out;
@@ -1035,6 +1041,11 @@ struct lsa_LookupPrivDisplayName {
struct lsa_DeleteObject {
struct {
+ struct policy_handle **handle;/* [ref] */
+ } in;
+
+ struct {
+ struct policy_handle **handle;/* [ref] */
NTSTATUS result;
} out;
diff --git a/source/librpc/gen_ndr/ndr_lsa.c b/source/librpc/gen_ndr/ndr_lsa.c
index 25fa3d2..89b7da5 100644
--- a/source/librpc/gen_ndr/ndr_lsa.c
+++ b/source/librpc/gen_ndr/ndr_lsa.c
@@ -4768,10 +4768,14 @@ static enum ndr_err_code ndr_push_lsa_QuerySecurity(struct ndr_push *ndr, int fl
NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info));
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.sdbuf));
- if (r->out.sdbuf) {
- NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sdbuf));
+ if (r->out.sdbuf == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ if (*r->out.sdbuf == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
}
+ NDR_CHECK(ndr_push_ref_ptr(ndr));
+ NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -4782,6 +4786,7 @@ static enum ndr_err_code ndr_pull_lsa_QuerySecurity(struct ndr_pull *ndr, int fl
uint32_t _ptr_sdbuf;
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_sdbuf_0;
+ TALLOC_CTX *_mem_save_sdbuf_1;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -4793,20 +4798,24 @@ static enum ndr_err_code ndr_pull_lsa_QuerySecurity(struct ndr_pull *ndr, int fl
NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info));
+ NDR_PULL_ALLOC(ndr, r->out.sdbuf);
+ ZERO_STRUCTP(r->out.sdbuf);
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sdbuf));
- if (_ptr_sdbuf) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.sdbuf);
- } else {
- r->out.sdbuf = NULL;
}
- if (r->out.sdbuf) {
- _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, 0);
- NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sdbuf));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, 0);
+ _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_sdbuf));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, *r->out.sdbuf);
}
+ _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -4834,9 +4843,10 @@ _PUBLIC_ void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *nam
ndr->depth++;
ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf);
ndr->depth++;
- if (r->out.sdbuf) {
- ndr_print_sec_desc_buf(ndr, "sdbuf", r->out.sdbuf);
- }
+ ndr_print_ptr(ndr, "sdbuf", *r->out.sdbuf);
+ ndr->depth++;
+ ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf);
+ ndr->depth--;
ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
@@ -4847,6 +4857,15 @@ _PUBLIC_ void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *nam
static enum ndr_err_code ndr_push_lsa_SetSecObj(struct ndr_push *ndr, int flags, const struct lsa_SetSecObj *r)
{
if (flags & NDR_IN) {
+ if (r->in.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
+ NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info));
+ if (r->in.sdbuf == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf));
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
@@ -4856,7 +4875,24 @@ static enum ndr_err_code ndr_push_lsa_SetSecObj(struct ndr_push *ndr, int flags,
static enum ndr_err_code ndr_pull_lsa_SetSecObj(struct ndr_pull *ndr, int flags, struct lsa_SetSecObj *r)
{
+ TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_sdbuf_0;
if (flags & NDR_IN) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.handle);
+ }
+ _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.sdbuf);
+ }
+ _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.sdbuf, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC);
}
if (flags & NDR_OUT) {
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
@@ -4874,6 +4910,15 @@ _PUBLIC_ void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, i
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "lsa_SetSecObj");
ndr->depth++;
+ ndr_print_ptr(ndr, "handle", r->in.handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "handle", r->in.handle);
+ ndr->depth--;
+ ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info);
+ ndr_print_ptr(ndr, "sdbuf", r->in.sdbuf);
+ ndr->depth++;
+ ndr_print_sec_desc_buf(ndr, "sdbuf", r->in.sdbuf);
+ ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -7592,8 +7637,24 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const c
static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int flags, const struct lsa_DeleteObject *r)
{
if (flags & NDR_IN) {
+ if (r->in.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ if (*r->in.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_ref_ptr(ndr));
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.handle));
}
if (flags & NDR_OUT) {
+ if (r->out.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ if (*r->out.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_ref_ptr(ndr));
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.handle));
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -7601,9 +7662,44 @@ static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int fla
static enum ndr_err_code ndr_pull_lsa_DeleteObject(struct ndr_pull *ndr, int flags, struct lsa_DeleteObject *r)
{
+ uint32_t _ptr_handle;
+ TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_handle_1;
if (flags & NDR_IN) {
+ ZERO_STRUCT(r->out);
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.handle);
+ }
+ _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_handle));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, *r->in.handle);
+ }
+ _mem_save_handle_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, *r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_1, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_ALLOC(ndr, r->out.handle);
+ *r->out.handle = *r->in.handle;
}
if (flags & NDR_OUT) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.handle);
+ }
+ _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_handle));
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, *r->out.handle);
+ }
+ _mem_save_handle_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, *r->out.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_1, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -7619,11 +7715,25 @@ _PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "lsa_DeleteObject");
ndr->depth++;
+ ndr_print_ptr(ndr, "handle", r->in.handle);
+ ndr->depth++;
+ ndr_print_ptr(ndr, "handle", *r->in.handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "handle", *r->in.handle);
+ ndr->depth--;
+ ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "lsa_DeleteObject");
ndr->depth++;
+ ndr_print_ptr(ndr, "handle", r->out.handle);
+ ndr->depth++;
+ ndr_print_ptr(ndr, "handle", *r->out.handle);
+ ndr->depth++;
+ ndr_print_policy_handle(ndr, "handle", *r->out.handle);
+ ndr->depth--;
+ ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
diff --git a/source/librpc/gen_ndr/srv_lsa.c b/source/librpc/gen_ndr/srv_lsa.c
index 8f8f985..aa870a6 100644
--- a/source/librpc/gen_ndr/srv_lsa.c
+++ b/source/librpc/gen_ndr/srv_lsa.c
@@ -274,7 +274,7 @@ static bool api_lsa_QuerySecurity(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.sdbuf = talloc_zero(r, struct sec_desc_buf);
+ r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *);
if (r->out.sdbuf == NULL) {
talloc_free(r);
return false;
@@ -2674,6 +2674,8 @@ static bool api_lsa_DeleteObject(pipes_struct *p)
NDR_PRINT_IN_DEBUG(lsa_DeleteObject, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.handle = r->in.handle;
r->out.result = _lsa_DeleteObject(p, r);
if (p->rng_fault_state) {
diff --git a/source/librpc/idl/lsa.idl b/source/librpc/idl/lsa.idl
index 8d26ec0..477ff3f 100644
--- a/source/librpc/idl/lsa.idl
+++ b/source/librpc/idl/lsa.idl
@@ -82,14 +82,17 @@ import "security.idl";
NTSTATUS lsa_QuerySecurity (
[in] policy_handle *handle,
[in] security_secinfo sec_info,
- [out,unique] sec_desc_buf *sdbuf
+ [out,ref] sec_desc_buf **sdbuf
);
/******************/
/* Function: 0x04 */
- NTSTATUS lsa_SetSecObj ();
-
+ NTSTATUS lsa_SetSecObj(
+ [in] policy_handle *handle,
+ [in] security_secinfo sec_info,
+ [in,ref] sec_desc_buf *sdbuf
+ );
/******************/
/* Function: 0x05 */
@@ -653,9 +656,10 @@ import "security.idl";
);
/* Function: 0x22 */
- NTSTATUS lsa_DeleteObject();
+ NTSTATUS lsa_DeleteObject(
+ [in,out] policy_handle **handle
+ );
-
/*******************/
/* Function: 0x23 */
NTSTATUS lsa_EnumAccountsWithUserRight (
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
--
Samba Shared Repository
More information about the samba-cvs
mailing list