From: Benjamin Marzinski <bmarzins@redhat.com>
To: christophe varoqui <christophe.varoqui@free.fr>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH 4/6] Fix for parsing multipath.conf files without spaces before brackets
Date: Thu, 11 Dec 2008 16:10:27 -0600 [thread overview]
Message-ID: <20081211221027.GL1585@ether.msp.redhat.com> (raw)
There's a bug in bug in the multipath.conf code that keeps multipath from
correctly parsing config files where there is no space between a section name
and the opening bracket. For instance
devices {
device {
...
}
}
works but
devices {
device{
...
}
}
doesn't. This patch makes sure that brackets are the recognized as seperate from
the token that they follow, unless they are part of a quoted string.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/parser.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Index: multipath-tools-081203/libmultipath/parser.c
===================================================================
--- multipath-tools-081203.orig/libmultipath/parser.c
+++ multipath-tools-081203/libmultipath/parser.c
@@ -239,12 +239,20 @@ alloc_strvec(char *string)
in_string = 0;
else
in_string = 1;
+ } else if (!in_string && (*cp == '{' || *cp == '}')) {
+ token = MALLOC(2);
+ if (!token)
+ goto out;
+
+ *(token) = *cp;
+ *(token + 1) = '\0';
+ cp++;
} else {
while ((in_string ||
(!isspace((int) *cp) && isascii((int) *cp) &&
- *cp != '!' && *cp != '#')) &&
- *cp != '\0' && *cp != '"')
+ *cp != '!' && *cp != '#' && *cp != '{' &&
+ *cp != '}')) && *cp != '\0' && *cp != '"')
cp++;
strlen = cp - start;
token = MALLOC(strlen + 1);
reply other threads:[~2008-12-11 22:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20081211221027.GL1585@ether.msp.redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@free.fr \
--cc=dm-devel@redhat.com \
/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 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.