diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2017-11-07 17:51:09 -0600 |
---|---|---|
committer | Benjamin Marzinski <bmarzins@redhat.com> | 2017-11-07 17:51:09 -0600 |
commit | 542c8d8bff557bb8b620443635f22f940001443c (patch) | |
tree | 010804191efdefb3d05d784c3aeeeae684a930c0 /0014-RH-warn-on-invalid-regex-instead-of-failing.patch | |
parent | 5e7fb0583a274cf135a2c2c6da4522f8efbf2104 (diff) | |
download | device-mapper-multipath-542c8d8bff557bb8b620443635f22f940001443c.tar.gz device-mapper-multipath-542c8d8bff557bb8b620443635f22f940001443c.tar.xz device-mapper-multipath-542c8d8bff557bb8b620443635f22f940001443c.zip |
device-mapper-multipath-0.7.3-1
Update Source to upstream 0.7.3 release
* Previous patch 0001 is included in this commit, and 0002 was solved
in a different manner causing some change to previous patch 0003
* Previous patches 0003-0010 are now patches 0007-0014
Add 0001-mpathpersist-Fix-invalid-condition-check.patch
* Fix incorrect check. posted upstream
Add 0002-multipath-add-man-page-info-for-my-prkey-changes.patch
* Add missing man page info. posted upstream
Add 0003-multipath-there-is-no-none-path-state.patch
* remove incorrect path state. posted upstream
Add 0004-mutipath-updated-Huawei-storage-config.patch
* update builtin device configuration. posted upstream
Add 0005-multipath-fix-doc-typo.patch
* fix man page typo. posted upstream
Add 0006-multipath-add-ghost_delay-parameter.patch
* add new multipath.conf parameter "ghost_delay". posted upstream
Diffstat (limited to '0014-RH-warn-on-invalid-regex-instead-of-failing.patch')
-rw-r--r-- | 0014-RH-warn-on-invalid-regex-instead-of-failing.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/0014-RH-warn-on-invalid-regex-instead-of-failing.patch b/0014-RH-warn-on-invalid-regex-instead-of-failing.patch new file mode 100644 index 0000000..22a66a2 --- /dev/null +++ b/0014-RH-warn-on-invalid-regex-instead-of-failing.patch @@ -0,0 +1,121 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski <bmarzins@redhat.com> +Date: Mon, 6 Nov 2017 21:39:28 -0600 +Subject: [PATCH] RH: warn on invalid regex instead of failing + +multipath.conf used to allow "*" as a match everything regular expression, +instead of requiring ".*". Instead of erroring when the old style +regular expressions are used, it should print a warning and convert +them. + +Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> +--- + libmultipath/dict.c | 27 +++++++++++++++++++++------ + libmultipath/parser.c | 13 +++++++++++++ + libmultipath/parser.h | 1 + + 3 files changed, 35 insertions(+), 6 deletions(-) + +diff --git a/libmultipath/dict.c b/libmultipath/dict.c +index 54652d4..8d97602 100644 +--- a/libmultipath/dict.c ++++ b/libmultipath/dict.c +@@ -52,6 +52,21 @@ set_str(vector strvec, void *ptr) + } + + static int ++set_regex(vector strvec, void *ptr) ++{ ++ char **str_ptr = (char **)ptr; ++ ++ if (*str_ptr) ++ FREE(*str_ptr); ++ *str_ptr = set_regex_value(strvec); ++ ++ if (!*str_ptr) ++ return 1; ++ ++ return 0; ++} ++ ++static int + set_yes_no(vector strvec, void *ptr) + { + char * buff; +@@ -1190,7 +1205,7 @@ ble_ ## option ## _handler (struct config *conf, vector strvec) \ + if (!conf->option) \ + return 1; \ + \ +- buff = set_value(strvec); \ ++ buff = set_regex_value(strvec); \ + if (!buff) \ + return 1; \ + \ +@@ -1206,7 +1221,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \ + if (!conf->option) \ + return 1; \ + \ +- buff = set_value(strvec); \ ++ buff = set_regex_value(strvec); \ + if (!buff) \ + return 1; \ + \ +@@ -1301,16 +1316,16 @@ device_handler(struct config *conf, vector strvec) + return 0; + } + +-declare_hw_handler(vendor, set_str) ++declare_hw_handler(vendor, set_regex) + declare_hw_snprint(vendor, print_str) + +-declare_hw_handler(product, set_str) ++declare_hw_handler(product, set_regex) + declare_hw_snprint(product, print_str) + +-declare_hw_handler(revision, set_str) ++declare_hw_handler(revision, set_regex) + declare_hw_snprint(revision, print_str) + +-declare_hw_handler(bl_product, set_str) ++declare_hw_handler(bl_product, set_regex) + declare_hw_snprint(bl_product, print_str) + + declare_hw_handler(hwhandler, set_str) +diff --git a/libmultipath/parser.c b/libmultipath/parser.c +index c47d891..74b4efe 100644 +--- a/libmultipath/parser.c ++++ b/libmultipath/parser.c +@@ -346,6 +346,19 @@ set_value(vector strvec) + return alloc; + } + ++void * ++set_regex_value(vector strvec) ++{ ++ char *buff = set_value(strvec); ++ ++ if (buff && strcmp("*", buff) == 0) { ++ condlog(0, "Invalid regular expression \"*\" in multipath.conf. Using \".*\""); ++ FREE(buff); ++ return strdup(".*"); ++ } ++ return buff; ++} ++ + /* non-recursive configuration stream handler */ + static int kw_level = 0; + +diff --git a/libmultipath/parser.h b/libmultipath/parser.h +index 519b805..96f40bd 100644 +--- a/libmultipath/parser.h ++++ b/libmultipath/parser.h +@@ -73,6 +73,7 @@ extern void dump_keywords(vector keydump, int level); + extern void free_keywords(vector keywords); + extern vector alloc_strvec(char *string); + extern void *set_value(vector strvec); ++extern void *set_regex_value(vector strvec); + extern int process_file(struct config *conf, char *conf_file); + extern struct keyword * find_keyword(vector keywords, vector v, char * name); + int snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw, +-- +2.7.4 + |