summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-01-17 19:11:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:14 -0500
commitf3ad8bb00acf680863902721c57091d2bf622b72 (patch)
tree05958f2a582d3336ec341bada5dd391d48d7ecdd /source3/nsswitch
parentab41ff67f1308389a130c3a4ff804545d8998dd1 (diff)
downloadsamba-f3ad8bb00acf680863902721c57091d2bf622b72.tar.gz
samba-f3ad8bb00acf680863902721c57091d2bf622b72.tar.bz2
samba-f3ad8bb00acf680863902721c57091d2bf622b72.zip
r20860: Adding some small tweaks. When we have no sitename, there is no need to
ask for the list of DCs twice. Guenther (This used to be commit a9baf27e1348dd6dadd7a2fafdf9c269087b80ac)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_cm.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index 70ab9b0582..c854efd9b2 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -1121,18 +1121,20 @@ static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain,
get_dc_name(domain->name, lp_realm(), dcname, &ip);
sitename = sitename_fetch();
+ if (sitename) {
- /* Do the site-specific AD dns lookup first. */
- get_sorted_dc_list(domain->alt_name, sitename, &ip_list, &iplist_size, True);
+ /* Do the site-specific AD dns lookup first. */
+ get_sorted_dc_list(domain->alt_name, sitename, &ip_list, &iplist_size, True);
- for ( i=0; i<iplist_size; i++ ) {
- add_one_dc_unique(mem_ctx, domain->name, inet_ntoa(ip_list[i].ip),
- ip_list[i].ip, dcs, num_dcs);
- }
+ for ( i=0; i<iplist_size; i++ ) {
+ add_one_dc_unique(mem_ctx, domain->name, inet_ntoa(ip_list[i].ip),
+ ip_list[i].ip, dcs, num_dcs);
+ }
- SAFE_FREE(ip_list);
- SAFE_FREE(sitename);
- iplist_size = 0;
+ SAFE_FREE(ip_list);
+ SAFE_FREE(sitename);
+ iplist_size = 0;
+ }
/* Now we add DCs from the main AD dns lookup. */
get_sorted_dc_list(domain->alt_name, NULL, &ip_list, &iplist_size, True);