From 3c669340f529c559bff88168c3f9ddac9790d6c3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Nov 2003 10:01:24 +0000 Subject: added lsa_EnumTrustDom (This used to be commit ef60a70912c70b11438b53ed033efe31f662143d) --- source4/torture/rpc/lsa.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 8e3a36bb74..90db819a33 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -368,6 +368,42 @@ static BOOL test_EnumPrivs(struct dcerpc_pipe *p, } +static BOOL test_EnumTrustDom(struct dcerpc_pipe *p, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + struct lsa_EnumTrustDom r; + NTSTATUS status; + int i; + uint32 resume_handle = 0; + + printf("\nTesting EnumTrustDom\n"); + + r.in.handle = handle; + r.in.resume_handle = &resume_handle; + r.in.num_entries = 1000; + r.out.resume_handle = &resume_handle; + + status = dcerpc_lsa_EnumTrustDom(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("EnumTrustDom failed - %s\n", nt_errstr(status)); + return False; + } + + if (r.out.domains) { + printf("lookup gave %d domains (max_count=%d)\n", + r.out.domains->count, + r.out.domains->max_count); + for (i=0;icount;i++) { + printf("name='%s' sid=%s\n", + r.out.domains->domains[i].name.name, + lsa_sid_string_talloc(mem_ctx, r.out.domains->domains[i].sid)); + } + } + + return True; +} + static BOOL test_Delete(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) @@ -447,6 +483,10 @@ BOOL torture_rpc_lsa(int dummy) if (!test_EnumPrivs(p, mem_ctx, &handle)) { ret = False; } + + if (!test_EnumTrustDom(p, mem_ctx, &handle)) { + ret = False; + } #if 0 if (!test_Delete(p, mem_ctx, &handle)) { -- cgit