Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Dec 2011 16:33:04 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228260 - head/sys/fs/nfsserver
Message-ID:  <201112041633.pB4GX57R094453@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Dec  4 16:33:04 2011
New Revision: 228260
URL: http://svn.freebsd.org/changeset/base/228260

Log:
  This patch adds a sysctl to the NFSv4 server which optionally disables the
  check for a UTF-8 compliant file name. Enabling this sysctl results in
  an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled
  by default. However, enabling this sysctl results in NFSv3 compatible
  behaviour and fixes the problem reported by "dan at sunsaturn.com"
  to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat".
  
  Tested by:	dan at sunsaturn.com
  Reviewed by:	zack
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdsubs.c

Modified: head/sys/fs/nfsserver/nfs_nfsdsubs.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdsubs.c	Sun Dec  4 14:44:31 2011	(r228259)
+++ head/sys/fs/nfsserver/nfs_nfsdsubs.c	Sun Dec  4 16:33:04 2011	(r228260)
@@ -56,6 +56,13 @@ static nfstype newnfsv2_type[9] = { NFNO
 extern nfstype nfsv34_type[9];
 #endif	/* !APPLEKEXT */
 
+SYSCTL_DECL(_vfs_nfsd);
+
+static int	disable_checkutf8 = 0;
+SYSCTL_INT(_vfs_nfsd, OID_AUTO, disable_checkutf8, CTLFLAG_RW,
+    &disable_checkutf8, 0,
+    "Disable the NFSv4 check for a UTF8 compliant name");
+
 static char nfsrv_hexdigit(char, int *);
 
 /*
@@ -1963,7 +1970,8 @@ nfsrv_parsename(struct nfsrv_descript *n
 		    error = 0;
 		    goto nfsmout;
 		}
-		if (nfsrv_checkutf8((u_int8_t *)bufp, outlen)) {
+		if (disable_checkutf8 == 0 &&
+		    nfsrv_checkutf8((u_int8_t *)bufp, outlen)) {
 		    nd->nd_repstat = NFSERR_INVAL;
 		    error = 0;
 		    goto nfsmout;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112041633.pB4GX57R094453>