diff options
author | Günther Deschner <gd@samba.org> | 2008-02-09 01:33:47 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-09 02:05:39 +0100 |
commit | da3e2d4c2797a9ea43312ba7bdb5bc9710c94004 (patch) | |
tree | 00c5dbdb0ab9cf45028eb5a067716b2a2be4b9e2 | |
parent | c7f34889591174ae335a37ab62747afab8fc418c (diff) | |
download | samba-da3e2d4c2797a9ea43312ba7bdb5bc9710c94004.tar.gz samba-da3e2d4c2797a9ea43312ba7bdb5bc9710c94004.tar.bz2 samba-da3e2d4c2797a9ea43312ba7bdb5bc9710c94004.zip |
Testing revealed some errors, reverting some of the lsa changes.
Guenther
(This used to be commit ac1e4f1eb2c046def4fa30ab0bd98c49add8e8c8)
-rw-r--r-- | source3/librpc/gen_ndr/cli_lsa.c | 6 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_lsa.h | 6 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/lsa.h | 8 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_lsa.c | 106 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_lsa.c | 4 | ||||
-rw-r--r-- | source3/librpc/idl/lsa.idl | 8 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 4 | ||||
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 6 |
8 files changed, 33 insertions, 115 deletions
diff --git a/source3/librpc/gen_ndr/cli_lsa.c b/source3/librpc/gen_ndr/cli_lsa.c index 64da84d55f..ddd0c7884d 100644 --- a/source3/librpc/gen_ndr/cli_lsa.c +++ b/source3/librpc/gen_ndr/cli_lsa.c @@ -427,7 +427,7 @@ NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, - struct policy_handle **acct_handle) + struct policy_handle *acct_handle) { struct lsa_CreateAccount r; NTSTATUS status; @@ -762,7 +762,7 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, - struct policy_handle **acct_handle) + struct policy_handle *acct_handle) { struct lsa_OpenAccount r; NTSTATUS status; @@ -1499,7 +1499,7 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - struct policy_handle **handle) + struct policy_handle *handle) { struct lsa_DeleteObject r; NTSTATUS status; diff --git a/source3/librpc/gen_ndr/cli_lsa.h b/source3/librpc/gen_ndr/cli_lsa.h index 396debaca8..3f64bb450d 100644 --- a/source3/librpc/gen_ndr/cli_lsa.h +++ b/source3/librpc/gen_ndr/cli_lsa.h @@ -48,7 +48,7 @@ NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, - struct policy_handle **acct_handle); + struct policy_handle *acct_handle); NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -95,7 +95,7 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, struct policy_handle *handle, struct dom_sid2 *sid, uint32_t access_mask, - struct policy_handle **acct_handle); + struct policy_handle *acct_handle); NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -171,7 +171,7 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, uint16_t unknown); NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - struct policy_handle **handle); + struct policy_handle *handle); NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h index 06f714acc8..0df0ddecc5 100644 --- a/source3/librpc/gen_ndr/lsa.h +++ b/source3/librpc/gen_ndr/lsa.h @@ -713,7 +713,7 @@ struct lsa_CreateAccount { } in; struct { - struct policy_handle **acct_handle;/* [ref] */ + struct policy_handle *acct_handle;/* [ref] */ NTSTATUS result; } out; @@ -829,7 +829,7 @@ struct lsa_OpenAccount { } in; struct { - struct policy_handle **acct_handle;/* [ref] */ + struct policy_handle *acct_handle;/* [ref] */ NTSTATUS result; } out; @@ -1051,11 +1051,11 @@ struct lsa_LookupPrivDisplayName { struct lsa_DeleteObject { struct { - struct policy_handle **handle;/* [ref] */ + struct policy_handle *handle;/* [ref] */ } in; struct { - struct policy_handle **handle;/* [ref] */ + struct policy_handle *handle;/* [ref] */ NTSTATUS result; } out; diff --git a/source3/librpc/gen_ndr/ndr_lsa.c b/source3/librpc/gen_ndr/ndr_lsa.c index 5ac4cbcb59..a3565c8f2c 100644 --- a/source3/librpc/gen_ndr/ndr_lsa.c +++ b/source3/librpc/gen_ndr/ndr_lsa.c @@ -5321,10 +5321,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int if (r->out.acct_handle == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.acct_handle)); - if (*r->out.acct_handle) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.acct_handle)); - } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.acct_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -5332,11 +5329,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int _PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r) { - uint32_t _ptr_acct_handle; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sid_0; TALLOC_CTX *_mem_save_acct_handle_0; - TALLOC_CTX *_mem_save_acct_handle_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -5364,18 +5359,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int } _mem_save_acct_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.acct_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_acct_handle)); - if (_ptr_acct_handle) { - NDR_PULL_ALLOC(ndr, *r->out.acct_handle); - } else { - *r->out.acct_handle = NULL; - } - if (*r->out.acct_handle) { - _mem_save_acct_handle_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.acct_handle, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.acct_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_1, 0); - } + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.acct_handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } @@ -5408,12 +5392,7 @@ _PUBLIC_ void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *nam ndr->depth++; ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle); ndr->depth++; - ndr_print_ptr(ndr, "acct_handle", *r->out.acct_handle); - ndr->depth++; - if (*r->out.acct_handle) { - ndr_print_policy_handle(ndr, "acct_handle", *r->out.acct_handle); - } - ndr->depth--; + ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -6208,10 +6187,7 @@ static enum ndr_err_code ndr_push_lsa_OpenAccount(struct ndr_push *ndr, int flag if (r->out.acct_handle == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.acct_handle)); - if (*r->out.acct_handle) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.acct_handle)); - } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.acct_handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -6219,11 +6195,9 @@ static enum ndr_err_code ndr_push_lsa_OpenAccount(struct ndr_push *ndr, int flag static enum ndr_err_code ndr_pull_lsa_OpenAccount(struct ndr_pull *ndr, int flags, struct lsa_OpenAccount *r) { - uint32_t _ptr_acct_handle; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sid_0; TALLOC_CTX *_mem_save_acct_handle_0; - TALLOC_CTX *_mem_save_acct_handle_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -6251,18 +6225,7 @@ static enum ndr_err_code ndr_pull_lsa_OpenAccount(struct ndr_pull *ndr, int flag } _mem_save_acct_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.acct_handle, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_acct_handle)); - if (_ptr_acct_handle) { - NDR_PULL_ALLOC(ndr, *r->out.acct_handle); - } else { - *r->out.acct_handle = NULL; - } - if (*r->out.acct_handle) { - _mem_save_acct_handle_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.acct_handle, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.acct_handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_1, 0); - } + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.acct_handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } @@ -6295,12 +6258,7 @@ _PUBLIC_ void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "acct_handle", r->out.acct_handle); ndr->depth++; - ndr_print_ptr(ndr, "acct_handle", *r->out.acct_handle); - ndr->depth++; - if (*r->out.acct_handle) { - ndr_print_policy_handle(ndr, "acct_handle", *r->out.acct_handle); - } - ndr->depth--; + ndr_print_policy_handle(ndr, "acct_handle", r->out.acct_handle); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -7757,19 +7715,13 @@ static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int fla if (r->in.handle == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.handle)); - if (*r->in.handle) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.handle)); - } + 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"); } - NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.handle)); - if (*r->out.handle) { - NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.handle)); - } + 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; @@ -7777,9 +7729,7 @@ 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); @@ -7788,18 +7738,7 @@ static enum ndr_err_code ndr_pull_lsa_DeleteObject(struct ndr_pull *ndr, int fla } _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_generic_ptr(ndr, &_ptr_handle)); - if (_ptr_handle) { - NDR_PULL_ALLOC(ndr, *r->in.handle); - } else { - *r->in.handle = NULL; - } - if (*r->in.handle) { - _mem_save_handle_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.handle, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_1, 0); - } + 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_PULL_ALLOC(ndr, r->out.handle); *r->out.handle = *r->in.handle; @@ -7810,18 +7749,7 @@ static enum ndr_err_code ndr_pull_lsa_DeleteObject(struct ndr_pull *ndr, int fla } _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_generic_ptr(ndr, &_ptr_handle)); - if (_ptr_handle) { - NDR_PULL_ALLOC(ndr, *r->out.handle); - } else { - *r->out.handle = NULL; - } - if (*r->out.handle) { - _mem_save_handle_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.handle, 0); - NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.handle)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_1, 0); - } + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle)); 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)); } @@ -7840,12 +7768,7 @@ _PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_ptr(ndr, "handle", r->in.handle); ndr->depth++; - ndr_print_ptr(ndr, "handle", *r->in.handle); - ndr->depth++; - if (*r->in.handle) { - ndr_print_policy_handle(ndr, "handle", *r->in.handle); - } - ndr->depth--; + ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; ndr->depth--; } @@ -7854,12 +7777,7 @@ _PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_ptr(ndr, "handle", r->out.handle); ndr->depth++; - ndr_print_ptr(ndr, "handle", *r->out.handle); - ndr->depth++; - if (*r->out.handle) { - ndr_print_policy_handle(ndr, "handle", *r->out.handle); - } - ndr->depth--; + ndr_print_policy_handle(ndr, "handle", r->out.handle); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c index 874cf4c410..d02bdb786b 100644 --- a/source3/librpc/gen_ndr/srv_lsa.c +++ b/source3/librpc/gen_ndr/srv_lsa.c @@ -806,7 +806,7 @@ static bool api_lsa_CreateAccount(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.acct_handle = talloc_zero(r, struct policy_handle *); + r->out.acct_handle = talloc_zero(r, struct policy_handle); if (r->out.acct_handle == NULL) { talloc_free(r); return false; @@ -1372,7 +1372,7 @@ static bool api_lsa_OpenAccount(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.acct_handle = talloc_zero(r, struct policy_handle *); + r->out.acct_handle = talloc_zero(r, struct policy_handle); if (r->out.acct_handle == NULL) { talloc_free(r); return false; diff --git a/source3/librpc/idl/lsa.idl b/source3/librpc/idl/lsa.idl index df1da31c97..516b435257 100644 --- a/source3/librpc/idl/lsa.idl +++ b/source3/librpc/idl/lsa.idl @@ -278,7 +278,7 @@ import "security.idl"; [in] policy_handle *handle, [in,ref] dom_sid2 *sid, [in] uint32 access_mask, - [out] policy_handle **acct_handle + [out] policy_handle *acct_handle ); /******************/ @@ -429,11 +429,11 @@ import "security.idl"; /*****************************************/ /* Function: 0x11 */ - NTSTATUS lsa_OpenAccount ( + NTSTATUS lsa_OpenAccount( [in] policy_handle *handle, [in,ref] dom_sid2 *sid, [in] uint32 access_mask, - [out] policy_handle **acct_handle + [out] policy_handle *acct_handle ); @@ -664,7 +664,7 @@ import "security.idl"; /* Function: 0x22 */ NTSTATUS lsa_DeleteObject( - [in,out] policy_handle **handle + [in,out] policy_handle *handle ); /*******************/ diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 247a52df46..6e25a64236 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -1647,7 +1647,7 @@ NTSTATUS _lsa_CreateAccount(pipes_struct *p, info->access = r->in.access_mask; /* get a (unique) handle. open a policy on it. */ - if (!create_policy_hnd(p, *r->out.acct_handle, free_lsa_info, (void *)info)) + if (!create_policy_hnd(p, r->out.acct_handle, free_lsa_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; return privilege_create_account( &info->sid ); @@ -1691,7 +1691,7 @@ NTSTATUS _lsa_OpenAccount(pipes_struct *p, info->access = r->in.access_mask; /* get a (unique) handle. open a policy on it. */ - if (!create_policy_hnd(p, *r->out.acct_handle, free_lsa_info, (void *)info)) + if (!create_policy_hnd(p, r->out.acct_handle, free_lsa_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; return NT_STATUS_OK; diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 54791f143c..e5d131e9c1 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -585,7 +585,7 @@ static NTSTATUS cmd_lsa_create_account(struct rpc_pipe_client *cli, const char **argv) { POLICY_HND dom_pol; - POLICY_HND *user_pol = NULL; + POLICY_HND user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32 des_access = 0x000f000f; @@ -632,7 +632,7 @@ static NTSTATUS cmd_lsa_enum_privsaccounts(struct rpc_pipe_client *cli, const char **argv) { POLICY_HND dom_pol; - POLICY_HND *user_pol = NULL; + POLICY_HND user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32 access_desired = 0x000f000f; @@ -666,7 +666,7 @@ static NTSTATUS cmd_lsa_enum_privsaccounts(struct rpc_pipe_client *cli, if (!NT_STATUS_IS_OK(result)) goto done; - result = rpccli_lsa_enum_privsaccount(cli, mem_ctx, user_pol, &count, &set); + result = rpccli_lsa_enum_privsaccount(cli, mem_ctx, &user_pol, &count, &set); if (!NT_STATUS_IS_OK(result)) goto done; |