Part 1 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid...
authorJeremy Allison <jra@samba.org>
Fri, 2 Sep 2011 18:21:08 +0000 (11:21 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 2 Sep 2011 18:21:08 +0000 (11:21 -0700)
Remove the code I added for bug "6878 - Cannot change ACL's inherit flag". It is incorrect
and causes the POSIX ACL ACL_USER_OBJ duplication.

source3/smbd/posix_acls.c

index da25a52b8dbdc473e470b7bd0a18a7665d0e9d75..57704f397ba5aa45610e3112b910efba8f8d5630 100644 (file)
@@ -1537,50 +1537,6 @@ static void check_owning_objs(canon_ace *ace, struct dom_sid *pfile_owner_sid, s
                DEBUG(10,("check_owning_objs: ACL is missing an owning group entry.\n"));
 }
 
-/****************************************************************************
- If an ACE entry is SMB_ACL_USER_OBJ and not CREATOR_OWNER, map to SMB_ACL_USER.
- If an ACE entry is SMB_ACL_GROUP_OBJ and not CREATOR_GROUP, map to SMB_ACL_GROUP
-****************************************************************************/
-
-static bool dup_owning_ace(canon_ace *dir_ace, canon_ace *ace)
-{
-       /* dir ace must be followings.
-          SMB_ACL_USER_OBJ : trustee(CREATOR_OWNER) -> Posix ACL d:u::perm
-          SMB_ACL_USER     : not trustee    -> Posix ACL u:user:perm
-          SMB_ACL_USER_OBJ : trustee -> convert to SMB_ACL_USER : trustee
-          Posix ACL u:trustee:perm
-
-          SMB_ACL_GROUP_OBJ: trustee(CREATOR_GROUP) -> Posix ACL d:g::perm
-          SMB_ACL_GROUP    : not trustee   -> Posix ACL g:group:perm
-          SMB_ACL_GROUP_OBJ: trustee -> convert to SMB_ACL_GROUP : trustee
-          Posix ACL g:trustee:perm
-       */
-
-       if (ace->type == SMB_ACL_USER_OBJ &&
-                       !(dom_sid_equal(&ace->trustee, &global_sid_Creator_Owner))) {
-               canon_ace *dup_ace = dup_canon_ace(ace);
-
-               if (dup_ace == NULL) {
-                       return false;
-               }
-               dup_ace->type = SMB_ACL_USER;
-               DLIST_ADD_END(dir_ace, dup_ace, canon_ace *);
-       }
-
-       if (ace->type == SMB_ACL_GROUP_OBJ &&
-                       !(dom_sid_equal(&ace->trustee, &global_sid_Creator_Group))) {
-               canon_ace *dup_ace = dup_canon_ace(ace);
-
-               if (dup_ace == NULL) {
-                       return false;
-               }
-               dup_ace->type = SMB_ACL_GROUP;
-               DLIST_ADD_END(dir_ace, dup_ace, canon_ace *);
-       }
-
-       return true;
-}
-
 /****************************************************************************
  Unpack a struct security_descriptor into two canonical ace lists.
 ****************************************************************************/
@@ -1831,34 +1787,6 @@ static bool create_canon_ace_lists(files_struct *fsp,
                                        print_canon_ace( current_ace, 0);
                                }
 
-                               /*
-                                * We have a lossy mapping: directory ACE entries
-                                * CREATOR_OWNER ------\
-                                *     (map to)         +---> SMB_ACL_USER_OBJ
-                                * owning sid    ------/
-                                *
-                                * CREATOR_GROUP ------\
-                                *     (map to)         +---> SMB_ACL_GROUP_OBJ
-                                * primary group sid --/
-                                *
-                                * on set. And on read of a directory ACL
-                                *
-                                * SMB_ACL_USER_OBJ ----> CREATOR_OWNER
-                                * SMB_ACL_GROUP_OBJ ---> CREATOR_GROUP.
-                                *
-                                * Deal with this on set by duplicating
-                                * owning sid and primary group sid ACE
-                                * entries into the directory ACL.
-                                * Fix from Tsukasa Hamano <hamano@osstech.co.jp>.
-                                */
-
-                               if (!dup_owning_ace(dir_ace, current_ace)) {
-                                       DEBUG(0,("create_canon_ace_lists: malloc fail !\n"));
-                                       free_canon_ace_list(file_ace);
-                                       free_canon_ace_list(dir_ace);
-                                       return false;
-                               }
-
                                /*
                                 * If this is not an inherit only ACE we need to add a duplicate
                                 * to the file acl.