* [PATCH] mount.nfs: Configuration file parser ignoring options
@ 2010-01-18 21:47 Steve Dickson
[not found] ` <4B54D6E5.7030609-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2010-01-18 21:47 UTC (permalink / raw)
To: Linux NFS Mailing list
Author: Steve Dickson <steved@redhat.com>
Date: Mon Jan 18 16:45:26 EST 2010
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>
diff -up nfs-utils-1.2.1/utils/mount/configfile.c.orig nfs-utils-1.2.1/utils/mount/configfile.c
--- nfs-utils-1.2.1/utils/mount/configfile.c.orig 2009-11-04 06:13:56.000000000 -0500
+++ nfs-utils-1.2.1/utils/mount/configfile.c 2010-01-18 15:39:02.973739055 -0500
@@ -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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-20 20:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-18 21:47 [PATCH] mount.nfs: Configuration file parser ignoring options Steve Dickson
[not found] ` <4B54D6E5.7030609-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-01-20 20:07 ` Steve Dickson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.