qubes.ShowInTerminal: simply exit if mktemp generate " character

This commit is contained in:
Frédéric Pierret (fepitre) 2019-05-11 11:54:24 +02:00
parent 2b2752f936
commit 0c3421cfa8
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -2,7 +2,13 @@
set -eu
tmpdir="$(mktemp -d)"
sock="${tmpdir//\"/\"\\\"\"/}/terminal.sock"
if [[ $tmpdir =~ \" ]]; then
echo 'Error: non admissible character detected in sock path.'
exit 1
fi
sock="$tmpdir/terminal.sock"
xterm -geometry 80x24 -e /bin/sh -c "
until [ -S $sock ]; do sleep 0.1; done || true