template: allow & in arg string

This commit is contained in:
tschettervictor
2025-01-14 08:45:35 -07:00
committed by GitHub
parent 1dedfed3a0
commit 358dbe7e0b

View File

@@ -54,7 +54,7 @@ get_arg_name() {
parse_arg_value() {
# Parses the value after = and then escapes back/forward slashes and single quotes in it. -- cwells
echo "${1}" | sed -E 's/[^=]+=?//' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/'\''/'\''\\'\'\''/g'
echo "${1}" | sed -E 's/[^=]+=?//' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/'\''/'\''\\'\'\''/g' -e 's/&/\\&/g'
}
get_arg_value() {
@@ -299,7 +299,7 @@ for _jail in ${JAILS}; do
;;
cmd)
# Escape single-quotes in the command being executed. -- cwells
_args=$(echo "${_args}" | sed "s/'/'\\\\''/g")
_args=$(echo "${_args}" | sed "s/'/'\\\\''/g" | sed 's/&/\\&/g')
# Allow redirection within the jail. -- cwells
_args="sh -c '${_args}'"
;;