Blob Blame History Raw
autofs-5.1.3 - handle additional nfs versions in mount_nfs.c

From: Ian Kent <raven@themaw.net>

Since NFSv4 can now have a subversion it needs to be allowed for.

It's enough to check for an options string starting with "vers=4" or
"nfsvers=4" because it's used only to set a flag used for special
casing the availibility probe for any NFS version 4 version.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG           |    1 +
 modules/mount_nfs.c |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

--- autofs-5.0.7.orig/CHANGELOG
+++ autofs-5.0.7/CHANGELOG
@@ -253,6 +253,7 @@
 - fix unset tsd group name handling.
 - revert fix argc off by one in mount_autofs.c.
 - allow dot in OPTIONSTR value lexer pattern.
+- handle additional nfs versions in mount_nfs.c.
 
 25/07/2012 autofs-5.0.7
 =======================
--- autofs-5.0.7.orig/modules/mount_nfs.c
+++ autofs-5.0.7/modules/mount_nfs.c
@@ -148,8 +148,9 @@ int mount_mount(struct autofs_point *ap,
 			} else if (_strncmp("use-weight-only", cp, o_len) == 0) {
 				flags |= MOUNT_FLAG_USE_WEIGHT_ONLY;
 			} else {
-				if (_strncmp("vers=4", cp, o_len) == 0 ||
-				    _strncmp("nfsvers=4", cp, o_len) == 0)
+				/* Is any version of NFSv4 in the options */
+				if (_strncmp("vers=4", cp, 6) == 0 ||
+				    _strncmp("nfsvers=4", cp, 9) == 0)
 					vers = NFS4_VERS_MASK | TCP_SUPPORTED;
 				else if (_strncmp("vers=3", cp, o_len) == 0 ||
 					 _strncmp("nfsvers=3", cp, o_len) == 0) {