dir.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff -u --recursive --new-file --show-c-function linux-2.6.1-02-fix_intent/fs/nfs/dir.c linux-2.6.1-03-fix_access/fs/nfs/dir.c --- linux-2.6.1-02-fix_intent/fs/nfs/dir.c 2004-01-01 21:18:36.000000000 -0500 +++ linux-2.6.1-03-fix_access/fs/nfs/dir.c 2004-01-03 12:27:22.000000000 -0500 @@ -1281,13 +1281,8 @@ nfs_permission(struct inode *inode, int int mode = inode->i_mode; int res; - /* Are we checking permissions on anything other than lookup? */ - if (!(mask & MAY_EXEC)) { - /* We only need to check permissions on file open() and access() */ - if (!nd || !(nd->flags & (LOOKUP_OPEN|LOOKUP_ACCESS))) - return 0; - } - + if (mask == 0) + return 0; if (mask & MAY_WRITE) { /* * @@ -1306,6 +1301,12 @@ nfs_permission(struct inode *inode, int if (IS_IMMUTABLE(inode)) return -EACCES; } + /* Are we checking permissions on anything other than lookup/execute? */ + if ((mask & MAY_EXEC) == 0) { + /* We only need to check permissions on file open() and access() */ + if (!nd || !(nd->flags & (LOOKUP_OPEN|LOOKUP_ACCESS))) + return 0; + } lock_kernel();