diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2007-10-16 16:11:01 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2007-10-16 16:11:01 +0000 |
commit | a32865d843466cb66724f211a813a844e380930e (patch) | |
tree | a30d4589ed02d1fed2e2a9e9bc762bcf6b564656 /kernel/dir.c | |
parent | 7d62647d7aebffe76837b0698e8dc22f439f1ab6 (diff) | |
download | libfuse-a32865d843466cb66724f211a813a844e380930e.tar.gz |
pull kernel module fixes from mainline
Diffstat (limited to 'kernel/dir.c')
-rw-r--r-- | kernel/dir.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/dir.c b/kernel/dir.c index b493e4e..c5316d9 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -720,7 +720,7 @@ int fuse_do_getattr(struct inode *inode) * for which the owner of the mount has ptrace privilege. This * excludes processes started by other users, suid or sgid processes. */ -static int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task) +int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task) { if (fc->flags & FUSE_ALLOW_OTHER) return 1; @@ -1059,6 +1059,9 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) int err; int is_truncate = 0; + if (!fuse_allow_task(fc, current)) + return -EACCES; + if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { err = inode_change_ok(inode, attr); if (err) @@ -1233,6 +1236,9 @@ static ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size) struct fuse_getxattr_out outarg; ssize_t ret; + if (!fuse_allow_task(fc, current)) + return -EACCES; + if (fc->no_listxattr) return -EOPNOTSUPP; |