From 06d0f61aa43c0ab08dc122c9a3b41f9fc453fcbc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 18 Nov 2003 05:20:54 +0000 Subject: added samr_QuerySecurity() call that displays the ACL for any handle. (This used to be commit 5bbeaaa3d13c838d014e7689b0fcf7374c8c7f57) --- source4/torture/rpc/samr.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index fddf97ef74..346a073723 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -40,6 +40,24 @@ static BOOL test_Close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } +static BOOL test_QuerySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct samr_QuerySecurity r; + + r.in.handle = handle; + r.in.sec_info = 7; + + status = dcerpc_samr_QuerySecurity(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("QuerySecurity failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} + static BOOL test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) @@ -141,6 +159,10 @@ static BOOL test_OpenUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + if (!test_QuerySecurity(p, mem_ctx, &acct_handle)) { + ret = False; + } + if (!test_QueryUserInfo(p, mem_ctx, &acct_handle)) { ret = False; } @@ -173,6 +195,10 @@ static BOOL test_OpenGroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + if (!test_QuerySecurity(p, mem_ctx, &acct_handle)) { + ret = False; + } + if (!test_QueryGroupInfo(p, mem_ctx, &acct_handle)) { ret = False; } @@ -205,6 +231,10 @@ static BOOL test_OpenAlias(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + if (!test_QuerySecurity(p, mem_ctx, &acct_handle)) { + ret = False; + } + if (!test_QueryAliasInfo(p, mem_ctx, &acct_handle)) { ret = False; } @@ -370,6 +400,10 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + if (!test_QuerySecurity(p, mem_ctx, &domain_handle)) { + ret = False; + } + if (!test_QueryDomainInfo(p, mem_ctx, &domain_handle)) { ret = False; } @@ -511,6 +545,10 @@ BOOL torture_rpc_samr(int dummy) ret = False; } + if (!test_QuerySecurity(p, mem_ctx, &handle)) { + ret = False; + } + if (!test_EnumDomains(p, mem_ctx, &handle)) { ret = False; } -- cgit