Show
Ignore:
Timestamp:
07/11/08 01:13:42 (5 months ago)
Author:
psmedley
Message:

Update branch to 3.0.31 release

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/libsmb/namequery.c

    r1 r140  
    14291429        BOOL done_auto_lookup = False; 
    14301430        int auto_count = 0; 
     1431        NTSTATUS status; 
     1432 
     1433        *ip_list = NULL; 
     1434        *count = 0; 
    14311435 
    14321436        *ordered = False; 
     
    14811485                if (internal_resolve_name(domain, 0x1C, sitename, ip_list, count, 
    14821486                                          resolve_order)) { 
    1483                         return NT_STATUS_OK; 
     1487                        status = NT_STATUS_OK; 
     1488                        goto out; 
    14841489                } else { 
    1485                         return NT_STATUS_NO_LOGON_SERVERS; 
     1490                        status = NT_STATUS_NO_LOGON_SERVERS; 
     1491                        goto out; 
    14861492                } 
    14871493        } 
     
    14981504        p = pserver; 
    14991505        while (next_token(&p,name,LIST_SEP,sizeof(name))) { 
    1500                 if (strequal(name, "*")) { 
     1506                if (!done_auto_lookup && strequal(name, "*")) { 
    15011507                        if (internal_resolve_name(domain, 0x1C, sitename, &auto_ip_list, 
    15021508                                                  &auto_count, resolve_order)) 
     
    15151521                if ( done_auto_lookup ) { 
    15161522                        DEBUG(4,("get_dc_list: no servers found\n"));  
    1517                         SAFE_FREE(auto_ip_list); 
    1518                         return NT_STATUS_NO_LOGON_SERVERS; 
     1523                        status = NT_STATUS_NO_LOGON_SERVERS; 
     1524                        goto out; 
    15191525                } 
    15201526                if (internal_resolve_name(domain, 0x1C, sitename, ip_list, count, 
    15211527                                          resolve_order)) { 
    1522                         return NT_STATUS_OK; 
     1528                        status = NT_STATUS_OK; 
     1529                        goto out; 
    15231530                } else { 
    1524                         return NT_STATUS_NO_LOGON_SERVERS; 
     1531                        status = NT_STATUS_NO_LOGON_SERVERS; 
     1532                        goto out; 
    15251533                } 
    15261534        } 
     
    15281536        if ( (return_iplist = SMB_MALLOC_ARRAY(struct ip_service, num_addresses)) == NULL ) { 
    15291537                DEBUG(3,("get_dc_list: malloc fail !\n")); 
    1530                 SAFE_FREE(auto_ip_list); 
    1531                 return NT_STATUS_NO_MEMORY; 
     1538                status = NT_STATUS_NO_MEMORY; 
     1539                goto out; 
    15321540        } 
    15331541 
     
    15861594        } 
    15871595                                 
    1588         SAFE_FREE(auto_ip_list); 
    1589  
    15901596        /* need to remove duplicates in the list if we have any  
    15911597           explicit password servers */ 
     
    16071613        *count = local_count; 
    16081614 
    1609         return ( *count != 0 ? NT_STATUS_OK : NT_STATUS_NO_LOGON_SERVERS ); 
     1615        status = ( *count != 0 ? NT_STATUS_OK : NT_STATUS_NO_LOGON_SERVERS ); 
     1616 
     1617  out: 
     1618 
     1619        if (!NT_STATUS_IS_OK(status)) { 
     1620                SAFE_FREE(return_iplist); 
     1621                *ip_list = NULL; 
     1622                *count = 0; 
     1623        } 
     1624 
     1625        SAFE_FREE(auto_ip_list); 
     1626 
     1627        return status; 
    16101628} 
    16111629