svn commit: samba r8226 - in
branches/SAMBA_4_0/source/rpc_server/netlogon: .
metze at samba.org
metze at samba.org
Fri Jul 8 05:19:28 GMT 2005
Author: metze
Date: 2005-07-08 05:19:28 +0000 (Fri, 08 Jul 2005)
New Revision: 8226
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8226
Log:
w2k3 adds a '.' after the forest and domain dns names for the primary domain
and NULL for the trusted domains forest dns name
metze
Modified:
branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c
Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c 2005-07-08 05:16:43 UTC (rev 8225)
+++ branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c 2005-07-08 05:19:28 UTC (rev 8226)
@@ -856,6 +856,24 @@
/*
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 @@
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 @@
return NT_STATUS_NO_MEMORY;
}
- status = fill_domain_trust_info(mem_ctx, res1[0], &info1->domaininfo, True);
+ status = fill_domain_primary_info(mem_ctx, res1[0], &info1->domaininfo);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
- status = fill_domain_trust_info(mem_ctx, res1[0], &info1->trusts[0], True);
- 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;
More information about the samba-cvs
mailing list