X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fmount%2Fconfigfile.c;h=d3285f8bf0cac5f9ebcdc2cbfd7609d163cdf4bf;hb=f87ae8235ae6042c0e514ba03e4eee7782d5bc6e;hp=e347b0ebcaf3fed77f86b873c25a3e77b6bd5ec7;hpb=8414d150cee62ba0554cfd645956a88dba02a7eb;p=nfs-utils.git diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c index e347b0e..d3285f8 100644 --- a/utils/mount/configfile.c +++ b/utils/mount/configfile.c @@ -185,6 +185,18 @@ void free_all(void) free(entry); } } +static char *versions[] = {"v2", "v3", "v4", "vers", "nfsvers", NULL}; +int inline check_vers(char *mopt, char *field) +{ + int i; + + if (strncmp("mountvers", field, strlen("mountvers")) != 0) { + for (i=0; versions[i]; i++) + if (strcasestr(mopt, versions[i]) != NULL) + return 1; + } + return 0; +} /* * Parse the given section of the configuration * file to if there are any mount options set. @@ -207,6 +219,12 @@ conf_parse_mntopts(char *section, char *arg, char *opts) snprintf(buf, BUFSIZ, "%s=", node->field); if (opts && strcasestr(opts, buf) != NULL) continue; + /* + * Protocol verions can be set in a number of ways + */ + if (opts && check_vers(opts, node->field)) + continue; + if (lookup_entry(node->field) != NULL) continue; buf[0] = '\0';