diff options
author | Jeremy Allison <jra@samba.org> | 2002-02-28 01:05:15 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-02-28 01:05:15 +0000 |
commit | 8ed49fe0df201833329c17b2afe1e3aa70646558 (patch) | |
tree | 28340dd41a946ca3180cc13798b817b41e14a5b5 /source/auth | |
parent | fe2db3148587937aa7b674c1c99036d42a3776b3 (diff) | |
download | samba-8ed49fe0df201833329c17b2afe1e3aa70646558.tar.gz samba-8ed49fe0df201833329c17b2afe1e3aa70646558.tar.xz samba-8ed49fe0df201833329c17b2afe1e3aa70646558.zip |
Ensure that winbindd and smbd both use identical logic to find dc's.
Fix bug where zeroip addresses were being checked.
Jeremy.
Diffstat (limited to 'source/auth')
-rw-r--r-- | source/auth/auth_domain.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c index 947cd41a265..c7bfea4f6a8 100644 --- a/source/auth/auth_domain.c +++ b/source/auth/auth_domain.c @@ -197,9 +197,8 @@ static NTSTATUS find_connect_pdc(struct cli_state **cli, if(!is_local_net(ip_list[i])) continue; - if(NT_STATUS_IS_OK(nt_status = - attempt_connect_to_dc(cli, domain, - &ip_list[i], trust_passwd))) + if(NT_STATUS_IS_OK(nt_status = attempt_connect_to_dc(cli, domain, + &ip_list[i], trust_passwd))) break; zero_ip(&ip_list[i]); /* Tried and failed. */ @@ -211,10 +210,11 @@ static NTSTATUS find_connect_pdc(struct cli_state **cli, if(!NT_STATUS_IS_OK(nt_status)) { i = (sys_random() % count); - if (!NT_STATUS_IS_OK(nt_status = - attempt_connect_to_dc(cli, domain, - &ip_list[i], trust_passwd))) - zero_ip(&ip_list[i]); /* Tried and failed. */ + if (!is_zero_ip(ip_list[i])) { + if (!NT_STATUS_IS_OK(nt_status = attempt_connect_to_dc(cli, domain, + &ip_list[i], trust_passwd))) + zero_ip(&ip_list[i]); /* Tried and failed. */ + } } /* @@ -227,15 +227,16 @@ static NTSTATUS find_connect_pdc(struct cli_state **cli, * Note that from a WINS server the #1 IP address is the PDC. */ for(i = 0; i < count; i++) { - if (NT_STATUS_IS_OK(nt_status = - attempt_connect_to_dc(cli, domain, - &ip_list[i], trust_passwd))) + if (is_zero_ip(ip_list[i])) + continue; + + if (NT_STATUS_IS_OK(nt_status = attempt_connect_to_dc(cli, domain, + &ip_list[i], trust_passwd))) break; } } SAFE_FREE(ip_list); - return nt_status; } |