| #!/bin/sh | |
| # PROBLEM: Allows the front VM to close its focused window right before | |
| # keystroke delivery, leading to shutting down the VM with the window in | |
| # back. Effective denial of service. | |
| set -e | |
| front=$(xprop -notype -root _NET_ACTIVE_WINDOW | awk '{if (match($0,"^_NET_ACTIVE_WINDOW: window id # (0x[0-9a-f]*), 0x0$",m)){print m[1];} exit 0;}' ) | |
| test -n "$front" | |
| vm=$(xprop -id "$front" -notype _QUBES_VMNAME | awk '{if (match($0,"^_QUBES_VMNAME = \"([^\"]*)\"$",m)){print m[1];} exit 0;}') | |
| test -n "$vm" | |
| exec qvm-shutdown -- "$vm" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Oops, pasted wrong script initially >_> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oops, pasted wrong script initially >_>