From b7952f805872083da9ce233ef0d278f364a1c738 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 8 Jul 2005 05:19:28 +0000 Subject: r8226: w2k3 adds a '.' after the forest and domain dns names for the primary domain and NULL for the trusted domains forest dns name metze (This used to be commit 225fc1b8658f01217b55e2d1c6d5814ee5022559) --- source4/rpc_server/netlogon/dcerpc_netlogon.c | 37 +++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'source4/rpc_server/netlogon') diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 1317ea31a9..ca7b938ea6 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -853,6 +853,24 @@ static WERROR netr_DSRGETSITENAME(struct dcesrv_call_state *dce_call, TALLOC_CTX } +/* + fill in a netr_DomainTrustInfo from a ldb search result +*/ +static NTSTATUS fill_domain_primary_info(TALLOC_CTX *mem_ctx, struct ldb_message *res, + struct netr_DomainTrustInfo *info) +{ + ZERO_STRUCTP(info); + + info->domainname.string = samdb_result_string(res, "name", NULL); + info->fulldomainname.string = talloc_asprintf(info, "%s.", samdb_result_string(res, "dnsDomain", NULL)); + /* TODO: we need proper forest support */ + info->forest.string = info->fulldomainname.string; + info->guid = samdb_result_guid(res, "objectGUID"); + info->sid = samdb_result_dom_sid(mem_ctx, res, "objectSid"); + + return NT_STATUS_OK; +} + /* fill in a netr_DomainTrustInfo from a ldb search result */ @@ -864,18 +882,17 @@ static NTSTATUS fill_domain_trust_info(TALLOC_CTX *mem_ctx, struct ldb_message * if (is_local) { info->domainname.string = samdb_result_string(res, "name", NULL); info->fulldomainname.string = samdb_result_string(res, "dnsDomain", NULL); + info->forest.string = NULL; info->guid = samdb_result_guid(res, "objectGUID"); info->sid = samdb_result_dom_sid(mem_ctx, res, "objectSid"); } else { info->domainname.string = samdb_result_string(res, "flatName", NULL); info->fulldomainname.string = samdb_result_string(res, "name", NULL); + info->forest.string = NULL; info->guid = samdb_result_guid(res, "objectGUID"); info->sid = samdb_result_dom_sid(mem_ctx, res, "securityIdentifier"); } - /* TODO: we need proper forest support */ - info->forest.string = info->fulldomainname.string; - return NT_STATUS_OK; } @@ -936,23 +953,23 @@ static NTSTATUS netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_call, TALL return NT_STATUS_NO_MEMORY; } - status = fill_domain_trust_info(mem_ctx, res1[0], &info1->domaininfo, True); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - status = fill_domain_trust_info(mem_ctx, res1[0], &info1->trusts[0], True); + status = fill_domain_primary_info(mem_ctx, res1[0], &info1->domaininfo); if (!NT_STATUS_IS_OK(status)) { return status; } for (i=0;itrusts[i+1], False); + status = fill_domain_trust_info(mem_ctx, res2[i], &info1->trusts[i], False); if (!NT_STATUS_IS_OK(status)) { return status; } } + status = fill_domain_trust_info(mem_ctx, res1[0], &info1->trusts[i], True); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + r->out.info.info1 = info1; return NT_STATUS_OK; -- cgit