Skip to content

Commit

Permalink
cifs: Fix chmod with modefromsid when an older ACE already exists.
Browse files Browse the repository at this point in the history
My recent fixes to cifsacl to maintain inherited ACEs had
regressed modefromsid when an older ACL already exists.

Found testing xfstest 495 with modefromsid mount option

Fixes: f506550 ("cifs: Retain old ACEs when converting between mode bits and ACL")

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Shyam Prasad N authored and Steve French committed Mar 26, 2021
1 parent 45a4546 commit 3bffbe9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/cifs/cifsacl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,7 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
}

/* If it's any one of the ACE we're replacing, skip! */
if (!mode_from_sid &&
((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
if (((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
(compare_sids(&pntace->sid, pownersid) == 0) ||
(compare_sids(&pntace->sid, pgrpsid) == 0) ||
(compare_sids(&pntace->sid, &sid_everyone) == 0) ||
Expand Down

0 comments on commit 3bffbe9

Please sign in to comment.