Fix bug #5052 - not work cancel inheritance on share. We were
authorJeremy Allison <jra@samba.org>
Wed, 10 Sep 2008 23:23:54 +0000 (16:23 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 12 Jan 2009 09:11:50 +0000 (10:11 +0100)
using the parent security descriptor type and flags instead
of using the passed in SD.
Jeremy.
(cherry picked from commit 78941c166debc8315516d895b2ef77e52417f067)

source/smbd/posix_acls.c

index 9913d5aead6ccc8d47e2f9afbdb217c635e97fb8..2fb8f9f2a371a40251324609614895076a254a46 100644 (file)
@@ -3300,10 +3300,17 @@ static NTSTATUS append_parent_acl(files_struct *fsp,
 
        }
 
-       parent_sd->dacl->aces = new_ace;
-       parent_sd->dacl->num_aces = i;
+       /* This sucks. psd should be const and we should
+        * be doing a deep-copy here. We're getting away
+        * with is as we know parent_sd is talloced off
+        * talloc_tos() as well as psd. JRA. */
 
-       *pp_new_sd = parent_sd;
+       psd->dacl->aces = new_ace;
+       psd->dacl->num_aces = i;
+       psd->type &= ~(SE_DESC_DACL_AUTO_INHERITED|
+                         SE_DESC_DACL_AUTO_INHERIT_REQ);
+
+       *pp_new_sd = psd;
        return status;
 }