summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2013-10-21 10:03:04 -0400
committerSteve Dickson <steved@redhat.com>2013-10-21 10:03:53 -0400
commit6085de30b363e916ea6968f54c294aeecac07efa (patch)
tree63026dc63f484382d92b4dba6fa6e635157ac615
parenta4cffdb22fd11f37bfd1ccffd91aacd4c77cba5e (diff)
downloadnfs-utils-6085de30b363e916ea6968f54c294aeecac07efa.tar.gz
nfs-utils-6085de30b363e916ea6968f54c294aeecac07efa.tar.xz
nfs-utils-6085de30b363e916ea6968f54c294aeecac07efa.zip
nfsmount.conf: remove duplicate 'timeo' from the parsing string
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>
-rw-r--r--utils/mount/configfile.c10
1 files changed, 10 insertions, 0 deletions
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)