summaryrefslogtreecommitdiff
path: root/source4/rpc_server/netlogon
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-08 05:19:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:22 -0500
commitb7952f805872083da9ce233ef0d278f364a1c738 (patch)
tree31610a882fece61c5091cb37cb458a7de23b4e97 /source4/rpc_server/netlogon
parentb82f504072281aedf5b41b57631c8bd527a390a7 (diff)
downloadsamba-b7952f805872083da9ce233ef0d278f364a1c738.tar.gz
samba-b7952f805872083da9ce233ef0d278f364a1c738.tar.bz2
samba-b7952f805872083da9ce233ef0d278f364a1c738.zip
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)
Diffstat (limited to 'source4/rpc_server/netlogon')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c37
1 files changed, 27 insertions, 10 deletions
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
@@ -856,6 +856,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
+*/
static NTSTATUS fill_domain_trust_info(TALLOC_CTX *mem_ctx, struct ldb_message *res,
struct netr_DomainTrustInfo *info, BOOL is_local)
{
@@ -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;i<ret2;i++) {
- status = fill_domain_trust_info(mem_ctx, res2[i], &info1->trusts[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;