mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
firmware: make it a bit safer still
This commit is contained in:
parent
e4d452b37b
commit
4208db6d5f
@ -112,6 +112,9 @@ output_cmd()
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
for ARG in "${@}"; do
|
||||
# transform first to trap replacements
|
||||
ARG="$(echo "${ARG}")"
|
||||
|
||||
# single quote will not execute for safety
|
||||
if [ -z "${ARG##*"'"*}" ]; then
|
||||
output_text "firmware: safety violation in argument during ${REQUEST}"
|
||||
@ -119,7 +122,7 @@ output_cmd()
|
||||
fi
|
||||
|
||||
# append safely to argument in single quotes
|
||||
DO_CMD="${DO_CMD} '$(echo ${ARG})'"
|
||||
DO_CMD="${DO_CMD} '${ARG}'"
|
||||
done
|
||||
|
||||
# pipe needed for grabbing the command return value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user