[gnome-shell] networkAgent: Restore the NOFILE limit



commit 7c394b051210dec08c7e1e411876497e6ad6d871
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Jan 19 10:13:50 2022 +0100

    networkAgent: Restore the NOFILE limit
    
    Restore the original NOFILE limit prior to spawn the VPN helper.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2117>

 js/ui/components/networkAgent.js | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 4f880a4dd5..8c8d8451b8 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -389,11 +389,17 @@ var VPNRequestHandler = class {
 
         try {
             let [success_, pid, stdin, stdout, stderr] =
-                GLib.spawn_async_with_pipes(null, /* pwd */
-                                            argv,
-                                            null, /* envp */
-                                            GLib.SpawnFlags.DO_NOT_REAP_CHILD,
-                                            null /* child_setup */);
+                GLib.spawn_async_with_pipes(
+                    null, /* pwd */
+                    argv,
+                    null, /* envp */
+                    GLib.SpawnFlags.DO_NOT_REAP_CHILD,
+                    () => {
+                        try {
+                            global.context.restore_rlimit_nofile();
+                        } catch (err) {
+                        }
+                    });
 
             this._childPid = pid;
             this._stdin = new Gio.UnixOutputStream({ fd: stdin, close_fd: true });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]