From: Steve Dickson <SteveD@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] mount.nfs: protocol version set on command line being ignored
Date: Thu, 08 Oct 2009 11:13:48 -0400 [thread overview]
Message-ID: <4ACE01AC.3000806@RedHat.com> (raw)
Here is a bug that was found in some recent test cycles...
Author: Steve Dickson <steved@redhat.com>
Date: Thu Oct 8 10:56:57 2009 -0400
There are a number of different mount options that can be
used to set the protocol version on the command line. The
config file code needs to know about each option so the
command line value will override the config file value.
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index e347b0e..b0aa6f0 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -185,6 +185,20 @@ 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 &&
+ (strcasecmp(field, "nfsvers") == 0 ||
+ strcasecmp(field, "vers") == 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 +221,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';
next reply other threads:[~2009-10-08 15:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 15:13 Steve Dickson [this message]
[not found] ` <4ACE01AC.3000806-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-10-09 15:14 ` [PATCH] mount.nfs: protocol version set on command line being ignored Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ACE01AC.3000806@RedHat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox