From 874c219fad9ef262c77f655dd88484e28e7d3978 Mon Sep 17 00:00:00 2001 From: tjr Date: Fri, 21 Mar 2003 05:13:23 +0000 Subject: 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. --- sys/nfsclient/nfs_vnops.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/nfsclient') 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. -- cgit v1.1