Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33550
b: refs/heads/master
c: a343bb7
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 24, 2006
1 parent 3fd0ed8 commit 2561f40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: 16b4289c7460ba9c04af40c574949dcca9029658
refs/heads/master: a343bb7750e6a098909c34f5c5dfddbc4fa40053
9 changes: 8 additions & 1 deletion trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ int generic_permission(struct inode *inode, int mask,

int permission(struct inode *inode, int mask, struct nameidata *nd)
{
umode_t mode = inode->i_mode;
int retval, submask;

if (mask & MAY_WRITE) {
umode_t mode = inode->i_mode;

/*
* Nobody gets write access to a read-only fs.
Expand All @@ -247,6 +247,13 @@ int permission(struct inode *inode, int mask, struct nameidata *nd)
}


/*
* MAY_EXEC on regular files requires special handling: We override
* filesystem execute permissions if the mode bits aren't set.
*/
if ((mask & MAY_EXEC) && S_ISREG(mode) && !(mode & S_IXUGO))
return -EACCES;

/* Ordinary permission routines do not understand MAY_APPEND. */
submask = mask & ~MAY_APPEND;
if (inode->i_op && inode->i_op->permission)
Expand Down

0 comments on commit 2561f40

Please sign in to comment.