From owner-svn-src-stable-8@FreeBSD.ORG Sat Sep 3 01:45:37 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D59C106566B; Sat, 3 Sep 2011 01:45:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE3B8FC08; Sat, 3 Sep 2011 01:45:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p831jbNn024376; Sat, 3 Sep 2011 01:45:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p831jbR5024374; Sat, 3 Sep 2011 01:45:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201109030145.p831jbR5024374@svn.freebsd.org> From: Rick Macklem Date: Sat, 3 Sep 2011 01:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225358 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 01:45:37 -0000 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,