ntvfs: inherit generic
authorStefan Metzmacher <metze@samba.org>
Sat, 1 Dec 2012 16:11:10 +0000 (17:11 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Jan 2013 21:03:22 +0000 (22:03 +0100)
source4/ntvfs/posix/pvfs_acl.c

index 4e9c1ac6b5a0cbd3c13226f923177915d082df7f..715d6161a88b56b12b60c9461bc07e052916602a 100644 (file)
@@ -133,6 +133,9 @@ static void pvfs_translate_generic_bits(struct security_acl *acl)
 
        for (i=0;i<acl->num_aces;i++) {
                struct security_ace *ace = &acl->aces[i];
+               if (ace->flags & SEC_ACE_FLAG_INHERIT_ONLY) {
+                       continue;
+               }
                ace->access_mask = pvfs_translate_mask(ace->access_mask);
        }
 }
@@ -869,6 +872,11 @@ static NTSTATUS pvfs_acl_inherit_aces(struct pvfs_state *pvfs,
                        }
                }
 
+               if (orig_flags & SEC_ACE_FLAG_INHERIT_ONLY) {
+                       creator = &ace.trustee;
+                       new_id = &ace.trustee;
+               }
+
                /* the CREATOR sids are special when inherited */
                if (dom_sid_equal(&ace.trustee, pvfs->sid_cache.creator_owner)) {
                        creator = pvfs->sid_cache.creator_owner;
@@ -907,6 +915,9 @@ static NTSTATUS pvfs_acl_inherit_aces(struct pvfs_state *pvfs,
                }
        }
 
+       pvfs_translate_generic_bits(sd->dacl);
+       sd->type |= SEC_DESC_DACL_PRESENT;
+
        return NT_STATUS_OK;
 }