summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2011-12-04 16:33:04 +0000
committerrmacklem <rmacklem@FreeBSD.org>2011-12-04 16:33:04 +0000
commite7537e29440bb79c1ae28bd4d17477b3eb4baaa7 (patch)
tree3b7804266bb14e068e3bc03dac41842a2c42d51a /sys/fs
parentff8355fd0adf45a0a0be9afa0e0791db4f1251ff (diff)
downloadFreeBSD-src-e7537e29440bb79c1ae28bd4d17477b3eb4baaa7.zip
FreeBSD-src-e7537e29440bb79c1ae28bd4d17477b3eb4baaa7.tar.gz
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
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsserver/nfs_nfsdsubs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c
index bd92c3f..5c8ecec 100644
--- a/sys/fs/nfsserver/nfs_nfsdsubs.c
+++ b/sys/fs/nfsserver/nfs_nfsdsubs.c
@@ -56,6 +56,13 @@ static nfstype newnfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK,
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 *nd, char *bufp, u_long *hashp,
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;
OpenPOWER on IntegriCloud