From 47c3f920db32e72cd193525abf3903cb3306caca Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 23 Nov 2004 11:02:27 +0000 Subject: r3921: Cross-test SIDs in RPC-SAMSYNC, fix the build. Andrew Bartlett (This used to be commit 49c794a6b215f81fd0dba0e7f6812c647b3d91c7) --- source4/torture/rpc/samsync.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index 2afd63bf54..d2445f3111 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -238,6 +238,14 @@ static struct sec_desc_buf *samsync_query_lsa_sec_desc(TALLOC_CTX *mem_ctx, } \ } while (0) +#define TEST_SID_EQUAL(s1, s2) do {\ + if (!dom_sid_equal(s1, s2)) {\ + printf("dom_sid mismatch: " #s1 ":%s != " #s2 ": %s\n", \ + dom_sid_string(mem_ctx, s1), dom_sid_string(mem_ctx, s2));\ + ret = False;\ + } \ +} while (0) + /* The ~SEC_DESC_SACL_PRESENT is because we don't, as administrator, * get back the SACL part of the SD when we ask over SAMR */ @@ -782,8 +790,8 @@ static BOOL samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st struct lsa_OpenTrustedDomain t; struct policy_handle trustdom_handle; struct lsa_QueryTrustedDomainInfo q; - union lsa_TrustedDomainInfo *info[4]; - int levels [] = {1, 3}; + union lsa_TrustedDomainInfo *info[9]; + int levels [] = {1, 3, 8}; int i; new->name = talloc_reference(new, trusted_domain->domain_name.string); @@ -812,8 +820,10 @@ static BOOL samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st info[levels[i]] = q.out.info; } - TEST_STRING_EQUAL(info[1]->info1.domain_name, trusted_domain->domain_name); - TEST_INT_EQUAL(info[3]->info3.flags, trusted_domain->flags); + TEST_SID_EQUAL(info[8]->full_info.info_ex.sid, dom_sid); + TEST_STRING_EQUAL(info[8]->full_info.info_ex.name, trusted_domain->domain_name); + TEST_STRING_EQUAL(info[1]->name.domain_name, trusted_domain->domain_name); + TEST_INT_EQUAL(info[3]->flags.flags, trusted_domain->flags); TEST_SEC_DESC_EQUAL(trusted_domain->sdbuf, lsa, &trustdom_handle); DLIST_ADD(samsync_state->trusted_domains, new); -- cgit