Rob Shearman : server: Fix file_set_sd to handle NULL DACLs.

Alexandre Julliard julliard at winehq.org
Mon Oct 22 09:55:20 CDT 2007


Module: wine
Branch: master
Commit: 8d6093e6248baab1228e92272b3de15a8a6d29f9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8d6093e6248baab1228e92272b3de15a8a6d29f9

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sat Oct 20 16:21:05 2007 +0100

server: Fix file_set_sd to handle NULL DACLs.

These mean that the file should have full permissions for everyone.

---

 server/file.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/file.c b/server/file.c
index 7a62b64..b5f6a87 100644
--- a/server/file.c
+++ b/server/file.c
@@ -435,9 +435,10 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
 
     if (set_info & DACL_SECURITY_INFORMATION)
     {
-        if (sd->control & SE_DACL_PRESENT)
+        int present;
+        const ACL *dacl = sd_get_dacl( sd, &present );
+        if (present && dacl)
         {
-            const ACL *dacl = (const ACL *)((char *)sd + sd->owner_len + sd->group_len + sd->sacl_len);
             const ACE_HEADER *ace = (const ACE_HEADER *)(dacl + 1);
             ULONG i;
             for (i = 0; i < dacl->AceCount; i++)




More information about the wine-cvs mailing list