js: Use Shell.util_spawn_async functions to launch external processes
As explained in previous commits, it's not safe to use JS code in child function callbacks, so let's use the safer version of it. Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6698 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3293>
This commit is contained in:

committed by
Marge Bot

parent
781010be66
commit
26e8fb90fb
@ -456,18 +456,12 @@ class VPNRequestHandler extends Signals.EventEmitter {
|
||||
|
||||
try {
|
||||
const launchContext = global.create_app_launch_context(0, -1);
|
||||
let [success_, pid, stdin, stdout, stderr] =
|
||||
GLib.spawn_async_with_pipes(
|
||||
let [pid, stdin, stdout, stderr] =
|
||||
Shell.util_spawn_async_with_pipes(
|
||||
null, /* pwd */
|
||||
argv,
|
||||
launchContext.get_environment(),
|
||||
GLib.SpawnFlags.DO_NOT_REAP_CHILD,
|
||||
() => {
|
||||
try {
|
||||
global.context.restore_rlimit_nofile();
|
||||
} catch (err) {
|
||||
}
|
||||
});
|
||||
GLib.SpawnFlags.DO_NOT_REAP_CHILD);
|
||||
|
||||
this._childPid = pid;
|
||||
this._stdin = new GioUnix.OutputStream({fd: stdin, close_fd: true});
|
||||
|
Reference in New Issue
Block a user