fix(toolbox): avoid prompt injection

This commit is contained in:
Carlo Sala 2024-08-02 17:00:55 +02:00
parent 2cb403e89f
commit 3b5f018f70
No known key found for this signature in database
GPG Key ID: DA6FB450C1A4FE9A

View File

@ -3,7 +3,9 @@ function toolbox_prompt_info() {
}
function toolbox_prompt_name() {
[[ -f /run/.containerenv ]] && cat /run/.containerenv | awk -F\" '/name/ { print$2 }'
[[ -f /run/.containerenv ]] || return
local _to_print="$(cat /run/.containerenv | awk -F\" '/name/ { print$2 }')"
echo ${_to_print:gs/%/%%}
}
alias tbe="toolbox enter"