Skip to content

Commit

Permalink
vfs: pass all mask flags check_acl and posix_acl_permission
Browse files Browse the repository at this point in the history
Acked-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruen@kernel.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Andreas Gruenbacher authored and root committed Oct 28, 2011
1 parent 8522ca5 commit d124b60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ static int acl_permission_check(struct inode *inode, int mask)
{
unsigned int mode = inode->i_mode;

mask &= MAY_READ | MAY_WRITE | MAY_EXEC | MAY_NOT_BLOCK;

if (current_user_ns() != inode_userns(inode))
goto other_perms;

Expand Down
2 changes: 2 additions & 0 deletions fs/posix_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ posix_acl_permission(struct inode *inode, const struct posix_acl *acl, int want)
const struct posix_acl_entry *pa, *pe, *mask_obj;
int found = 0;

want &= MAY_READ | MAY_WRITE | MAY_EXEC | MAY_NOT_BLOCK;

FOREACH_ACL_ENTRY(pa, acl, pe) {
switch(pa->e_tag) {
case ACL_USER_OBJ:
Expand Down

0 comments on commit d124b60

Please sign in to comment.