From 20197c6687f83154aefa33706829af08d1d5c50a Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 15 Feb 2011 10:24:51 +0100 Subject: s4:torture/rpc/samr.c - fix up the "test_GroupList" suite regarding QueryDisplayInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed to comply with the previous patch. Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Tue Feb 15 17:40:22 CET 2011 on sn-devel-104 --- source4/torture/rpc/samr.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index c3e3905f94..0e1500e029 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -6800,6 +6800,7 @@ static bool test_QueryDomainInfo2(struct dcerpc_binding_handle *b, set of group names. */ static bool test_GroupList(struct dcerpc_binding_handle *b, struct torture_context *tctx, + struct dom_sid *domain_sid, struct policy_handle *handle) { struct samr_EnumDomainGroups q1; @@ -6817,6 +6818,9 @@ static bool test_GroupList(struct dcerpc_binding_handle *b, int num_names = 0; const char **names = NULL; + bool builtin_domain = dom_sid_compare(domain_sid, + &global_sid_Builtin) == 0; + torture_comment(tctx, "Testing coherency of querydispinfo vs enumdomgroups\n"); q1.in.domain_handle = handle; @@ -6847,6 +6851,11 @@ static bool test_GroupList(struct dcerpc_binding_handle *b, torture_assert(tctx, sam, "EnumDomainGroups failed to return sam"); + if (builtin_domain) { + torture_assert(tctx, num_names == 0, + "EnumDomainGroups shouldn't return any group in the builtin domain!"); + } + q2.in.domain_handle = handle; q2.in.level = 5; q2.in.start_idx = 0; @@ -6879,7 +6888,7 @@ static bool test_GroupList(struct dcerpc_binding_handle *b, } } - if (!found) { + if ((!found) && (!builtin_domain)) { torture_warning(tctx, "QueryDisplayInfo gave name [%s] that EnumDomainGroups did not\n", name); ret = false; @@ -6894,6 +6903,11 @@ static bool test_GroupList(struct dcerpc_binding_handle *b, ret = false; } + if (builtin_domain) { + torture_assert(tctx, q2.in.start_idx != 0, + "QueryDisplayInfo should return all domain groups also on the builtin domain handle!"); + } + for (i=0; i