All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] nfs: fix permission mask
@ 2008-07-21 11:38 Miklos Szeredi
  2008-07-21 13:26 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2008-07-21 11:38 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel

From: Miklos Szeredi <mszeredi@suse.cz>

Handle auxiliary mask bits in nfs_permission() properly.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
 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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] nfs: fix permission mask
  2008-07-21 11:38 [patch] nfs: fix permission mask Miklos Szeredi
@ 2008-07-21 13:26 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2008-07-21 13:26 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-kernel

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

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...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-21 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21 11:38 [patch] nfs: fix permission mask Miklos Szeredi
2008-07-21 13:26 ` Al Viro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.