summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-02-10 17:28:05 +1100
committerAndrew Tridgell <tridge@samba.org>2009-02-10 17:28:05 +1100
commit72c2da9d327288552084efad831ef8c3518de835 (patch)
tree414075dae6079a94ec4fe97d662c5a2396615819 /source4
parentb4a4d4c9d06c93188d9705f944cde8ed359bd3f3 (diff)
downloadsamba-72c2da9d327288552084efad831ef8c3518de835.tar.gz
samba-72c2da9d327288552084efad831ef8c3518de835.tar.bz2
samba-72c2da9d327288552084efad831ef8c3518de835.zip
fixed two problems with the DsRGetDCNameEx2 call, as used by
Win7-beta. The first problem is that we removed the dnsDomain attribute a while back, so we were returning NULL for two fields. We now return the realm. The second problem is that Win7-beta sends the domain in the form the user typed it, so it may be in either the short or long form. We check for the short form and convert if needed.
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index a9150d1a9a..d5484d0da0 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1166,7 +1166,7 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesW(struct dcesrv_call_state *dce_c
static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct netr_DsRGetDCNameEx2 *r)
{
- const char * const attrs[] = { "dnsDomain", "objectGUID", NULL };
+ const char * const attrs[] = { "objectGUID", NULL };
void *sam_ctx;
struct ldb_message **res;
struct ldb_dn *domain_dn;
@@ -1180,6 +1180,12 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
return WERR_DS_SERVICE_UNAVAILABLE;
}
+ /* Win7-beta will send the domain name in the form the user typed, so we have to cope
+ with both the short and long form here */
+ if (strcasecmp(r->in.domain_name, lp_workgroup(dce_call->conn->dce_ctx->lp_ctx)) == 0) {
+ r->in.domain_name = lp_realm(dce_call->conn->dce_ctx->lp_ctx);
+ }
+
domain_dn = samdb_dns_domain_to_dn(sam_ctx, mem_ctx,
r->in.domain_name);
if (domain_dn == NULL) {
@@ -1205,8 +1211,8 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA
W_ERROR_HAVE_NO_MEMORY(info->dc_address);
info->dc_address_type = DS_ADDRESS_TYPE_INET;
info->domain_guid = samdb_result_guid(res[0], "objectGUID");
- info->domain_name = samdb_result_string(res[0], "dnsDomain", NULL);
- info->forest_name = samdb_result_string(res[0], "dnsDomain", NULL);
+ info->domain_name = lp_realm(dce_call->conn->dce_ctx->lp_ctx);
+ info->forest_name = lp_realm(dce_call->conn->dce_ctx->lp_ctx);
info->dc_flags = DS_DNS_FOREST |
DS_DNS_DOMAIN |
DS_DNS_CONTROLLER |