diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-01-22 17:12:19 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2005-01-22 17:12:19 +0000 |
commit | 168c7eece9d0bbc477302aa9c749ecbe6fdcb93f (patch) | |
tree | 85d40fd4496206af25542faf3452006b474cddb4 /source/rpcclient | |
parent | 9c643ecdb86d9192adac34ebb0fc465a8c21c549 (diff) | |
download | samba-168c7eece9d0bbc477302aa9c749ecbe6fdcb93f.tar.gz samba-168c7eece9d0bbc477302aa9c749ecbe6fdcb93f.tar.xz samba-168c7eece9d0bbc477302aa9c749ecbe6fdcb93f.zip |
r4933: List not only the first 10 trusts with rpcclient -c enumtrust.
Volker
Diffstat (limited to 'source/rpcclient')
-rw-r--r-- | source/rpcclient/cmd_lsarpc.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/source/rpcclient/cmd_lsarpc.c b/source/rpcclient/cmd_lsarpc.c index 7d60749ae2f..597c950a241 100644 --- a/source/rpcclient/cmd_lsarpc.c +++ b/source/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: |