summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_rpc.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-06-23 19:05:23 +0000
committerGerald Carter <jerry@samba.org>2003-06-23 19:05:23 +0000
commitf36c96d59c79a51610bb5a1fc42ac62bd8d08401 (patch)
tree69560bd452906389aab36ac7eb8109de7ff32ccc /source3/nsswitch/winbindd_rpc.c
parentd21358308a2a2c86b4e9d23922c7c940b5d1b012 (diff)
downloadsamba-f36c96d59c79a51610bb5a1fc42ac62bd8d08401.tar.gz
samba-f36c96d59c79a51610bb5a1fc42ac62bd8d08401.tar.bz2
samba-f36c96d59c79a51610bb5a1fc42ac62bd8d08401.zip
* s/get_dc_name/rpc_dc_name/g (revert a previous change)
* move back to qsort() for sorting IP address in get_dc_list() * remove dc_name_cache in cm_get_dc_name() since it slowed things down more than it helped. I've made a note of where to add in the negative connection cache in the ads code. Will come back to that. * fix rpcclient to use PRINTER_ALL_ACCESS for set printer (instead of MAX_ALLOWED) * only enumerate domain local groups in our domain * simplify ldap search for seqnum in winbindd's rpc backend (This used to be commit f8cab8635b02b205b4031279cedd804c1fb22c5b)
Diffstat (limited to 'source3/nsswitch/winbindd_rpc.c')
-rw-r--r--source3/nsswitch/winbindd_rpc.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c
index 7d6055006d..131a7cfd43 100644
--- a/source3/nsswitch/winbindd_rpc.c
+++ b/source3/nsswitch/winbindd_rpc.c
@@ -734,12 +734,6 @@ static int get_ldap_seq(const char *server, uint32 *seq)
if ((ldp = ldap_open_with_timeout(server, LDAP_PORT, 10)) == NULL)
return -1;
-#if 0
- /* As per tridge comment this doesn't seem to be needed. JRA */
- if ((err = ldap_simple_bind_s(ldp, NULL, NULL)) != 0)
- goto done;
-#endif
-
/* Timeout if no response within 20 seconds. */
to.tv_sec = 10;
to.tv_usec = 0;
@@ -786,38 +780,10 @@ int get_ldap_sequence_number( const char* domain, uint32 *seq)
return False;
}
- if ( !list_ordered )
- {
- /*
- * Pick a nice close server. Look for DC on local net
- * (assuming we don't have a list of preferred DC's)
- */
-
- for (i = 0; i < count; i++) {
- if (is_zero_ip(ip_list[i]))
- continue;
-
- if ( !is_local_net(ip_list[i]) )
- continue;
-
- if ( (ret = get_ldap_seq( inet_ntoa(ip_list[i]), seq)) == 0 )
- goto done;
-
- zero_ip(&ip_list[i]);
- }
+ /* sort the list so we can pick a close server */
-
- /*
- * Secondly try and contact a random PDC/BDC.
- */
-
- i = (sys_random() % count);
-
- if ( !is_zero_ip(ip_list[i]) ) {
- if ( (ret = get_ldap_seq( inet_ntoa(ip_list[i]), seq)) == 0 )
- goto done;
- }
- zero_ip(&ip_list[i]); /* Tried and failed. */
+ if (!list_ordered && (count > 1) ) {
+ qsort(ip_list, count, sizeof(struct in_addr), QSORT_CAST ip_compare);
}
/* Finally return first DC that we can contact */