vfs: pass all mask flags check_acl and posix_acl_permission
authorAndreas Gruenbacher <agruen@kernel.org>
Sun, 23 Oct 2011 17:43:32 +0000 (23:13 +0530)
committerroot <root@serles.lst.de>
Fri, 28 Oct 2011 12:58:54 +0000 (14:58 +0200)
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>
fs/namei.c
fs/posix_acl.c

index 2a4574f48001ba8a5b80641bc8edac19eb18a962..276cd30ab8f89a0111395f8f132228d55abc7b52 100644 (file)
@@ -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;
 
index 10027b42b7e29aefa1b9158ab0ec23de5f00914a..cea4623f1ed63007b8da0a8486ac65595415f895 100644 (file)
@@ -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: