grubby-bls: always escape the delimiter character used in sed commands
The forward slash character is used as the delimiter for sed substitutions so this is escaped before calling sed. But this was only done before removing parameters from the kernel command and not when adding it. Use it for all the cases when the parameters are replaced in the update_args() function. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
parent
1621d288b6
commit
b1eee22db8
@ -459,8 +459,8 @@ update_args() {
|
||||
local add_args=($1) && shift
|
||||
|
||||
for arg in ${remove_args[*]}; do
|
||||
arg="$(echo $arg | sed -e 's/\//\\\//g')"
|
||||
if [[ $arg = *"="* ]]; then
|
||||
arg="$(echo $arg | sed -e 's/\//\\\//g')"
|
||||
args="$(echo $args | sed -E "s/(^|[[:space:]])$arg([[:space:]]|$)/ /")"
|
||||
else
|
||||
args="$(echo $args | sed -E "s/(^|[[:space:]])$arg(([[:space:]]|$)|([=][^ ]*([$]*)))/ /g")"
|
||||
@ -469,6 +469,7 @@ update_args() {
|
||||
|
||||
for arg in ${add_args[*]}; do
|
||||
arg="${arg%%=*}"
|
||||
arg="$(echo $arg | sed -e 's/\//\\\//g')"
|
||||
args="$(echo $args | sed -E "s/(^|[[:space:]])$arg(([[:space:]]|$)|([=][^ ]*([$]*)))/ /g")"
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user