From f11acf358225ecf10a8af2a12e304019adc6ee4f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 8 May 2008 14:23:20 +0200 Subject: Use strip_hostname after dsgetdcname/getdcname calls. Guenther (This used to be commit 82cbb3269b2e764c9c2a2fbcbe9c29feae07fb62) --- source3/winbindd/winbindd_cm.c | 8 +------- source3/winbindd/winbindd_locator.c | 7 ++----- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 0b0de5ad4f..377b1b2d21 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -655,13 +655,7 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, } /* rpccli_netr_GetAnyDCName gives us a name with \\ */ - p = tmp; - if (*p == '\\') { - p+=1; - } - if (*p == '\\') { - p+=1; - } + p = strip_hostname(tmp); fstrcpy(dcname, p); diff --git a/source3/winbindd/winbindd_locator.c b/source3/winbindd/winbindd_locator.c index 10a6c5afeb..f154f36c85 100644 --- a/source3/winbindd/winbindd_locator.c +++ b/source3/winbindd/winbindd_locator.c @@ -75,14 +75,11 @@ static enum winbindd_result dual_dsgetdcname(struct winbindd_domain *domain, } if (info->dc_address) { - dc = info->dc_address; - if ((dc[0] == '\\') && (dc[1] == '\\')) { - dc += 2; - } + dc = strip_hostname(info->dc_address); } if ((!dc || !is_ipaddress_v4(dc)) && info->dc_unc) { - dc = info->dc_unc; + dc = strip_hostname(info->dc_unc); } if (!dc || !*dc) { -- cgit