diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-11-22 11:59:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:06:04 -0500 |
commit | b6b61cec790e19862a600b023327d72dd33b3cb4 (patch) | |
tree | 93b1cad84ea4092692da82841d8218aa3fc16928 /source4/torture/rpc/samsync.c | |
parent | ca751e2638ca0fbb03b54e1aaa4ed1316e903947 (diff) | |
download | samba-b6b61cec790e19862a600b023327d72dd33b3cb4.tar.gz samba-b6b61cec790e19862a600b023327d72dd33b3cb4.tar.bz2 samba-b6b61cec790e19862a600b023327d72dd33b3cb4.zip |
r3907: * Rename lsa_Name to lsa_String
* Add new IDL to LSA, to query information about trusted domains (for
cross-check with SamSync).
Andrew Bartlett
(This used to be commit 174c0778421b5154ff2ba809688ea6ef38a1478b)
Diffstat (limited to 'source4/torture/rpc/samsync.c')
-rw-r--r-- | source4/torture/rpc/samsync.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index 59508bf1fe..20d63a351a 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -706,7 +706,7 @@ static BOOL samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam o.in.handle = samsync_state->lsa_handle; o.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED; - o.in.name.name = name; + o.in.name.string = name; o.out.sec_handle = &sec_handle; status = dcerpc_lsa_OpenSecret(samsync_state->p_lsa, mem_ctx, &o); @@ -781,6 +781,10 @@ static BOOL samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st struct samsync_trusted_domain *new = talloc_p(samsync_state, struct samsync_trusted_domain); struct lsa_OpenTrustedDomain t; struct policy_handle trustdom_handle; + struct lsa_QueryInfoTrustedDomain q; + union lsa_TrustedDomainInfo info[4]; + int levels [] = {1, 3}; + int i; new->name = talloc_reference(new, trusted_domain->domain_name.string); new->sid = talloc_reference(new, dom_sid); @@ -795,7 +799,21 @@ static BOOL samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st printf("OpenTrustedDomain failed - %s\n", nt_errstr(status)); return False; } + + for (i=0; i< ARRAY_SIZE(levels); i++) { + q.in.trustdom_handle = &trustdom_handle; + q.in.level = levels[i]; + q.out.info = &info[levels[i]]; + status = dcerpc_lsa_QueryInfoTrustedDomain(samsync_state->p_lsa, mem_ctx, &q); + if (!NT_STATUS_IS_OK(status)) { + printf("QueryInfoTrustedDomain level %d failed - %s\n", + levels[i], nt_errstr(status)); + return False; + } + } + TEST_STRING_EQUAL(info[1].info1.domain_name, trusted_domain->domain_name); + TEST_INT_EQUAL(info[3].info3.flags, trusted_domain->flags); TEST_SEC_DESC_EQUAL(trusted_domain->sdbuf, lsa, &trustdom_handle); DLIST_ADD(samsync_state->trusted_domains, new); @@ -868,7 +886,7 @@ static BOOL samsync_handle_account(TALLOC_CTX *mem_ctx, struct samsync_state *sa return False; } for (j=0;j<account->privilege_entries; j++) { - if (strcmp(r.out.name->name, account->privilege_name[j].string) == 0) { + if (strcmp(r.out.name->string, account->privilege_name[j].string) == 0) { found_priv_in_lsa[j] = True; break; } |