diff options
author | Günther Deschner <gd@samba.org> | 2008-02-13 00:25:40 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-13 00:29:37 +0100 |
commit | 0ba3d44f7321cb235eb214194395d5da02824690 (patch) | |
tree | 6e383ccde2598de941883c5794632867de05f3c2 /source3/libsmb | |
parent | f57c67b8f3e75a9aa50c24ff892b12b530de6a38 (diff) | |
download | samba-0ba3d44f7321cb235eb214194395d5da02824690.tar.gz samba-0ba3d44f7321cb235eb214194395d5da02824690.tar.bz2 samba-0ba3d44f7321cb235eb214194395d5da02824690.zip |
Use rpccli_lsa_EnumTrustDom all over the place.
Guenther
(This used to be commit a25e7ffbca9c2c97dd36b0596e7cb38a72aaf9d9)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/trusts_util.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c index 1ca7d56a83..11f691bee6 100644 --- a/source3/libsmb/trusts_util.c +++ b/source3/libsmb/trusts_util.c @@ -152,6 +152,8 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, struct cli_state *cli = NULL; struct rpc_pipe_client *lsa_pipe; bool retry; + struct lsa_DomainList dom_list; + int i; *domain_names = NULL; *num_domains = 0; @@ -188,11 +190,33 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, /* Lookup list of trusted domains */ - result = rpccli_lsa_enum_trust_dom(lsa_pipe, mem_ctx, &pol, &enum_ctx, - num_domains, domain_names, sids); + result = rpccli_lsa_EnumTrustDom(lsa_pipe, mem_ctx, + &pol, + &enum_ctx, + &dom_list, + (uint32_t)-1); if ( !NT_STATUS_IS_OK(result) ) goto done; + *num_domains = dom_list.count; + + *domain_names = TALLOC_ZERO_ARRAY(mem_ctx, char *, *num_domains); + if (!*domain_names) { + result = NT_STATUS_NO_MEMORY; + goto done; + } + + *sids = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, *num_domains); + if (!*sids) { + result = NT_STATUS_NO_MEMORY; + goto done; + } + + for (i=0; i< *num_domains; i++) { + (*domain_names)[i] = CONST_DISCARD(char *, dom_list.domains[i].name.string); + (*sids)[i] = *dom_list.domains[i].sid; + } + done: /* cleanup */ if (cli) { |