diff options
author | Jeremy Allison <jra@samba.org> | 2011-09-02 15:07:48 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-10-24 19:16:42 +0200 |
commit | 7af614ea75d272dff8deca44e2e2c57596283a64 (patch) | |
tree | 943ac06c5b8dc1eb13f4fa3a56bd248f79155894 | |
parent | 77ecca5e16a1e5adae8a4286e5734e201b1d4e3e (diff) | |
download | samba-7af614ea75d272dff8deca44e2e2c57596283a64.tar.gz samba-7af614ea75d272dff8deca44e2e2c57596283a64.tar.xz samba-7af614ea75d272dff8deca44e2e2c57596283a64.zip |
Part 2 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid argument)
Only map CREATOR_OWNER/CREATOR_GROUP to ACL_USER_OBJ/ACL_GROUP_OBJ in
a default(directory) ACL set.
(cherry picked from commit 36f60cef6d6ac5625a88a73ce53bdb2b0fe0f000)
-rw-r--r-- | source3/smbd/posix_acls.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 6f51e31ad63..ec16bf20319 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -1748,6 +1748,7 @@ static bool create_canon_ace_lists(files_struct *fsp, if ((psa->flags & (SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT)) == (SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT)) { + canon_ace *current_dir_ace = current_ace; DLIST_ADD_END(dir_ace, current_ace, canon_ace *); /* @@ -1809,6 +1810,43 @@ static bool create_canon_ace_lists(files_struct *fsp, */ current_ace = NULL; } + + /* + * current_ace is now either owned by file_ace + * or is NULL. We can safely operate on current_dir_ace + * to treat mapping for default acl entries differently + * than access acl entries. + */ + + if (current_dir_ace->owner_type == UID_ACE) { + /* + * We already decided above this is a uid, + * for default acls ace's only CREATOR_OWNER + * maps to ACL_USER_OBJ. All other uid + * ace's are ACL_USER. + */ + if (sid_equal(¤t_dir_ace->trustee, + &global_sid_Creator_Owner)) { + current_dir_ace->type = SMB_ACL_USER_OBJ; + } else { + current_dir_ace->type = SMB_ACL_USER; + } + } + + if (current_dir_ace->owner_type == GID_ACE) { + /* + * We already decided above this is a gid, + * for default acls ace's only CREATOR_GROUP + * maps to ACL_GROUP_OBJ. All other uid + * ace's are ACL_GROUP. + */ + if (sid_equal(¤t_dir_ace->trustee, + &global_sid_Creator_Group)) { + current_dir_ace->type = SMB_ACL_GROUP_OBJ; + } else { + current_dir_ace->type = SMB_ACL_GROUP; + } + } } } |