提交 0c6f4ebf 编写于 作者: R Ronnie Sahlberg 提交者: Steve French

cifs: modefromsids must add an ACE for authenticated users

When we create a file with modefromsids we set an ACL that
has one ACE for the magic modefromsid as well as a second ACE that
grants full access to all authenticated users.

When later we chante the mode on the file we strip away this, and other,
ACE for authenticated users in set_chmod_dacl() and then just add back/update
the modefromsid ACE.
Thus leaving the file with a single ACE that is for the mode and no ACE
to grant any user any rights to access the file.
Fix this by always adding back also the modefromsid ACE so that we do not
drop the rights to access the file.
Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: NShyam Prasad N <sprasad@microsoft.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 3d6cc989
...@@ -949,6 +949,9 @@ static void populate_new_aces(char *nacl_base, ...@@ -949,6 +949,9 @@ static void populate_new_aces(char *nacl_base,
pnntace = (struct cifs_ace *) (nacl_base + nsize); pnntace = (struct cifs_ace *) (nacl_base + nsize);
nsize += setup_special_mode_ACE(pnntace, nmode); nsize += setup_special_mode_ACE(pnntace, nmode);
num_aces++; num_aces++;
pnntace = (struct cifs_ace *) (nacl_base + nsize);
nsize += setup_authusers_ACE(pnntace);
num_aces++;
goto set_size; goto set_size;
} }
...@@ -1613,7 +1616,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode, ...@@ -1613,7 +1616,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
nsecdesclen = secdesclen; nsecdesclen = secdesclen;
if (pnmode && *pnmode != NO_CHANGE_64) { /* chmod */ if (pnmode && *pnmode != NO_CHANGE_64) { /* chmod */
if (mode_from_sid) if (mode_from_sid)
nsecdesclen += sizeof(struct cifs_ace); nsecdesclen += 2 * sizeof(struct cifs_ace);
else /* cifsacl */ else /* cifsacl */
nsecdesclen += 5 * sizeof(struct cifs_ace); nsecdesclen += 5 * sizeof(struct cifs_ace);
} else { /* chown */ } else { /* chown */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册