summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-11 23:28:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:20 -0500
commit43ddb0a7ae419d7050cb93e1c8836db7672c7093 (patch)
treeb0dacc6db0d1ce5dd0798f1906b62171e5d44b86 /source4/torture/rpc
parent969e14eae941427cf36c71b5588d7dd8e1f3c615 (diff)
downloadsamba-43ddb0a7ae419d7050cb93e1c8836db7672c7093.tar.gz
samba-43ddb0a7ae419d7050cb93e1c8836db7672c7093.tar.bz2
samba-43ddb0a7ae419d7050cb93e1c8836db7672c7093.zip
r4156: GetKeySecurity() IDL and torture test
(This used to be commit 1c49de51aeb6041a3b53b8da7dc8e2bcf089bfe0)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/winreg.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index be1ca03b6f..183128d371 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -95,6 +95,36 @@ static BOOL test_CreateKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
+static BOOL test_GetKeySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct winreg_GetKeySecurity r;
+
+ printf("\ntesting GetKeySecurity\n");
+
+ ZERO_STRUCT(r);
+
+ r.in.handle = handle;
+ r.in.data = r.out.data = talloc_zero_p(mem_ctx, struct KeySecurityData);
+ r.in.data->size = 0xffff;
+ r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+
+ status = dcerpc_winreg_GetKeySecurity(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("GetKeySecurity failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("GetKeySecurity failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
+
+ return False;
+}
+
static BOOL test_CloseKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
{
@@ -540,12 +570,17 @@ static BOOL test_key(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
if (!test_QueryInfoKey(p, mem_ctx, handle, NULL)) {
}
+
+ if (!test_GetKeySecurity(p, mem_ctx, handle)) {
+ }
+
if (!test_EnumKey(p, mem_ctx, handle, depth)) {
}
if (!test_EnumValue(p, mem_ctx, handle, 0xFF, 0xFFFF)) {
}
+
test_CloseKey(p, mem_ctx, handle);
return True;