On Thu, Jan 06, 2022 at 11:46:54AM +0800, Tao Liu wrote:
The '|' in 'failure_action|default' should be replaced
with '\|' when
passed to kdump_get_conf_val function. Because '|' needs to be escaped
to mean OR operation in sed regex, otherwise it will consider
'failure_action|default' as a whole string.
Fixes: ab1ef78 ("kdump-lib.sh: use kdump_get_conf_val to read config values")
v1 -> v2:
Rephased the commit message.
Replaced " with '.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
kdump-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index d7d28ee..e5d5a49 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -108,7 +108,7 @@ get_block_dump_target()
is_dump_to_rootfs()
{
- [[ $(kdump_get_conf_val "failure_action|default") == dump_to_rootfs ]]
+ [[ $(kdump_get_conf_val 'failure_action\|default') == dump_to_rootfs ]]
}
get_failure_action_target()
--
2.33.1
Patch merged, thanks!
Acked-by: Coiby Xu <coxu(a)redhat.com>
--
Best regards,
Coiby