[FIX Bug 6235] domain enumeration breaks if master browser has space in name
authorDerrell Lipman <derrell@dworkin.(none)>
Mon, 27 Apr 2009 13:27:52 +0000 (09:27 -0400)
committerDerrell Lipman <derrell@dworkin.(none)>
Mon, 27 Apr 2009 13:34:25 +0000 (09:34 -0400)
Jeremy: please review to ensure this doesn't appear to break anything

The function name_status_find() is documented as used for finding a server's
name given its IP address. It was, however, looking for the first matching
name which could be a group name at times. This fix ensures that group names
are skipped when scanning for a matching name.

Derrell

source3/libsmb/namequery.c

index 19d89ce363d1854037b91d1221f5dfe8c6d83d32..50fb9f1620590aefde3144b26a9edc0154525328 100644 (file)
@@ -408,7 +408,8 @@ bool name_status_find(const char *q_name,
                goto done;
 
        for (i=0;i<count;i++) {
-               if (status[i].type == type)
+                /* Find first one of the requested type that's not a GROUP. */
+               if (status[i].type == type && ! (status[i].flags & 0x80))
                        break;
        }
        if (i == count)