summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/rpc_client/cli_ds.c8
-rw-r--r--source/rpcclient/cmd_ds.c4
2 files changed, 12 insertions, 0 deletions
diff --git a/source/rpc_client/cli_ds.c b/source/rpc_client/cli_ds.c
index e73a0b795a1..2f2111e9635 100644
--- a/source/rpc_client/cli_ds.c
+++ b/source/rpc_client/cli_ds.c
@@ -114,6 +114,14 @@ NTSTATUS cli_ds_enum_domain_trusts(struct cli_state *cli, TALLOC_CTX *mem_ctx,
result = r.status;
+ if ( NT_STATUS_IS_OK(result) ) {
+
+ *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) );
+ }
+
done:
prs_mem_free(&qbuf);
prs_mem_free(&rbuf);
diff --git a/source/rpcclient/cmd_ds.c b/source/rpcclient/cmd_ds.c
index be677519c46..721bd59ba0c 100644
--- a/source/rpcclient/cmd_ds.c
+++ b/source/rpcclient/cmd_ds.c
@@ -59,6 +59,10 @@ static NTSTATUS cmd_ds_enum_domain_trusts(struct cli_state *cli,
result = cli_ds_enum_domain_trusts( cli, mem_ctx, cli->desthost, flags,
&trusts, &num_domains );
+ printf( "%d domains returned\n", num_domains );
+
+ SAFE_FREE( trusts );
+
return result;
}