summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-10-10 12:55:07 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:42:50 +0100
commit50bf95197705a3e3ca6b69fc9584ed0564c305d1 (patch)
tree42dc4497f836333905c0d90b49f0c2b7c106a390 /source4/torture/rpc
parentc353a7b05e8475bbc726123ae41c91102d96c6f5 (diff)
downloadsamba-50bf95197705a3e3ca6b69fc9584ed0564c305d1.tar.gz
samba-50bf95197705a3e3ca6b69fc9584ed0564c305d1.tar.bz2
samba-50bf95197705a3e3ca6b69fc9584ed0564c305d1.zip
r25606: Allow test_GetKeySecurity() to return a security descriptor.
Guenther (This used to be commit 3a0d22f572bac4f53902cf1fcb6534fe88e6edab)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/winreg.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index e29d0b74dd..44df6dab74 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -175,10 +175,11 @@ static bool test_CreateKey_sd(struct dcerpc_pipe *p,
static bool test_GetKeySecurity(struct dcerpc_pipe *p,
struct torture_context *tctx,
- struct policy_handle *handle)
+ struct policy_handle *handle,
+ struct security_descriptor **sd_out)
{
struct winreg_GetKeySecurity r;
- struct security_descriptor sd;
+ struct security_descriptor *sd;
DATA_BLOB sdblob;
ZERO_STRUCT(r);
@@ -188,7 +189,8 @@ static bool test_GetKeySecurity(struct dcerpc_pipe *p,
r.in.sd->size = 0x1000;
r.in.sec_info = SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL;
- torture_assert_ntstatus_ok(tctx, dcerpc_winreg_GetKeySecurity(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_winreg_GetKeySecurity(p, tctx, &r),
"GetKeySecurity failed");
torture_assert_werr_ok(tctx, r.out.result, "GetKeySecurity failed");
@@ -197,12 +199,16 @@ static bool test_GetKeySecurity(struct dcerpc_pipe *p,
sdblob.length = r.out.sd->len;
torture_assert_ntstatus_ok(tctx,
- ndr_pull_struct_blob(&sdblob, tctx, &sd,
+ ndr_pull_struct_blob(&sdblob, tctx, sd,
(ndr_pull_flags_fn_t)ndr_pull_security_descriptor),
"pull_security_descriptor failed");
if (p->conn->flags & DCERPC_DEBUG_PRINT_OUT) {
- NDR_PRINT_DEBUG(security_descriptor, &sd);
+ NDR_PRINT_DEBUG(security_descriptor, sd);
+ }
+
+ if (sd_out) {
+ *sd_out = sd;
}
return true;
@@ -584,7 +590,7 @@ static bool test_key(struct dcerpc_pipe *p, struct torture_context *tctx,
if (!test_NotifyChangeKeyValue(p, tctx, handle)) {
}
- if (!test_GetKeySecurity(p, tctx, handle)) {
+ if (!test_GetKeySecurity(p, tctx, handle, NULL)) {
}
if (!test_EnumKey(p, tctx, handle, depth)) {
@@ -667,7 +673,7 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p,
created2 = true;
}
- if (created2 && !test_GetKeySecurity(p, tctx, &newhandle)) {
+ if (created2 && !test_GetKeySecurity(p, tctx, &newhandle, NULL)) {
printf("GetKeySecurity failed\n");
ret = false;
}