Date: Sat, 3 Sep 2011 01:45:37 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r225358 - stable/8/sys/fs/nfsserver Message-ID: <201109030145.p831jbR5024374@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sat Sep 3 01:45:37 2011 New Revision: 225358 URL: http://svn.freebsd.org/changeset/base/225358 Log: MFC: r225049 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. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Sep 3 00:47:28 2011 (r225357) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Sep 3 01:45:37 2011 (r225358) @@ -2741,12 +2741,11 @@ nfsrvd_open(struct nfsrv_descript *nd, _ * 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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109030145.p831jbR5024374>