From: Matthias Dieter Wallnöfer Date: Wed, 3 Mar 2010 16:41:43 +0000 (+0100) Subject: s4:torture/rpc/samr - Fix up SAMR-USERS test X-Git-Tag: samba-3.6.0pre1~4812 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a21b49bb389f8f98fe43a6abe3b0fde51ec43210;p=thirdparty%2Fsamba.git s4:torture/rpc/samr - Fix up SAMR-USERS test "QueryDomainInfo" returns only global groups, "QueryDisplayInfo" also universal ones. Consider MS-SAMR 3.1.5.5.1.1 and 3.1.5.3.1. --- diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index d3621e4a30b..13a56f0f7b1 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -6288,17 +6288,23 @@ static bool test_QueryDisplayInfo(struct dcerpc_pipe *p, if (!NT_STATUS_IS_OK(status)) { torture_warning(tctx, "QueryDomainInfo level %u failed - %s\n", r.in.level, nt_errstr(status)); - ret = false; - break; + ret = false; + break; } switch (r.in.level) { case 1: case 4: if (info->general.num_users < r.in.start_idx) { - torture_warning(tctx, "QueryDomainInfo indicates that QueryDisplayInfo returned more users (%d/%d) than the domain %s is said to contain!\n", - r.in.start_idx, info->general.num_groups, - info->general.domain_name.string); - ret = false; + /* On AD deployments this numbers don't match + * since QueryDisplayInfo returns universal and + * global groups, QueryDomainInfo only global + * ones. */ + if (torture_setting_bool(tctx, "samba3", false)) { + torture_warning(tctx, "QueryDomainInfo indicates that QueryDisplayInfo returned more users (%d/%d) than the domain %s is said to contain!\n", + r.in.start_idx, info->general.num_groups, + info->general.domain_name.string); + ret = false; + } } if (!seen_testuser) { struct policy_handle user_handle; @@ -6313,10 +6319,16 @@ static bool test_QueryDisplayInfo(struct dcerpc_pipe *p, case 3: case 5: if (info->general.num_groups != r.in.start_idx) { - torture_warning(tctx, "QueryDomainInfo indicates that QueryDisplayInfo didn't return all (%d/%d) the groups in %s\n", - r.in.start_idx, info->general.num_groups, - info->general.domain_name.string); - ret = false; + /* On AD deployments this numbers don't match + * since QueryDisplayInfo returns universal and + * global groups, QueryDomainInfo only global + * ones. */ + if (torture_setting_bool(tctx, "samba3", false)) { + torture_warning(tctx, "QueryDomainInfo indicates that QueryDisplayInfo didn't return all (%d/%d) the groups in %s\n", + r.in.start_idx, info->general.num_groups, + info->general.domain_name.string); + ret = false; + } } break;