walters / rpms / nfs-utils

Forked from rpms/nfs-utils 6 years ago
Clone
e3bba39
diff -up nfs-utils-1.2.0/utils/mount/configfile.c.orig nfs-utils-1.2.0/utils/mount/configfile.c
7824f9c
--- nfs-utils-1.2.0/utils/mount/configfile.c.orig	2009-10-02 11:10:01.000000000 -0400
7824f9c
+++ nfs-utils-1.2.0/utils/mount/configfile.c	2009-10-02 11:14:30.000000000 -0400
7824f9c
@@ -185,6 +185,20 @@ void free_all(void)
e3bba39
 		free(entry);
e3bba39
 	}
e3bba39
 }
e3bba39
+static char *versions[] = {"v2", "v3", "v4", "vers", "nfsvers", NULL};
e3bba39
+int inline check_vers(char *mopt, char *field)
e3bba39
+{
e3bba39
+	int i;
e3bba39
+
7824f9c
+	if (strncmp("mountvers", field, strlen("mountvers") != 0 &&
7824f9c
+			(strcasecmp(field, "nfsvers") == 0 || 
7824f9c
+				strcasecmp(field, "vers") == 0))) {
7824f9c
+		for (i=0; versions[i]; i++) 
7824f9c
+			if (strcasestr(mopt, versions[i]) != NULL)
e3bba39
+				return 1;
e3bba39
+	}
e3bba39
+	return 0;
e3bba39
+}
e3bba39
 /*
e3bba39
  * Parse the given section of the configuration 
e3bba39
  * file to if there are any mount options set.
7824f9c
@@ -207,6 +221,12 @@ conf_parse_mntopts(char *section, char *
e3bba39
 		snprintf(buf, BUFSIZ, "%s=", node->field);
e3bba39
 		if (opts && strcasestr(opts, buf) != NULL)
e3bba39
 			continue;
e3bba39
+		/* 
e3bba39
+		 * Protocol verions can be set in a number of ways
e3bba39
+		 */
e3bba39
+		if (opts && check_vers(opts, node->field))
e3bba39
+			continue;
e3bba39
+
e3bba39
 		if (lookup_entry(node->field) != NULL)
e3bba39
 			continue;
e3bba39
 		buf[0] = '\0';