summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_cm.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-11-23 14:52:34 +0000
committerGerald Carter <jerry@samba.org>2002-11-23 14:52:34 +0000
commit3ab6fcc5c6160d322bdfd2ca771dcf7954e92df7 (patch)
tree79b11f5d6c2e48f37f7d589b10872dde741ee28a /source3/nsswitch/winbindd_cm.c
parentf230981e2cfc6809e50c11987c47b8dbc1727f41 (diff)
downloadsamba-3ab6fcc5c6160d322bdfd2ca771dcf7954e92df7.tar.gz
samba-3ab6fcc5c6160d322bdfd2ca771dcf7954e92df7.tar.bz2
samba-3ab6fcc5c6160d322bdfd2ca771dcf7954e92df7.zip
[merge from APP_HEAD]
90% fix for CR 1076. The password server parameter will no take things like password server = DC1 * which means to contact DC1 first and the go to auto lookup if it fails. jerry (This used to be commit 016ef8b36b30846311a5321803298f8e28719244)
Diffstat (limited to 'source3/nsswitch/winbindd_cm.c')
-rw-r--r--source3/nsswitch/winbindd_cm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index d44219d172..403bc38052 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -142,8 +142,9 @@ static BOOL cm_rpc_find_dc(const char *domain, struct in_addr *dc_ip, fstring sr
{
struct in_addr *ip_list = NULL;
int count, i;
+ BOOL list_ordered;
- if (!get_dc_list(domain, &ip_list, &count)) {
+ if (!get_dc_list(domain, &ip_list, &count, &list_ordered)) {
struct in_addr pdc_ip;
if (!get_pdc_ip(domain, &pdc_ip)) {
@@ -161,8 +162,8 @@ static BOOL cm_rpc_find_dc(const char *domain, struct in_addr *dc_ip, fstring sr
count = 1;
}
- /* Pick a nice close server */
- if (count > 1) {
+ /* Pick a nice close server, but only if the list was not ordered */
+ if (!list_ordered && (count > 1) ) {
qsort(ip_list, count, sizeof(struct in_addr), QSORT_CAST ip_compare);
}