0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-12 04:01:14 +02:00

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"