mirror of
https://github.com/samba-team/samba.git
synced 2024-12-31 17:18:04 +03:00
added idl and test suite for lsa_CreateTrustedDomain()
This commit is contained in:
parent
e9e85c4644
commit
cdb4751153
@ -51,7 +51,6 @@
|
|||||||
[out,ref] lsa_PrivArray *privs
|
[out,ref] lsa_PrivArray *privs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/******************/
|
/******************/
|
||||||
/* Function: 0x03 */
|
/* Function: 0x03 */
|
||||||
|
|
||||||
@ -225,7 +224,7 @@
|
|||||||
NTSTATUS lsa_CreateAccount (
|
NTSTATUS lsa_CreateAccount (
|
||||||
[in,ref] policy_handle *handle,
|
[in,ref] policy_handle *handle,
|
||||||
[in,ref] dom_sid2 *sid,
|
[in,ref] dom_sid2 *sid,
|
||||||
[in] uint32 access,
|
[in] uint32 desired_access,
|
||||||
[out,ref] policy_handle *acct_handle
|
[out,ref] policy_handle *acct_handle
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -250,7 +249,18 @@
|
|||||||
|
|
||||||
/*************************************************/
|
/*************************************************/
|
||||||
/* Function: 0x0c */
|
/* Function: 0x0c */
|
||||||
NTSTATUS lsa_CreateTrustDom ();
|
|
||||||
|
typedef struct {
|
||||||
|
lsa_Name name;
|
||||||
|
dom_sid2 *sid;
|
||||||
|
} lsa_TrustInformation;
|
||||||
|
|
||||||
|
NTSTATUS lsa_CreateTrustedDomain(
|
||||||
|
[in,ref] policy_handle *handle,
|
||||||
|
[in,ref] lsa_TrustInformation *info,
|
||||||
|
[in] uint32 desired_access,
|
||||||
|
[out,ref] policy_handle *dom_handle
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/******************/
|
/******************/
|
||||||
@ -288,11 +298,6 @@
|
|||||||
[size_is(count)] lsa_TranslatedSid *sids;
|
[size_is(count)] lsa_TranslatedSid *sids;
|
||||||
} lsa_TransSidArray;
|
} lsa_TransSidArray;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
lsa_Name name;
|
|
||||||
dom_sid2 *sid;
|
|
||||||
} lsa_TrustInformation;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32 count;
|
uint32 count;
|
||||||
[size_is(count)] lsa_TrustInformation *domains;
|
[size_is(count)] lsa_TrustInformation *domains;
|
||||||
|
@ -324,7 +324,7 @@ static BOOL test_CreateAccount(struct dcerpc_pipe *p,
|
|||||||
|
|
||||||
r.in.handle = handle;
|
r.in.handle = handle;
|
||||||
r.in.sid = newsid;
|
r.in.sid = newsid;
|
||||||
r.in.access = SEC_RIGHTS_MAXIMUM_ALLOWED;
|
r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
|
||||||
r.out.acct_handle = &acct_handle;
|
r.out.acct_handle = &acct_handle;
|
||||||
|
|
||||||
status = dcerpc_lsa_CreateAccount(p, mem_ctx, &r);
|
status = dcerpc_lsa_CreateAccount(p, mem_ctx, &r);
|
||||||
@ -340,6 +340,46 @@ static BOOL test_CreateAccount(struct dcerpc_pipe *p,
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static BOOL test_CreateTrustedDomain(struct dcerpc_pipe *p,
|
||||||
|
TALLOC_CTX *mem_ctx,
|
||||||
|
struct policy_handle *handle)
|
||||||
|
{
|
||||||
|
NTSTATUS status;
|
||||||
|
struct lsa_CreateTrustedDomain r;
|
||||||
|
struct lsa_TrustInformation trustinfo;
|
||||||
|
struct dom_sid *domsid;
|
||||||
|
struct policy_handle dom_handle;
|
||||||
|
|
||||||
|
printf("Testing CreateTrustedDomain\n");
|
||||||
|
|
||||||
|
if (!find_domain_sid(p, mem_ctx, handle, &domsid)) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
domsid->sub_auths[domsid->num_auths-1] ^= 0xF0F0F0F0;
|
||||||
|
|
||||||
|
trustinfo.sid = domsid;
|
||||||
|
init_lsa_Name(&trustinfo.name, "torturedomain");
|
||||||
|
|
||||||
|
r.in.handle = handle;
|
||||||
|
r.in.info = &trustinfo;
|
||||||
|
r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
|
||||||
|
r.out.dom_handle = &dom_handle;
|
||||||
|
|
||||||
|
status = dcerpc_lsa_CreateTrustedDomain(p, mem_ctx, &r);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("CreateTrustedDomain failed - %s\n", nt_errstr(status));
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!test_Delete(p, mem_ctx, &dom_handle)) {
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
static BOOL test_EnumAccountRights(struct dcerpc_pipe *p,
|
static BOOL test_EnumAccountRights(struct dcerpc_pipe *p,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
struct policy_handle *acct_handle,
|
struct policy_handle *acct_handle,
|
||||||
@ -635,6 +675,10 @@ BOOL torture_rpc_lsa(int dummy)
|
|||||||
ret = False;
|
ret = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!test_CreateTrustedDomain(p, mem_ctx, &handle)) {
|
||||||
|
ret = False;
|
||||||
|
}
|
||||||
|
|
||||||
if (!test_EnumAccounts(p, mem_ctx, &handle)) {
|
if (!test_EnumAccounts(p, mem_ctx, &handle)) {
|
||||||
ret = False;
|
ret = False;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user