From 77fb98ac7c38a19c1e810495119f6f5541838d32 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 19 Dec 2003 23:44:26 +0000 Subject: addition of samr_SetSecurity() from kai we needed to adjust the alignment of [relative] buffers for this to work. I wonder if they are always 4 byte aligned? (This used to be commit 9cd0a0b8b976e62c6da71b7e55cba5b38483620d) --- source4/torture/rpc/samr.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index e5e4493480..f77b7ebde4 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -63,6 +63,7 @@ static BOOL test_QuerySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_QuerySecurity r; + struct samr_SetSecurity s; r.in.handle = handle; r.in.sec_info = 7; @@ -73,6 +74,22 @@ static BOOL test_QuerySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } + s.in.handle = handle; + s.in.sec_info = 7; + s.in.sdbuf = r.out.sdbuf; + + status = dcerpc_samr_SetSecurity(p, mem_ctx, &s); + if (!NT_STATUS_IS_OK(status)) { + printf("SetSecurity failed - %s\n", nt_errstr(status)); + return False; + } + + 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; } -- cgit