From 614c18d24bc1bb19c884138c8c16099d1b8484d2 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Jan 2004 02:04:37 +0000 Subject: rpc_client/cli_lsarpc.c: rpc_parse/parse_lsa.c: nsswitch/winbindd_rpc.c: nsswitch/winbindd.h: - Add const libads/ads_ldap.c: - Cleanup function for use nsswitch/winbindd_ads.c: - Use new utility function ads_sid_to_dn - Don't search for 'dn=', rather call the ads_search_retry_dn() nsswitch/winbindd_ads.c: include/rpc_ds.h: rpc_client/cli_ds.c: - Fixup braindamage in cli_ds_enum_domain_trusts(): - This function was returning a UNISTR2 up to the caller, and was doing nasty (invalid, per valgrind) things with memcpy() - Create a new structure that represents this informaiton in a useful way and use talloc. Andrew Bartlett (This used to be commit 06c3f15aa166bb567d8be0a8bc4b095b167ab371) --- source3/rpc_client/cli_ds.c | 34 +++++++++++++++++++++++++++------- source3/rpc_client/cli_lsarpc.c | 2 +- 2 files changed, 28 insertions(+), 8 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_ds.c b/source3/rpc_client/cli_ds.c index a7a093328c..f8455edcd9 100644 --- a/source3/rpc_client/cli_ds.c +++ b/source3/rpc_client/cli_ds.c @@ -82,7 +82,7 @@ done: NTSTATUS cli_ds_enum_domain_trusts(struct cli_state *cli, TALLOC_CTX *mem_ctx, const char *server, uint32 flags, - DS_DOMAIN_TRUSTS **trusts, uint32 *num_domains) + struct ds_domain_trust **trusts, uint32 *num_domains) { prs_struct qbuf, rbuf; DS_Q_ENUM_DOM_TRUSTS q; @@ -118,12 +118,32 @@ NTSTATUS cli_ds_enum_domain_trusts(struct cli_state *cli, TALLOC_CTX *mem_ctx, int i; *num_domains = r.num_domains; - *trusts = (DS_DOMAIN_TRUSTS*)smb_xmalloc(r.num_domains*sizeof(DS_DOMAIN_TRUSTS)); - - memcpy( *trusts, r.domains.trusts, r.num_domains*sizeof(DS_DOMAIN_TRUSTS) ); - for ( i=0; i