Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[patch] nfs: fix permission mask

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


miklos at szeredi

Jul 21, 2008, 4:38 AM

Post #1 of 2 (176 views)
Permalink
[patch] nfs: fix permission mask

From: Miklos Szeredi <mszeredi [at] suse>

Handle auxiliary mask bits in nfs_permission() properly.

Signed-off-by: Miklos Szeredi <mszeredi [at] suse>
---
fs/nfs/dir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/fs/nfs/dir.c
===================================================================
--- linux-2.6.orig/fs/nfs/dir.c 2008-07-21 09:46:07.000000000 +0200
+++ linux-2.6/fs/nfs/dir.c 2008-07-21 13:09:28.000000000 +0200
@@ -1884,7 +1884,7 @@ static int nfs_do_access(struct inode *i
return status;
nfs_access_add_cache(inode, &cache);
out:
- if ((cache.mask & mask) == mask)
+ if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0)
return 0;
return -EACCES;
}
@@ -1914,7 +1914,7 @@ int nfs_permission(struct inode *inode,

nfs_inc_stats(inode, NFSIOS_VFSACCESS);

- if (mask == 0)
+ if ((mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0)
goto out;
/* Is this sys_access() ? */
if (mask & MAY_ACCESS)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


viro at ZenIV

Jul 21, 2008, 6:26 AM

Post #2 of 2 (146 views)
Permalink
Re: [patch] nfs: fix permission mask [In reply to]

On Mon, Jul 21, 2008 at 01:38:34PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi [at] suse>
>
> Handle auxiliary mask bits in nfs_permission() properly.
>
> Signed-off-by: Miklos Szeredi <mszeredi [at] suse>

Argh... Applied, thanks. Hrm... On the next rebase I'd better move
it next to the patch introducing the breakage in question. Or fold
it in, if you don't mind, with commit messages merged...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.