diff options
author | Gerald Carter <jerry@samba.org> | 2005-01-31 16:32:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:29 -0500 |
commit | 7ff184334d721e71a4f8e34c3d8346403a57dce5 (patch) | |
tree | 92195e8fa94e2261754027ca5a87735a4d01950a /source3 | |
parent | df529258657108eac450bc0f2bc872d4af8c6f70 (diff) | |
download | samba-7ff184334d721e71a4f8e34c3d8346403a57dce5.tar.gz samba-7ff184334d721e71a4f8e34c3d8346403a57dce5.tar.bz2 samba-7ff184334d721e71a4f8e34c3d8346403a57dce5.zip |
r5140: (a) fix problem with enumerating domain trusts in security = ads; (b) fix a segfault in rpcclient's dsenumdomtrusts
(This used to be commit 558525abf14432bd5527e5578ce18d128627dabb)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_client/cli_ds.c | 2 | ||||
-rw-r--r-- | source3/rpcclient/cmd_ds.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_ds.c b/source3/rpc_client/cli_ds.c index 7719f97034..40a32c7ee0 100644 --- a/source3/rpc_client/cli_ds.c +++ b/source3/rpc_client/cli_ds.c @@ -110,7 +110,7 @@ NTSTATUS cli_ds_enum_domain_trusts(struct cli_state *cli, TALLOC_CTX *mem_ctx, init_q_ds_enum_domain_trusts( &q, server, flags ); if (!ds_io_q_enum_domain_trusts("", &qbuf, 0, &q) - || !rpc_api_pipe_req(cli, PI_LSARPC_DS, DS_ENUM_DOM_TRUSTS, &qbuf, &rbuf)) { + || !rpc_api_pipe_req(cli, PI_NETLOGON, DS_ENUM_DOM_TRUSTS, &qbuf, &rbuf)) { result = NT_STATUS_UNSUCCESSFUL; goto done; } diff --git a/source3/rpcclient/cmd_ds.c b/source3/rpcclient/cmd_ds.c index c5b12ed150..0a1fd7e012 100644 --- a/source3/rpcclient/cmd_ds.c +++ b/source3/rpcclient/cmd_ds.c @@ -55,13 +55,15 @@ static NTSTATUS cmd_ds_enum_domain_trusts(struct cli_state *cli, uint32 flags = 0x1; struct ds_domain_trust *trusts = NULL; unsigned int num_domains = 0; + int i; 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 ); + + for (i=0; i<num_domains; i++ ) + printf("%s (%s)\n", trusts[i].dns_domain, trusts[i].netbios_domain); return result; } |