Commit 5171317d authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French

cifs: update new ACE pointer after populate_new_aces.

After the fix for retaining externally set ACEs with cifsacl and
modefromsid,idsfromsid, there was an issue in populating the
inherited ACEs after setting the ACEs introduced by these two modes.
Fixed this by updating the ACE pointer again after the call to
populate_new_aces.
Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-by: default avatarRohith Surabattula <rohiths@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 1e28eed1
...@@ -1118,7 +1118,6 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl, ...@@ -1118,7 +1118,6 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
/* Retain old ACEs which we can retain */ /* Retain old ACEs which we can retain */
for (i = 0; i < src_num_aces; ++i) { for (i = 0; i < src_num_aces; ++i) {
pntace = (struct cifs_ace *) (acl_base + size); pntace = (struct cifs_ace *) (acl_base + size);
pnntace = (struct cifs_ace *) (nacl_base + nsize);
if (!new_aces_set && (pntace->flags & INHERITED_ACE)) { if (!new_aces_set && (pntace->flags & INHERITED_ACE)) {
/* Place the new ACEs in between existing explicit and inherited */ /* Place the new ACEs in between existing explicit and inherited */
...@@ -1131,14 +1130,18 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl, ...@@ -1131,14 +1130,18 @@ 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 it's any one of the ACE we're replacing, skip! */
if ((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) || if (!mode_from_sid &&
((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
(compare_sids(&pntace->sid, pownersid) == 0) || (compare_sids(&pntace->sid, pownersid) == 0) ||
(compare_sids(&pntace->sid, pgrpsid) == 0) || (compare_sids(&pntace->sid, pgrpsid) == 0) ||
(compare_sids(&pntace->sid, &sid_everyone) == 0) || (compare_sids(&pntace->sid, &sid_everyone) == 0) ||
(compare_sids(&pntace->sid, &sid_authusers) == 0)) { (compare_sids(&pntace->sid, &sid_authusers) == 0))) {
goto next_ace; goto next_ace;
} }
/* update the pointer to the next ACE to populate*/
pnntace = (struct cifs_ace *) (nacl_base + nsize);
nsize += cifs_copy_ace(pnntace, pntace, NULL); nsize += cifs_copy_ace(pnntace, pntace, NULL);
num_aces++; num_aces++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment