r22538: same day late at night in au...:-)
authorStefan Metzmacher <metze@samba.org>
Fri, 27 Apr 2007 17:35:15 +0000 (17:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:51:39 +0000 (14:51 -0500)
fix the strcasecmp_m() returns 0 for a match

also use the correct array element to fill priv->dcinfo

the fixes the problems where ldb changes the order of the search results
when changing the main dc netbios name from "localhost" to "localtest"

metze
(This used to be commit 25fffe385ea039ae19f25730cba6c7ea8684860b)

source4/torture/rpc/drsuapi.c

index 0129fe9b638d6fc7466910846f156809349b2559..338d2ad759dad1460116e811e27d2e08b243f52a 100644 (file)
@@ -139,19 +139,18 @@ static BOOL test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, TALLOC_CTX *me
                        case 1:
                                for (k=0; k < r.out.ctr.ctr1.count; k++) {
                                        if (strcasecmp_m(r.out.ctr.ctr1.array[k].netbios_name, 
-                                                        torture_join_netbios_name(priv->join))) {
+                                                        torture_join_netbios_name(priv->join)) == 0) {
                                                found = True;
+                                               break;
                                        }
                                }
                                break;
                        case 2:
-                               if (r.out.ctr.ctr2.count > 0) {
-                                       priv->dcinfo    = r.out.ctr.ctr2.array[0];
-                               }
                                for (k=0; k < r.out.ctr.ctr2.count; k++) {
                                        if (strcasecmp_m(r.out.ctr.ctr2.array[k].netbios_name, 
-                                                        torture_join_netbios_name(priv->join))) {
+                                                        torture_join_netbios_name(priv->join)) == 0) {
                                                found = True;
+                                               priv->dcinfo    = r.out.ctr.ctr2.array[k];
                                                break;
                                        }
                                }