mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-23 18:50:46 +01:00
template: do not escape & in “cmd”
This commit is contained in:
@@ -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' -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" | sed 's/&/\\&/g')
|
||||
_args=$(echo "${_args}" | sed "s/'/'\\\\''/g")
|
||||
# Allow redirection within the jail. -- cwells
|
||||
_args="sh -c '${_args}'"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user