From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- ...-warn-on-invalid-regex-instead-of-failing.patch | 66 ++++++++++++---------- 1 file changed, 37 insertions(+), 29 deletions(-) (limited to 'external/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch') diff --git a/external/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch b/external/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch index a23e1673..c59edbbb 100644 --- a/external/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch +++ b/external/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Mon, 6 Nov 2017 21:39:28 -0600 -Subject: [PATCH] RH: warn on invalid regex instead of failing +From 0000000000000000000000000000000000000000 Mon Sep 17 +00:00:00 2001 From: Benjamin Marzinski 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 @@ -9,48 +9,56 @@ regular expressions are used, it should print a warning and convert them. Signed-off-by: Benjamin Marzinski + +Upstream-Status: Pending + +update this patch to 0.8.2 + +Signed-off-by: Changqing Li --- - libmultipath/dict.c | 27 +++++++++++++++++++++------ + libmultipath/dict.c | 29 ++++++++++++++++++++++------- libmultipath/parser.c | 13 +++++++++++++ libmultipath/parser.h | 1 + - 3 files changed, 35 insertions(+), 6 deletions(-) + 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c -index 7ad0f5a..ab808d6 100644 +index c6eba0f..05ed3d8 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c -@@ -55,6 +55,21 @@ set_str(vector strvec, void *ptr) +@@ -59,6 +59,21 @@ set_str(vector strvec, void *ptr) } static int +set_regex(vector strvec, void *ptr) +{ -+ char **str_ptr = (char **)ptr; ++ char **str_ptr = (char **)ptr; + -+ if (*str_ptr) -+ FREE(*str_ptr); -+ *str_ptr = set_regex_value(strvec); ++ if (*str_ptr) ++ FREE(*str_ptr); ++ *str_ptr = set_regex_value(strvec); + -+ if (!*str_ptr) -+ return 1; ++ if (!*str_ptr) ++ return 1; + -+ return 0; ++ return 0; +} + +static int set_yes_no(vector strvec, void *ptr) { char * buff; -@@ -1271,7 +1286,7 @@ ble_ ## option ## _handler (struct config *conf, vector strvec) \ +@@ -1415,8 +1430,8 @@ 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; \ \ -@@ -1287,7 +1302,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \ +@@ -1432,7 +1447,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \ if (!conf->option) \ return 1; \ \ @@ -59,7 +67,7 @@ index 7ad0f5a..ab808d6 100644 if (!buff) \ return 1; \ \ -@@ -1388,16 +1403,16 @@ device_handler(struct config *conf, vector strvec) +@@ -1535,16 +1550,16 @@ device_handler(struct config *conf, vector strvec) return 0; } @@ -81,24 +89,24 @@ index 7ad0f5a..ab808d6 100644 declare_hw_handler(hwhandler, set_str) diff --git a/libmultipath/parser.c b/libmultipath/parser.c -index b8b7e0d..34b4ad2 100644 +index e00c5ff..6ca5842 100644 --- a/libmultipath/parser.c +++ b/libmultipath/parser.c -@@ -380,6 +380,19 @@ set_value(vector strvec) - return alloc; +@@ -382,6 +382,19 @@ oom: + return NULL; } +void * +set_regex_value(vector strvec) +{ -+ char *buff = set_value(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; ++ 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 */ -- cgit 1.2.3-korg