summaryrefslogtreecommitdiff
path: root/source4/rpc_server/netlogon
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-27 16:07:33 +0100
committerGünther Deschner <gd@samba.org>2008-10-28 23:40:52 +0100
commit2a7de4e3f802f1a180132f766ce2c5effd971dc2 (patch)
tree671cafd3e6625ee5aa955a3799e98428562ea80d /source4/rpc_server/netlogon
parent0992a9d987e521a76d267b2be1259810e1821406 (diff)
downloadsamba-2a7de4e3f802f1a180132f766ce2c5effd971dc2.tar.gz
samba-2a7de4e3f802f1a180132f766ce2c5effd971dc2.tar.bz2
samba-2a7de4e3f802f1a180132f766ce2c5effd971dc2.zip
s4-netlogon: merge netr_DsrEnumerateDomainTrusts from s3 idl.
Guenther
Diffstat (limited to 'source4/rpc_server/netlogon')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 9d4c897892..d9717fdc57 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1280,7 +1280,7 @@ static WERROR dcesrv_netr_DsrGetDcSiteCoverageW(struct dcesrv_call_state *dce_ca
static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct netr_DsrEnumerateDomainTrusts *r)
{
- struct netr_DomainTrust *trusts;
+ struct netr_DomainTrustList *trusts;
void *sam_ctx;
int ret;
struct ldb_message **dom_res, **ref_res;
@@ -1315,25 +1315,29 @@ static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce
return WERR_GENERAL_FAILURE;
}
- trusts = talloc_array(mem_ctx, struct netr_DomainTrust, ret);
+ trusts = talloc(mem_ctx, struct netr_DomainTrustList);
W_ERROR_HAVE_NO_MEMORY(trusts);
-
- r->out.count = 1;
+
+ trusts->array = talloc_array(trusts, struct netr_DomainTrust, ret);
+ W_ERROR_HAVE_NO_MEMORY(trusts->array);
+
+ trusts->count = 1; /* ?? */
+
r->out.trusts = trusts;
/* TODO: add filtering by trust_flags, and correct trust_type
and attributes */
- trusts[0].netbios_name = samdb_result_string(ref_res[0], "nETBIOSName", NULL);
- trusts[0].dns_name = samdb_result_string(ref_res[0], "dnsRoot", NULL);
- trusts[0].trust_flags =
+ trusts->array[0].netbios_name = samdb_result_string(ref_res[0], "nETBIOSName", NULL);
+ trusts->array[0].dns_name = samdb_result_string(ref_res[0], "dnsRoot", NULL);
+ trusts->array[0].trust_flags =
NETR_TRUST_FLAG_TREEROOT |
NETR_TRUST_FLAG_IN_FOREST |
NETR_TRUST_FLAG_PRIMARY;
- trusts[0].parent_index = 0;
- trusts[0].trust_type = 2;
- trusts[0].trust_attributes = 0;
- trusts[0].sid = samdb_result_dom_sid(mem_ctx, dom_res[0], "objectSid");
- trusts[0].guid = samdb_result_guid(dom_res[0], "objectGUID");
+ trusts->array[0].parent_index = 0;
+ trusts->array[0].trust_type = 2;
+ trusts->array[0].trust_attributes = 0;
+ trusts->array[0].sid = samdb_result_dom_sid(mem_ctx, dom_res[0], "objectSid");
+ trusts->array[0].guid = samdb_result_guid(dom_res[0], "objectGUID");
return WERR_OK;
}