From 86dee43f390d7fdfdfb90c67189a38ed8398f8d9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 25 Nov 2001 06:38:17 +0000 Subject: Use "password server" for searching for BDC's also as Tim suggested. Jeremy. (This used to be commit 4aca67761fbe601e27f8f768c28a11241f088bba) --- source3/libsmb/namequery.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index f8688ddb25..dff3570842 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1181,12 +1181,14 @@ NT GETDC call, UNICODE, NT domain SID and uncle tom cobbley and all... BOOL get_dc_list(BOOL pdc_only, char *group, struct in_addr **ip_list, int *count) { + int name_type = pdc_only ? 0x1B : 0x1C; + /* - * If we're looking for a PDC and it's our domain then + * If it's our domain then * use the 'password server' parameter. */ - if (pdc_only && strequal(group, lp_workgroup())) { + if (strequal(group, lp_workgroup())) { char *p; char *pserver = lp_passwordserver(); fstring name; @@ -1194,16 +1196,16 @@ BOOL get_dc_list(BOOL pdc_only, char *group, struct in_addr **ip_list, int *coun struct in_addr *return_iplist = NULL; if (! *pserver) - return internal_resolve_name(group, 0x1B, ip_list, count); + return internal_resolve_name(group, name_type, ip_list, count); p = pserver; while (next_token(&p,name,LIST_SEP,sizeof(name))) { if (strequal(name, "*")) - return internal_resolve_name(group, 0x1B, ip_list, count); + return internal_resolve_name(group, name_type, ip_list, count); num_adresses++; } if (num_adresses == 0) - return internal_resolve_name(group, 0x1B, ip_list, count); + return internal_resolve_name(group, name_type, ip_list, count); return_iplist = (struct in_addr *)malloc(num_adresses * sizeof(struct in_addr)); if(return_iplist == NULL) { @@ -1221,7 +1223,7 @@ BOOL get_dc_list(BOOL pdc_only, char *group, struct in_addr **ip_list, int *coun *ip_list = return_iplist; return (*count != 0); } else - return internal_resolve_name(group, pdc_only ? 0x1B : 0x1C, ip_list, count); + return internal_resolve_name(group, name_type, ip_list, count); } /******************************************************** -- cgit