summaryrefslogtreecommitdiff
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-12-11 00:21:55 +0300
committerDavid S. Miller <davem@davemloft.net>2016-12-11 00:21:55 +0300
commit821781a9f40673c2aa0f29d9d8226ec320dff20c (patch)
treec9d5cb8a184fff84a9d841d8cb5da4b26be5c551 /fs/fuse/dir.c
parent3174fed9820edc95cff74ad0934c3240c7fb5115 (diff)
parent045169816b31b10faed984b01c390db1b32ee4c1 (diff)
downloadlinux-821781a9f40673c2aa0f29d9d8226ec320dff20c.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index b3ebe512d64c..096f79997f75 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1739,8 +1739,6 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
* This should be done on write(), truncate() and chown().
*/
if (!fc->handle_killpriv) {
- int kill;
-
/*
* ia_mode calculation may have used stale i_mode.
* Refresh and recalculate.
@@ -1750,12 +1748,11 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
return ret;
attr->ia_mode = inode->i_mode;
- kill = should_remove_suid(entry);
- if (kill & ATTR_KILL_SUID) {
+ if (inode->i_mode & S_ISUID) {
attr->ia_valid |= ATTR_MODE;
attr->ia_mode &= ~S_ISUID;
}
- if (kill & ATTR_KILL_SGID) {
+ if ((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
attr->ia_valid |= ATTR_MODE;
attr->ia_mode &= ~S_ISGID;
}