diff options
author | Steve Dickson <steved@redhat.com> | 2010-01-20 15:05:46 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2010-01-20 15:05:46 -0500 |
commit | d63f9e0ccb836d592593a9816ccc00a51c903328 (patch) | |
tree | 4714cc7dcc3cf36897b373d68e3b2b0cdcc302cb /utils/mount/configfile.c | |
parent | 8e710e90bcf937d500445082800503f374560399 (diff) | |
download | nfs-utils-d63f9e0ccb836d592593a9816ccc00a51c903328.tar.gz nfs-utils-d63f9e0ccb836d592593a9816ccc00a51c903328.tar.xz nfs-utils-d63f9e0ccb836d592593a9816ccc00a51c903328.zip |
mount.nfs: Configuration file parser ignoring options
When the protocol version is set on the command line,
none of the variables set in the configuration file
are passed down to the kernel due to a bug in the
parsing routine.
Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/configfile.c')
-rw-r--r-- | utils/mount/configfile.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c index 28b722c..1dd4159 100644 --- a/utils/mount/configfile.c +++ b/utils/mount/configfile.c @@ -194,13 +194,29 @@ void free_all(void) static char *versions[] = {"v2", "v3", "v4", "vers", "nfsvers", NULL}; int inline check_vers(char *mopt, char *field) { - int i; + int i, found=0; - if (strncmp("mountvers", field, strlen("mountvers")) != 0) { - for (i=0; versions[i]; i++) - if (strcasestr(mopt, versions[i]) != NULL) - return 1; + /* + * First check to see if the config setting is one + * of the many version settings + */ + for (i=0; versions[i]; i++) { + if (strcasestr(field, versions[i]) != NULL) { + found++; + break; + } } + if (!found) + return 0; + /* + * It appears the version is being set, now see + * if the version appears on the command + */ + for (i=0; versions[i]; i++) { + if (strcasestr(mopt, versions[i]) != NULL) + return 1; + } + return 0; } |