From d76e77ce9a72543727ff83eacbefed22f0c644b9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 20 Oct 2009 15:00:55 +0200 Subject: s4-smbtorture: add stricter tests for LSA-LOOKUPNAMES replies. Guenther --- source4/torture/rpc/lsa.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 0ce75d8a86..7b938f399c 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -202,12 +202,22 @@ static bool test_LookupNames(struct dcerpc_pipe *p, } for (i=0;i< tnames->count;i++) { - if (i < count && sids.sids[i].sid_type != tnames->names[i].sid_type) { - torture_comment(tctx, "LookupName of %s got unexpected name type: %s\n", - tnames->names[i].name.string, sid_type_lookup(sids.sids[i].sid_type)); + if (i < count) { + if (sids.sids[i].sid_type != tnames->names[i].sid_type) { + torture_comment(tctx, "LookupName of %s got unexpected name type: %s\n", + tnames->names[i].name.string, sid_type_lookup(sids.sids[i].sid_type)); + return false; + } + if ((sids.sids[i].sid_type == SID_NAME_DOMAIN) && + (sids.sids[i].rid != (uint32_t)-1)) { + torture_comment(tctx, "LookupName of %s got unexpected rid: %d\n", + tnames->names[i].name.string, sids.sids[i].rid); + return false; + } } else if (i >=count) { torture_comment(tctx, "LookupName of %s failed to return a result\n", tnames->names[i].name.string); + return false; } } torture_comment(tctx, "\n"); -- cgit