Author: gd Date: 2007-10-10 12:55:07 +0000 (Wed, 10 Oct 2007) New Revision: 25606
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25606 Log: Allow test_GetKeySecurity() to return a security descriptor. Guenther Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c Changeset: Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c =================================================================== --- branches/SAMBA_4_0/source/torture/rpc/winreg.c 2007-10-10 12:44:48 UTC (rev 25605) +++ branches/SAMBA_4_0/source/torture/rpc/winreg.c 2007-10-10 12:55:07 UTC (rev 25606) @@ -175,10 +175,11 @@ 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 @@ 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,14 +199,18 @@ 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 @@ 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 @@ created2 = true; } - if (created2 && !test_GetKeySecurity(p, tctx, &newhandle)) { + if (created2 && !test_GetKeySecurity(p, tctx, &newhandle, NULL)) { printf("GetKeySecurity failed\n"); ret = false; }