diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/samr.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index b66e86815a..d4827e2504 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -21,6 +21,57 @@ #include "includes.h" +static BOOL test_EnumDomainUsers(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct samr_EnumDomainUsers r; + uint32 resume_handle=0; + + printf("Testing EnumDomainUsers\n"); + + r.in.handle = handle; + r.in.resume_handle = &resume_handle; + r.in.acct_flags = 0; + r.in.max_size = (uint32)-1; + r.out.resume_handle = &resume_handle; + + status = dcerpc_samr_EnumDomainUsers(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("EnumDomainUsers failed - %s\n", nt_errstr(status)); + return False; + } + + NDR_PRINT_DEBUG(samr_SamArray, r.out.sam); + + return True; +} + +static BOOL test_EnumDomainGroups(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct samr_EnumDomainGroups r; + uint32 resume_handle=0; + + printf("Testing EnumDomainGroups\n"); + + r.in.handle = handle; + r.in.resume_handle = &resume_handle; + r.in.max_size = (uint32)-1; + r.out.resume_handle = &resume_handle; + + status = dcerpc_samr_EnumDomainGroups(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("EnumDomainGroups failed - %s\n", nt_errstr(status)); + return False; + } + + NDR_PRINT_DEBUG(samr_SamArray, r.out.sam); + + return True; +} + static BOOL test_QueryDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -74,6 +125,14 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + if (!test_EnumDomainGroups(p, mem_ctx, &domain_handle)) { + return False; + } + + if (!test_EnumDomainUsers(p, mem_ctx, &domain_handle)) { + return False; + } + return True; } |