diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-01-22 17:12:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:08 -0500 |
commit | f6fed0082bfaf40e9d213f3ed1613c2377c73d4f (patch) | |
tree | 6783877ec733975b6b86e091e57a8d69c9c26f5c /source3/rpcclient | |
parent | a851dcd09a5aff51707a49ace567a272a58837b7 (diff) | |
download | samba-f6fed0082bfaf40e9d213f3ed1613c2377c73d4f.tar.gz samba-f6fed0082bfaf40e9d213f3ed1613c2377c73d4f.tar.bz2 samba-f6fed0082bfaf40e9d213f3ed1613c2377c73d4f.zip |
r4933: List not only the first 10 trusts with rpcclient -c enumtrust.
Volker
(This used to be commit 9ca6cfcf1e4a905d47429a6dc18e2bd7ad5fe1e3)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 7d60749ae2..597c950a24 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -278,23 +278,29 @@ static NTSTATUS cmd_lsa_enum_trust_dom(struct cli_state *cli, if (!NT_STATUS_IS_OK(result)) goto done; - /* Lookup list of trusted domains */ - - result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx, - &num_domains, - &domain_names, &domain_sids); - if (!NT_STATUS_IS_OK(result) && - !NT_STATUS_EQUAL(result, NT_STATUS_NO_MORE_ENTRIES) && - !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) - goto done; - - /* Print results: list of names and sids returned in this response. */ - for (i = 0; i < num_domains; i++) { - fstring sid_str; + result = STATUS_MORE_ENTRIES; + + while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) { - sid_to_string(sid_str, &domain_sids[i]); - printf("%s %s\n", domain_names[i] ? domain_names[i] : - "*unknown*", sid_str); + /* Lookup list of trusted domains */ + + result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx, + &num_domains, + &domain_names, &domain_sids); + if (!NT_STATUS_IS_OK(result) && + !NT_STATUS_EQUAL(result, NT_STATUS_NO_MORE_ENTRIES) && + !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) + goto done; + + /* Print results: list of names and sids returned in this + * response. */ + for (i = 0; i < num_domains; i++) { + fstring sid_str; + + sid_to_string(sid_str, &domain_sids[i]); + printf("%s %s\n", domain_names[i] ? domain_names[i] : + "*unknown*", sid_str); + } } done: |