aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@fieldses.org>2006-10-17 03:10:14 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 11:18:46 -0400
commit9801d8a39cfe6c34f39f9552a246a6bd002e735e (patch)
tree1bc534709dc02d308532f5285b9f376ca2f2ec31
parentdc730e173785e29b297aa605786c94adaffe2544 (diff)
[PATCH] knfsd: nfsd4: fix open permission checking
We weren't actually checking for SHARE_ACCESS_WRITE, with the result that the owner could open a non-writeable file for write! Continue to allow DENY_WRITE only with write access. Thanks to Jim Rees for reporting the bug. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/nfsd/nfs4proc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index a05d3376cc46..d1fac6872c44 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -78,8 +78,10 @@ do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs
78 78
79 if (open->op_share_access & NFS4_SHARE_ACCESS_READ) 79 if (open->op_share_access & NFS4_SHARE_ACCESS_READ)
80 accmode |= MAY_READ; 80 accmode |= MAY_READ;
81 if (open->op_share_deny & NFS4_SHARE_ACCESS_WRITE) 81 if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
82 accmode |= (MAY_WRITE | MAY_TRUNC); 82 accmode |= (MAY_WRITE | MAY_TRUNC);
83 if (open->op_share_deny & NFS4_SHARE_DENY_WRITE)
84 accmode |= MAY_WRITE;
83 85
84 status = fh_verify(rqstp, current_fh, S_IFREG, accmode); 86 status = fh_verify(rqstp, current_fh, S_IFREG, accmode);
85 87