summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-08 14:23:20 +0200
committerGünther Deschner <gd@samba.org>2008-05-09 14:59:19 +0200
commitf11acf358225ecf10a8af2a12e304019adc6ee4f (patch)
treeb0f54075aa5b223f870074d6ab85960c9bffeeeb /source3/libnet
parente556dfbb932759f7159735cc7559bd6e89ec7d12 (diff)
downloadsamba-f11acf358225ecf10a8af2a12e304019adc6ee4f.tar.gz
samba-f11acf358225ecf10a8af2a12e304019adc6ee4f.tar.bz2
samba-f11acf358225ecf10a8af2a12e304019adc6ee4f.zip
Use strip_hostname after dsgetdcname/getdcname calls.
Guenther (This used to be commit 82cbb3269b2e764c9c2a2fbcbe9c29feae07fb62)
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_join.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 7e348e25a5..8e503382f4 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1620,6 +1620,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
if (!r->in.dc_name) {
struct netr_DsRGetDCNameInfo *info;
+ const char *dc;
status = dsgetdcname(mem_ctx,
r->in.domain_name,
NULL,
@@ -1636,8 +1637,8 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
return WERR_DOMAIN_CONTROLLER_NOT_FOUND;
}
- r->in.dc_name = talloc_strdup(mem_ctx,
- info->dc_unc);
+ dc = strip_hostname(info->dc_unc);
+ r->in.dc_name = talloc_strdup(mem_ctx, dc);
W_ERROR_HAVE_NO_MEMORY(r->in.dc_name);
}
@@ -1775,6 +1776,7 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
if (!r->in.dc_name) {
struct netr_DsRGetDCNameInfo *info;
+ const char *dc;
status = dsgetdcname(mem_ctx,
r->in.domain_name,
NULL,
@@ -1791,8 +1793,8 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
return WERR_DOMAIN_CONTROLLER_NOT_FOUND;
}
- r->in.dc_name = talloc_strdup(mem_ctx,
- info->dc_unc);
+ dc = strip_hostname(info->dc_unc);
+ r->in.dc_name = talloc_strdup(mem_ctx, dc);
W_ERROR_HAVE_NO_MEMORY(r->in.dc_name);
}