r5140: (a) fix problem with enumerating domain trusts in security = ads; (b) fix...
authorGerald Carter <jerry@samba.org>
Mon, 31 Jan 2005 16:32:14 +0000 (16:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:29 +0000 (10:55 -0500)
(This used to be commit 558525abf14432bd5527e5578ce18d128627dabb)

source3/rpc_client/cli_ds.c
source3/rpcclient/cmd_ds.c

index 7719f97034e508dd311642d201d1ad8f3ab3f538..40a32c7ee0c76ca5dd2c59515e11d6ea35e52003 100644 (file)
@@ -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;
        }
index c5b12ed1503d6cc04b5878db5a9779540c077b19..0a1fd7e012ba19515e846ed9a3946134cc540906 100644 (file)
@@ -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;
 }