summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-17 04:11:34 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-01-09 02:21:44 +0300
commit1a4b7ee28bf7413af6513fb45ad0d0736048f866 (patch)
tree79f6d8ea698cab8f2eaf4f54b793d2ca7a1451ce /meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch
parent5b9ede0403237c7dace972affa65cf64a1aadd0e (diff)
downloadopenbmc-1a4b7ee28bf7413af6513fb45ad0d0736048f866.tar.xz
reset upstream subtrees to yocto 2.6
Reset the following subtrees on thud HEAD: poky: 87e3a9739d meta-openembedded: 6094ae18c8 meta-security: 31dc4e7532 meta-raspberrypi: a48743dc36 meta-xilinx: c42016e2e6 Also re-apply backports that didn't make it into thud: poky: 17726d0 systemd-systemctl-native: handle Install wildcards meta-openembedded: 4321a5d libtinyxml2: update to 7.0.1 042f0a3 libcereal: Add native and nativesdk classes e23284f libcereal: Allow empty package 030e8d4 rsyslog: curl-less build with fmhttp PACKAGECONFIG 179a1b9 gtest: update to 1.8.1 Squashed OpenBMC subtree compatibility updates: meta-aspeed: Brad Bishop (1): aspeed: add yocto 2.6 compatibility meta-ibm: Brad Bishop (1): ibm: prepare for yocto 2.6 meta-ingrasys: Brad Bishop (1): ingrasys: set layer compatibility to yocto 2.6 meta-openpower: Brad Bishop (1): openpower: set layer compatibility to yocto 2.6 meta-phosphor: Brad Bishop (3): phosphor: set layer compatibility to thud phosphor: libgpg-error: drop patches phosphor: react to fitimage artifact rename Ed Tanous (4): Dropbear: upgrade options for latest upgrade yocto2.6: update openssl options busybox: remove upstream watchdog patch systemd: Rebase CONFIG_CGROUP_BPF patch Change-Id: I7b1fe71cca880d0372a82d94b5fd785323e3a9e7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch')
-rw-r--r--meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch121
1 files changed, 121 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch b/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch
new file mode 100644
index 000000000..a23e16739
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-support/multipath-tools/files/0027-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 7ad0f5a..ab808d6 100644
+--- a/libmultipath/dict.c
++++ b/libmultipath/dict.c
+@@ -55,6 +55,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;
+@@ -1271,7 +1286,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; \
+ \
+@@ -1287,7 +1302,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; \
+ \
+@@ -1388,16 +1403,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 b8b7e0d..34b4ad2 100644
+--- a/libmultipath/parser.c
++++ b/libmultipath/parser.c
+@@ -380,6 +380,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 62906e9..b791705 100644
+--- a/libmultipath/parser.h
++++ b/libmultipath/parser.h
+@@ -77,6 +77,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
+