summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vnops.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-03-21 05:13:23 +0000
committertjr <tjr@FreeBSD.org>2003-03-21 05:13:23 +0000
commit874c219fad9ef262c77f655dd88484e28e7d3978 (patch)
treeb24d34cb8df71c7074a00cf8e88395cfb5edb695 /sys/nfsclient/nfs_vnops.c
parent2c7df26ff68fffa33e908dde9f23c21843e909c1 (diff)
downloadFreeBSD-src-874c219fad9ef262c77f655dd88484e28e7d3978.zip
FreeBSD-src-874c219fad9ef262c77f655dd88484e28e7d3978.tar.gz
Map VAPPEND to VWRITE in nfsspec_access() - VAPPEND is never set in the
mode returned by VOP_GETATTR. This fixes incorrect "Permission denied" errors when trying to append to a file on an NFSv2 mount.
Diffstat (limited to 'sys/nfsclient/nfs_vnops.c')
-rw-r--r--sys/nfsclient/nfs_vnops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index b2a8c71..af19819 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -2984,6 +2984,13 @@ nfsspec_access(struct vop_access_args *ap)
int error;
/*
+ * Map VAPPEND to VWRITE; NFSv2 does not understand the concept
+ * of append-only files. XXX What about VADMIN and VSTAT?
+ */
+ if (mode & VAPPEND)
+ mode = (mode & ~VAPPEND) | VWRITE;
+
+ /*
* Disallow write attempts on filesystems mounted read-only;
* unless the file is a socket, fifo, or a block or character
* device resident on the filesystem.
OpenPOWER on IntegriCloud