flatpak / flatpak-xdg-utils

Simple portal-based commandline tools for use inside flatpak sandboxes
GNU Lesser General Public License v2.1
34 stars 14 forks source link

flatpak-spawn signal handler is not async-signal-safe #29

Closed smcv closed 4 years ago

smcv commented 4 years ago

flatpak-spawn currently catches various signals by using signal() with a handler that posts an event to the main loop via g_idle_add(), but I'm fairly sure that isn't guaranteed to be async-signal safe.

Since Flatpak is Linux-specific (and therefore so is flatpak-spawn?), I think this can probably be most easily solved by using a signalfd. I have a prototype implementation, but I haven't tested it yet.

smcv commented 4 years ago

34 is a working implementation, based on code derived from flatpak-spawn used in Steam's pressure-vessel.