always call inode_change_ok early in ->setattr
Make sure we call inode_change_ok before doing any changes in ->setattr, and make sure to call it even if our fs wants to ignore normal UNIX permissions, but use the ATTR_FORCE to skip those. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1025774ce4
commit
db78b877f7
6 changed files with 48 additions and 48 deletions
|
@ -1270,11 +1270,12 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr,
|
|||
if (!fuse_allow_task(fc, current))
|
||||
return -EACCES;
|
||||
|
||||
if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
|
||||
err = inode_change_ok(inode, attr);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS))
|
||||
attr->ia_valid |= ATTR_FORCE;
|
||||
|
||||
err = inode_change_ok(inode, attr);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue