|
|
b7337d |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
b7337d |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
b7337d |
Date: Mon, 16 Nov 2020 13:52:09 -0600
|
|
|
b7337d |
Subject: [PATCH] libmultipath: warn about missing braces at end of
|
|
|
b7337d |
multipath.conf
|
|
|
b7337d |
|
|
|
b7337d |
Multipath doesn't warn when multipath.conf is missing closing braces at
|
|
|
b7337d |
the end of the file. This has confused people about the correct config
|
|
|
b7337d |
file syntax, so add a warning.
|
|
|
b7337d |
|
|
|
b7337d |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
b7337d |
---
|
|
|
b7337d |
libmultipath/parser.c | 5 +++--
|
|
|
b7337d |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
b7337d |
|
|
|
b7337d |
diff --git a/libmultipath/parser.c b/libmultipath/parser.c
|
|
|
b7337d |
index a7285a35..48b54e87 100644
|
|
|
b7337d |
--- a/libmultipath/parser.c
|
|
|
b7337d |
+++ b/libmultipath/parser.c
|
|
|
b7337d |
@@ -544,7 +544,7 @@ process_stream(struct config *conf, FILE *stream, vector keywords, char *file)
|
|
|
b7337d |
if (!strcmp(str, EOB)) {
|
|
|
b7337d |
if (kw_level > 0) {
|
|
|
b7337d |
free_strvec(strvec);
|
|
|
b7337d |
- break;
|
|
|
b7337d |
+ goto out;
|
|
|
b7337d |
}
|
|
|
b7337d |
condlog(0, "unmatched '%s' at line %d of %s",
|
|
|
b7337d |
EOB, line_nr, file);
|
|
|
b7337d |
@@ -583,7 +583,8 @@ process_stream(struct config *conf, FILE *stream, vector keywords, char *file)
|
|
|
b7337d |
|
|
|
b7337d |
free_strvec(strvec);
|
|
|
b7337d |
}
|
|
|
b7337d |
-
|
|
|
b7337d |
+ if (kw_level == 1)
|
|
|
b7337d |
+ condlog(1, "missing '%s' at end of %s", EOB, file);
|
|
|
b7337d |
out:
|
|
|
b7337d |
FREE(buf);
|
|
|
b7337d |
free_uniques(uniques);
|
|
|
b7337d |
--
|
|
|
b7337d |
2.17.2
|
|
|
b7337d |
|