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 | df43f3d41009f170295f93f6d6df1b6e84077616 (patch) | |
tree | c182985dddbb7e5548eab1eccf0fd91f089f1033 /source3/auth | |
parent | 276ff4df82313abcf09db2d373a4229a5b8db506 (diff) | |
download | samba-df43f3d41009f170295f93f6d6df1b6e84077616.tar.gz samba-df43f3d41009f170295f93f6d6df1b6e84077616.tar.bz2 samba-df43f3d41009f170295f93f6d6df1b6e84077616.zip |
Ensure that winbindd and smbd both use identical logic to find dc's.
Fix bug where zeroip addresses were being checked.
Jeremy.
(This used to be commit 8ed49fe0df201833329c17b2afe1e3aa70646558)
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_domain.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index 947cd41a26..c7bfea4f6a 100644 --- a/source3/auth/auth_domain.c +++ b/source3/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; } |