summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_cm.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-11-06 01:29:07 +0000
committerTim Potter <tpot@samba.org>2002-11-06 01:29:07 +0000
commitea24bb2da8f643e043dc3af3ed3f16388878b57b (patch)
treedcffacff686f4867441fc7b177a865bcc43ea212 /source3/nsswitch/winbindd_cm.c
parent62d4ea1bc50bcd9f89fa054f60ca475f87b4a9de (diff)
downloadsamba-ea24bb2da8f643e043dc3af3ed3f16388878b57b.tar.gz
samba-ea24bb2da8f643e043dc3af3ed3f16388878b57b.tar.bz2
samba-ea24bb2da8f643e043dc3af3ed3f16388878b57b.zip
Merge of get_dc_list() api change. This was slightly more intrusive
than the version in APPLIANCE so watch out for boogs. (This used to be commit 1e054e3db654801fbb5580211529cdfdea9ed686)
Diffstat (limited to 'source3/nsswitch/winbindd_cm.c')
-rw-r--r--source3/nsswitch/winbindd_cm.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index 0287d2a866..b4d5a664b2 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -143,10 +143,22 @@ 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;
- if (!get_dc_list(False, domain, &ip_list, &count) &&
- !get_dc_list(True, domain, &ip_list, &count)) {
- DEBUG(3, ("Could not look up dc's for domain %s\n", domain));
- return False;
+ if (!get_dc_list(domain, &ip_list, &count)) {
+ struct in_addr pdc_ip;
+
+ if (!get_pdc_ip(domain, &pdc_ip)) {
+ DEBUG(3, ("Could not look up any DCs for domain %s\n",
+ domain));
+ return False;
+ }
+
+ ip_list = (struct in_addr *)malloc(sizeof(struct in_addr));
+
+ if (!ip_list)
+ return False;
+
+ ip_list[0] = pdc_ip;
+ count = 1;
}
/* Pick a nice close server */