From 04bf12b176d5abe06b7f1401810369bcafe0b611 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 2 Aug 2003 20:06:57 +0000 Subject: port latest changes from SAMBA_3_0 tree (This used to be commit 3101c236b8241dc0183995ffceed551876427de4) --- source3/rpcclient/cmd_ds.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source3/rpcclient/cmd_ds.c') diff --git a/source3/rpcclient/cmd_ds.c b/source3/rpcclient/cmd_ds.c index 4c2f52e291..721bd59ba0 100644 --- a/source3/rpcclient/cmd_ds.c +++ b/source3/rpcclient/cmd_ds.c @@ -47,13 +47,33 @@ static NTSTATUS cmd_ds_dsrole_getprimarydominfo(struct cli_state *cli, return result; } +static NTSTATUS cmd_ds_enum_domain_trusts(struct cli_state *cli, + TALLOC_CTX *mem_ctx, int argc, + const char **argv) +{ + NTSTATUS result; + uint32 flags = 0x1; + DS_DOMAIN_TRUSTS *trusts = NULL; + int num_domains = 0; + + 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; +} + /* List of commands exported by this module */ struct cmd_set ds_commands[] = { { "LSARPC-DS" }, - { "dsroledominfo", RPC_RTYPE_NTSTATUS, cmd_ds_dsrole_getprimarydominfo, NULL, PI_LSARPC_DS, "Get Primary Domain Information", "" }, + { "dsroledominfo", RPC_RTYPE_NTSTATUS, cmd_ds_dsrole_getprimarydominfo, NULL, PI_LSARPC_DS, "Get Primary Domain Information", "" }, + { "dsenumdomtrusts", RPC_RTYPE_NTSTATUS, cmd_ds_enum_domain_trusts, NULL, PI_NETLOGON, "Enumerate all trusted domains in an AD forest", "" }, { NULL } }; -- cgit