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