From 057e505536a31408c67cc6396bde93a20fffa4df Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Nov 03 2021 08:14:24 +0000 Subject: dracut-module-setup.sh: fix a ambiguous variable reference upstream: fedora resolves: bz2003832 conflict: none commit dfe7555323e22d3f23621fcdae11b2c467754175 Author: Kairui Song Date: Wed Aug 4 15:51:34 2021 +0800 dracut-module-setup.sh: fix a ambiguous variable reference Wrap the variable with {...}, else it may get interpreted as array due to the '[' char next to it. Signed-off-by: Kairui Song Acked-by: Philipp Rudo Signed-off-by: Tao Liu --- diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 6af96fb..6f5d754 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -686,11 +686,11 @@ kdump_install_conf() { case "$_opt" in raw) _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev $_val) - sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf + sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ext[234]|xfs|btrfs|minix) _pdev=$(kdump_get_persistent_dev $_val) - sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf + sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ssh|nfs) kdump_install_net "$_val"