dispvm: sanitize used memory info received from VM

Luckily it is used as argument to commands with does not allow any
harmful arguments (virsh set(max)mem). Also usage in arithmetic
expression does not allow any harmful usage in this place.
This commit is contained in:
Marek Marczykowski-Górecki 2015-04-28 03:21:31 +02:00
parent e9735d156c
commit cd163b81be

View File

@ -42,7 +42,7 @@ qubesdb-read -d $1 /qubes-gateway | \
kill `cat /var/run/qubes/guid-running.$ID`
# FIXME: get connection URI from core scripts
virsh -c xen:/// detach-disk $1 xvdb
MEM=$(qubesdb-read -d $1 /qubes-used-mem)
MEM=$(qubesdb-read -d $1 /qubes-used-mem | grep -q '^[0-9]\+$' | head -n 1)
echo "DVM boot complete, memory used=$MEM. Saving image..." >&2
QMEMMAN_STOP=/var/run/qubes/do-not-membalance
touch $QMEMMAN_STOP