summaryrefslogtreecommitdiff
path: root/source3/lib
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/lib
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/lib')
-rw-r--r--source3/lib/netapi/joindomain.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 74ed8f2302..b7c9fa5acc 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -47,6 +47,7 @@ WERROR NetJoinDomain_l(struct libnetapi_ctx *mem_ctx,
if (r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) {
NTSTATUS status;
struct netr_DsRGetDCNameInfo *info = NULL;
+ const char *dc = NULL;
uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED |
DS_WRITABLE_REQUIRED |
DS_RETURN_DNS_NAME;
@@ -57,8 +58,9 @@ WERROR NetJoinDomain_l(struct libnetapi_ctx *mem_ctx,
"%s", get_friendly_nt_error_msg(status));
return ntstatus_to_werror(status);
}
- j->in.dc_name = talloc_strdup(mem_ctx,
- info->dc_unc);
+
+ dc = strip_hostname(info->dc_unc);
+ j->in.dc_name = talloc_strdup(mem_ctx, dc);
W_ERROR_HAVE_NO_MEMORY(j->in.dc_name);
}
@@ -174,6 +176,7 @@ WERROR NetUnjoinDomain_l(struct libnetapi_ctx *mem_ctx,
} else {
NTSTATUS status;
struct netr_DsRGetDCNameInfo *info = NULL;
+ const char *dc = NULL;
uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED |
DS_WRITABLE_REQUIRED |
DS_RETURN_DNS_NAME;
@@ -186,8 +189,9 @@ WERROR NetUnjoinDomain_l(struct libnetapi_ctx *mem_ctx,
get_friendly_nt_error_msg(status));
return ntstatus_to_werror(status);
}
- u->in.dc_name = talloc_strdup(mem_ctx,
- info->dc_unc);
+
+ dc = strip_hostname(info->dc_unc);
+ u->in.dc_name = talloc_strdup(mem_ctx, dc);
W_ERROR_HAVE_NO_MEMORY(u->in.dc_name);
u->in.domain_name = domain;
@@ -352,6 +356,7 @@ WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx,
ADS_STATUS ads_status;
ADS_STRUCT *ads = NULL;
struct netr_DsRGetDCNameInfo *info = NULL;
+ const char *dc = NULL;
uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED |
DS_RETURN_DNS_NAME;
@@ -363,7 +368,9 @@ WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx,
return ntstatus_to_werror(status);
}
- ads = ads_init(r->in.domain, r->in.domain, info->dc_unc);
+ dc = strip_hostname(info->dc_unc);
+
+ ads = ads_init(r->in.domain, r->in.domain, dc);
if (!ads) {
return WERR_GENERAL_FAILURE;
}