diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-08-06 05:11:57 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-08-06 05:11:57 +0000 |
commit | 4361b5cea56972b534ba36d89b521f9ad240d3d7 (patch) | |
tree | 363216dfd52eaeab8902acad2b6023a4d91fee4b /source3 | |
parent | 74c8441e9d21f317b74032b5bdd17c8d2f78c015 (diff) | |
download | samba-4361b5cea56972b534ba36d89b521f9ad240d3d7.tar.gz samba-4361b5cea56972b534ba36d89b521f9ad240d3d7.tar.bz2 samba-4361b5cea56972b534ba36d89b521f9ad240d3d7.zip |
when using netbios lookup methods make sure we try any BDCs even if
we get a response from WINS for a PDC, if the PDC isn't responding.
(This used to be commit 57916316ffc70b0b6659f3ad9d14aad41fad4c71)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libads/ldap.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index c8d940f331..2672489482 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -167,20 +167,32 @@ static BOOL ads_try_netbios(ADS_STRUCT *ads) DEBUG(6,("ads_try_netbios: looking for workgroup '%s'\n", workgroup)); - if (!get_dc_list(True, workgroup, &ip_list, &count) && - !get_dc_list(False, workgroup, &ip_list, &count)) { - return False; + /* try the PDC first */ + if (get_dc_list(True, workgroup, &ip_list, &count)) { + for (i=0;i<count;i++) { + DEBUG(6,("ads_try_netbios: trying server '%s'\n", + inet_ntoa(ip_list[i]))); + if (ads_try_connect(ads, inet_ntoa(ip_list[i]), LDAP_PORT)) { + free(ip_list); + return True; + } + } + free(ip_list); } - for (i=0;i<count;i++) { - DEBUG(6,("ads_try_netbios: trying server '%s'\n", inet_ntoa(ip_list[i]))); - if (ads_try_connect(ads, inet_ntoa(ip_list[i]), LDAP_PORT)) { - free(ip_list); - return True; + /* now any DC, including backups */ + if (get_dc_list(False, workgroup, &ip_list, &count)) { + for (i=0;i<count;i++) { + DEBUG(6,("ads_try_netbios: trying server '%s'\n", + inet_ntoa(ip_list[i]))); + if (ads_try_connect(ads, inet_ntoa(ip_list[i]), LDAP_PORT)) { + free(ip_list); + return True; + } } + free(ip_list); } - free(ip_list); return False; } |