summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsserver
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2011-08-20 21:26:35 +0000
committerrmacklem <rmacklem@FreeBSD.org>2011-08-20 21:26:35 +0000
commit7b624f0be1a93c6b631464d3f96c4277a78781af (patch)
tree6bf24fb406fc39ef2a5a91ee4bfb225c97bcee1c /sys/fs/nfsserver
parent422bc41b314b204b624a6825c4a751104981bcaa (diff)
downloadFreeBSD-src-7b624f0be1a93c6b631464d3f96c4277a78781af.zip
FreeBSD-src-7b624f0be1a93c6b631464d3f96c4277a78781af.tar.gz
Fix the NFSv4 server so that it returns NFSERR_SYMLINK when
an attempt to do an Open operation on any type of file other than VREG is done. A recent discussion on the IETF working group's mailing list (nfsv4@ietf.org) decided that NFSERR_SYMLINK should be returned for all non-regular files and not just symlinks, so that the Linux client would work correctly. This change does not affect the FreeBSD NFSv4 client and is not believed to have a negative effect on other NFSv4 clients. Reviewed by: zkirsch Approved by: re (kib) MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfsserver')
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index d234e91..85fbbd2 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -2741,12 +2741,11 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
* Do basic access checking.
*/
if (!nd->nd_repstat && vnode_vtype(vp) != VREG) {
- if (vnode_vtype(vp) == VDIR)
- nd->nd_repstat = NFSERR_ISDIR;
- else if (vnode_vtype(vp) == VLNK)
+ /*
+ * The IETF working group decided that this is the correct
+ * error return for all non-regular files.
+ */
nd->nd_repstat = NFSERR_SYMLINK;
- else
- nd->nd_repstat = NFSERR_INVAL;
}
if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_WRITEACCESS))
nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred,
OpenPOWER on IntegriCloud