qubes-core-admin-linux/qvm-xkill
Jean-Philippe Ouellet be1d984364
Mitigate GUI DoS (part 2: qvm-xkill)
Can close windows of a VM while it's paused, and can not accidentally
harm dom0 by errant clicking.

Discussion in https://github.com/QubesOS/qubes-issues/issues/881

Thanks to rustybird for suggested implementation.
2016-11-26 21:59:16 -05:00

11 lines
189 B
Bash

#!/bin/sh
set -e
ID=$(xdotool selectwindow)
xprop -id "$ID" _QUBES_VMNAME | grep -q ' = ' \
|| { echo "${0##* /}: Not killing dom0 window $ID" >&2; exit 1; }
xdotool windowkill "$ID"