PoC use double fork to escape SIGSTOP

This commit is contained in:
mw 2019-08-28 00:09:04 +02:00
parent 6652a581df
commit b59ecc8aac

View file

@ -36,7 +36,13 @@ class Module(bumblebee.engine.Module):
try:
if self._active:
self._xid = bumblebee.util.execute("xdotool search --class \"i3bar\"").strip()
bumblebee.util.execute("xdg-screensaver suspend {}".format(self._xid))
pid = os.fork()
if pid == 0:
os.setsid()
bumblebee.util.execute("xdg-screensaver suspend {}".format(self._xid))
os._exit(0)
else:
os.waitpid(pid,0)
bumblebee.util.execute("notify-send \"Consuming caffeine\"")
else:
for process in psutil.process_iter():