r25730: Fix IDL for incorrect winreg_SetKeySecurity.
authorGünther Deschner <gd@samba.org>
Thu, 25 Oct 2007 09:12:02 +0000 (11:12 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:43:31 +0000 (05:43 +0100)
Guenther

source/librpc/idl/winreg.idl
source/torture/rpc/winreg.c

index a0211ad1a2a3cf9d014e6abbdb69b38647013769..d8f50990db2f454377e47ac1d27270d2776cb3ce 100644 (file)
@@ -273,7 +273,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
        /* Function: 0x15 */
        WERROR winreg_SetKeySecurity(
                [in,ref] policy_handle *handle,
-               [in] winreg_AccessMask access_mask,
+               [in] security_secinfo sec_info,
                [in,ref] KeySecurityData *sd
        );
 
index d9514ad9bbe43b4dc05db6bfa26b6000eedb816a..4b00c0326002af8def313fac15f5c4654b69ea5e 100644 (file)
@@ -228,6 +228,7 @@ static bool test_SetKeySecurity(struct dcerpc_pipe *p,
        struct winreg_SetKeySecurity r;
        struct KeySecurityData *sdata = NULL;
        DATA_BLOB sdblob;
+       uint32_t sec_info;
 
        ZERO_STRUCT(r);
 
@@ -245,8 +246,23 @@ static bool test_SetKeySecurity(struct dcerpc_pipe *p,
        sdata->size = sdblob.length;
        sdata->len = sdblob.length;
 
+       sec_info = SECINFO_UNPROTECTED_SACL | SECINFO_UNPROTECTED_DACL;
+
+       if (sd->owner_sid) {
+               sec_info |= SECINFO_OWNER;
+       }
+       if (sd->group_sid) {
+               sec_info |= SECINFO_GROUP;
+       }
+       if (sd->sacl) {
+               sec_info |= SECINFO_SACL;
+       }
+       if (sd->dacl) {
+               sec_info |= SECINFO_DACL;
+       }
+
        r.in.handle = handle;
-       r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+       r.in.sec_info = sec_info;
        r.in.sd = sdata;
 
        torture_assert_ntstatus_ok(tctx,