diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-08-24 08:31:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:29 -0500 |
commit | 649882d8d59f35cf51166bedd73c2eab4cea7e50 (patch) | |
tree | 529e7f87274b3a9ef49d34176e407fe1133f471c /source4/torture/rpc | |
parent | cfa981c65667fb63c2c2af8a48149dc6e89f461c (diff) | |
download | samba-649882d8d59f35cf51166bedd73c2eab4cea7e50.tar.gz samba-649882d8d59f35cf51166bedd73c2eab4cea7e50.tar.bz2 samba-649882d8d59f35cf51166bedd73c2eab4cea7e50.zip |
r9567: fixed the winreg IDL for CreateKey, including a security
descriptor. To keep it simple I just use normal IDL buffers for now,
avoiding the complex methods metze used in spoolss. We might change
that later
Also added decoding of the security_descriptor in
winreg_GetKeySecurity() in smbtorture
(This used to be commit 439f34a9621e2e96329c30cfed8d78b8fdfbd8a2)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/winreg.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 7d40147a8d..2cf52a2686 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -108,13 +108,13 @@ static BOOL test_CreateKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("\ntesting CreateKey\n"); r.in.handle = handle; - r.out.handle = &newhandle; - init_winreg_String(&r.in.key, name); + r.out.new_handle = &newhandle; + init_winreg_String(&r.in.name, name); init_winreg_String(&r.in.class, class); r.in.options = 0x0; - r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; + r.in.access_required = SEC_FLAG_MAXIMUM_ALLOWED; r.in.action_taken = r.out.action_taken = &action_taken; - r.in.sec_desc = NULL; + r.in.secdesc = NULL; status = dcerpc_winreg_CreateKey(p, mem_ctx, &r); @@ -136,14 +136,16 @@ static BOOL test_GetKeySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct winreg_GetKeySecurity r; + struct security_descriptor sd; + DATA_BLOB sdblob; printf("\ntesting GetKeySecurity\n"); ZERO_STRUCT(r); r.in.handle = handle; - r.in.data = r.out.data = talloc_zero(mem_ctx, struct KeySecurityData); - r.in.data->size = 0xffff; + r.in.sd = r.out.sd = talloc_zero(mem_ctx, struct KeySecurityData); + r.in.sd->size = 0xffff; r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; status = dcerpc_winreg_GetKeySecurity(p, mem_ctx, &r); @@ -158,7 +160,20 @@ static BOOL test_GetKeySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return False; } - return False; + sdblob.data = r.out.sd->data; + sdblob.length = r.out.sd->len; + + status = ndr_pull_struct_blob_all(&sdblob, mem_ctx, &sd, + (ndr_pull_flags_fn_t)ndr_pull_security_descriptor); + if (!NT_STATUS_IS_OK(status)) { + printf("pull_security_descriptor failed - %s\n", nt_errstr(status)); + return False; + } + if (p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + NDR_PRINT_DEBUG(security_descriptor, &sd); + } + + return True; } static BOOL test_CloseKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, |