aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 4700a0a929d7..702f64e820c3 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -757,8 +757,16 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
757 * If we get here, then the client has already done an "open", 757 * If we get here, then the client has already done an "open",
758 * and (hopefully) checked permission - so allow OWNER_OVERRIDE 758 * and (hopefully) checked permission - so allow OWNER_OVERRIDE
759 * in case a chmod has now revoked permission. 759 * in case a chmod has now revoked permission.
760 *
761 * Arguably we should also allow the owner override for
762 * directories, but we never have and it doesn't seem to have
763 * caused anyone a problem. If we were to change this, note
764 * also that our filldir callbacks would need a variant of
765 * lookup_one_len that doesn't check permissions.
760 */ 766 */
761 err = fh_verify(rqstp, fhp, type, may_flags | NFSD_MAY_OWNER_OVERRIDE); 767 if (type == S_IFREG)
768 may_flags |= NFSD_MAY_OWNER_OVERRIDE;
769 err = fh_verify(rqstp, fhp, type, may_flags);
762 if (err) 770 if (err)
763 goto out; 771 goto out;
764 772