linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the parsing string
Date: Tue,  8 Oct 2013 17:30:25 -0400	[thread overview]
Message-ID: <1381267825-27457-2-git-send-email-steved@redhat.com> (raw)
In-Reply-To: <1381267825-27457-1-git-send-email-steved@redhat.com>

When the 'timeo' option is specified in multiple sections of
the nfsmount.conf file, each instance is added to the parsing
string. This patch make the first instance override any others.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mount/configfile.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index 6985ed9..39d3741 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -186,8 +186,18 @@ char *lookup_entry(char *opt)
 {
 	struct entry *entry;
 	char *alias = is_alias(opt);
+	char *ptr;
 
 	SLIST_FOREACH(entry, &head, entries) {
+		/*
+		 * Only check the left side or options that use '='
+		 */
+		if ((ptr = strchr(entry->opt, '=')) != 0) {
+			int len = (int) (ptr - entry->opt);
+
+			if (strncasecmp(entry->opt, opt, len) == 0)
+				return opt;
+		}
 		if (strcasecmp(entry->opt, opt) == 0)
 			return opt;
 		if (alias && strcasecmp(entry->opt, alias) == 0)
-- 
1.8.3.1


  reply	other threads:[~2013-10-08 21:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 21:30 [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from parsing string Steve Dickson
2013-10-08 21:30 ` Steve Dickson [this message]
2013-10-21 14:04   ` [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the " Steve Dickson
2013-10-21 14:04 ` [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from " 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=1381267825-27457-2-git-send-email-steved@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;
as well as URLs for NNTP newsgroup(s).