summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-11-24 12:22:57 -0500
committerAndreas Schneider <asn@cryptomilk.org>2011-12-22 19:21:21 +0100
commit6765e7c2a6618be8fa2ddcb93800ef32c3f54830 (patch)
treec583a6548120eed004d717a893966da3b2d438be /source3
parent1c8f326dc6367969852d0ac30887428345be9d7d (diff)
downloadsamba-6765e7c2a6618be8fa2ddcb93800ef32c3f54830.tar.gz
samba-6765e7c2a6618be8fa2ddcb93800ef32c3f54830.tar.bz2
samba-6765e7c2a6618be8fa2ddcb93800ef32c3f54830.zip
s3-netlogon: use dsgetdcname() instead of get_dc_name()
Sometimes the domain parameter might not contain the NetBIOS name of the remote domain but the DNS name. Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Thu Dec 22 19:21:21 CET 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/netlogon/srv_netlog_nt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c
index 086a0ea3c5..fdbe9373a8 100644
--- a/source3/rpc_server/netlogon/srv_netlog_nt.c
+++ b/source3/rpc_server/netlogon/srv_netlog_nt.c
@@ -185,6 +185,8 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p,
struct netr_NETLOGON_INFO_4 *info4;
const char *fn;
uint32_t acct_ctrl;
+ NTSTATUS status;
+ struct netr_DsRGetDCNameInfo *dc_info;
switch (p->opnum) {
case NDR_NETR_LOGONCONTROL:
@@ -303,12 +305,15 @@ WERROR _netr_LogonControl2Ex(struct pipes_struct *p,
break;
}
- if (!get_dc_name(domain, NULL, dc_name2, &dc_ss)) {
+ status = dsgetdcname(p->mem_ctx, p->msg_ctx, domain, NULL, NULL,
+ DS_FORCE_REDISCOVERY | DS_RETURN_FLAT_NAME,
+ &dc_info);
+ if (!NT_STATUS_IS_OK(status)) {
tc_status = WERR_NO_LOGON_SERVERS;
break;
}
- dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
+ dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_info->dc_unc);
if (!dc_name) {
return WERR_NOMEM;
}