s4-smbtorture: add stricter tests for LSA-LOOKUPNAMES replies.
authorGünther Deschner <gd@samba.org>
Tue, 20 Oct 2009 13:00:55 +0000 (15:00 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 20 Oct 2009 13:28:30 +0000 (15:28 +0200)
Guenther

source4/torture/rpc/lsa.c

index 0ce75d8a86bfbb0341b4c25c630e29c97cb1708c..7b938f399ca5b3d292e69529b87a441ad85e1178 100644 (file)
@@ -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");