GNOME Bugzilla – Bug 791616
gst-uninstalled.py: Don't close parent file descriptors
Last modified: 2018-01-12 19:44:47 UTC
Python3 sets close_fds=True by default in subprocess.Popen() and friends. This is a problem when gst-uninstalled.py is used as a wrapper for some applications, like the WebKit WebProcess, that receives a file descriptor (pointing to a socket) as an argument.
Created attachment 365543 [details] [review] Patch
I think that patch is OK but I do not understand why close_fds=True is the default, in what case is it useful?
When gst-uninstalled is used as a wrapper for an executable that relies on file descriptor inheritance. For instance, before calling fork(), WebKit creates a socket which shares to its WebProcess children as an open file descriptor. The socket is not closed in the child process before calling execv(), so they can still use it to communicate with the browser. Therefore, if the WebProcess is swapped by a wrapper, e.g. gst-uninstall, it's necessary that such wrapper also does not close the socket file descriptor before calling execv() to execute the actual WebProcess.
commit a5ed8944e31583c3d499b720a2e3b3461716f98d (HEAD -> master, origin/master, origin/HEAD) Author: Alicia Boya García <aboya@igalia.com> Date: Thu Dec 14 15:35:23 2017 +0100 gst-uninstalled.py: Don't close parent file descriptors https://bugzilla.gnome.org/show_bug.cgi?id=791616