1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-07 00:58:40 +03:00

Testing revealed some errors, reverting some of the lsa changes.

Guenther
(This used to be commit ac1e4f1eb2c046def4fa30ab0bd98c49add8e8c8)
This commit is contained in:
Günther Deschner 2008-02-09 01:33:47 +01:00
parent c7f3488959
commit da3e2d4c27
8 changed files with 33 additions and 115 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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--;

View File

@ -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;

View File

@ -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
);
/*******************/

View File

@ -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;

View File

@ -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;