Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106363
b: refs/heads/master
c: a110343
h: refs/heads/master
i:
  106361: a906d35
  106359: 3073a33
v: v3
  • Loading branch information
Al Viro committed Jul 27, 2008
1 parent 4d3d254 commit e0fa290
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f2da1e7d0330395e5e9e350b879b98a1ea495df
refs/heads/master: a110343f0d6d41f68b7cf8c00b57a3172c67f816
2 changes: 1 addition & 1 deletion trunk/fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ static int fuse_permission(struct inode *inode, int mask)
exist. So if permissions are revoked this won't be
noticed immediately, only after the attribute
timeout has expired */
} else if (mask & (MAY_ACCESS | MAY_CHDIR)) {
} else if (mask & MAY_ACCESS) {
err = fuse_access(inode, mask);
} else if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) {
if (!(inode->i_mode & S_IXUGO)) {
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ int permission(struct inode *inode, int mask, struct nameidata *nd)
if (inode->i_op && inode->i_op->permission) {
int extra = 0;
if (nd) {
if (nd->flags & LOOKUP_ACCESS)
extra |= MAY_ACCESS;
if (nd->flags & LOOKUP_OPEN)
extra |= MAY_OPEN;
}
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
old_cap = cap_set_effective(current->cap_permitted);
}

res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW, &nd);
if (res)
goto out;

res = vfs_permission(&nd, mode);
res = vfs_permission(&nd, mode | MAY_ACCESS);
/* SuS v2 requires we report a read only fs too */
if(res || !(mode & S_IWOTH) ||
special_file(nd.path.dentry->d_inode->i_mode))
Expand Down Expand Up @@ -505,7 +505,7 @@ asmlinkage long sys_chdir(const char __user * filename)
if (error)
goto out;

error = vfs_permission(&nd, MAY_EXEC | MAY_CHDIR);
error = vfs_permission(&nd, MAY_EXEC | MAY_ACCESS);
if (error)
goto dput_and_out;

Expand Down Expand Up @@ -534,7 +534,7 @@ asmlinkage long sys_fchdir(unsigned int fd)
if (!S_ISDIR(inode->i_mode))
goto out_putf;

error = file_permission(file, MAY_EXEC);
error = file_permission(file, MAY_EXEC | MAY_ACCESS);
if (!error)
set_fs_pwd(current->fs, &file->f_path);
out_putf:
Expand All @@ -552,7 +552,7 @@ asmlinkage long sys_chroot(const char __user * filename)
if (error)
goto out;

error = vfs_permission(&nd, MAY_EXEC);
error = vfs_permission(&nd, MAY_EXEC | MAY_ACCESS);
if (error)
goto dput_and_out;

Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ extern int dir_notify_enable;
#define MAY_READ 4
#define MAY_APPEND 8
#define MAY_ACCESS 16
#define MAY_CHDIR 32
#define MAY_OPEN 64
#define MAY_OPEN 32

#define FMODE_READ 1
#define FMODE_WRITE 2
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/namei.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
*/
#define LOOKUP_OPEN (0x0100)
#define LOOKUP_CREATE (0x0200)
#define LOOKUP_ACCESS (0x0400)

extern int __user_walk(const char __user *, unsigned, struct nameidata *);
extern int __user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *);
Expand Down

0 comments on commit e0fa290

Please sign in to comment.