diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-15 09:39:48 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-15 09:39:48 +0000 |
commit | 4063fd08d4be4b9c91db092b0028f91941700d86 (patch) | |
tree | 771dde8a6f0bba358a5292a722186b30cf0b3c36 /source4/torture | |
parent | 4cadb043d7a99f835a5893283b63bbe13281e665 (diff) | |
download | samba-4063fd08d4be4b9c91db092b0028f91941700d86.tar.gz samba-4063fd08d4be4b9c91db092b0028f91941700d86.tar.bz2 samba-4063fd08d4be4b9c91db092b0028f91941700d86.zip |
added samr_EnumDomainGroups and samr_EnumDomainUsers
(This used to be commit f8d690fb2bc0afcc8267caa4edcbeed9463594e5)
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; } |