[Flatpak] Pass more environment variables to sandbox
authorcturner@igalia.com <cturner@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2018 16:59:12 +0000 (16:59 +0000)
committercturner@igalia.com <cturner@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2018 16:59:12 +0000 (16:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188002

Reviewed by Michael Catanzaro.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/flatpak/flatpakutils.py

index 1a26b5a..8816217 100644 (file)
@@ -1,3 +1,13 @@
+2018-07-25  Charlie Turner  <cturner@igalia.com>
+
+        [Flatpak] Pass more environment variables to sandbox
+        https://bugs.webkit.org/show_bug.cgi?id=188002
+
+        Reviewed by Michael Catanzaro.
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.run_in_sandbox):
+
 2018-07-25  Zan Dobersek  <zdobersek@igalia.com>
 
         [WPE] Switch ViewBackend to using wpe_view_backend_exportable_fdo_egl APIs
index 0e90dbf..9abbe7a 100644 (file)
@@ -679,9 +679,27 @@ class WebkitFlatpak:
                 "TEST_RUNNER_INJECTED_BUNDLE_FILENAME": "/app/webkit/lib/libTestRunnerInjectedBundle.so",
             }
 
+            env_var_prefixes_to_keep = [
+                "GST",
+                "GTK",
+                "G",
+                "JSC",
+                "WEBKIT",
+                "WEBKIT2",
+                "WPE",
+                "GIGACAGE",
+            ]
+
+            env_vars_to_keep = [
+                "JavaScriptCoreUseJIT",
+                "Malloc",
+                "WAYLAND_DISPLAY",
+                "DISPLAY",
+                "LANG",
+            ]
+
             for envvar, value in os.environ.items():
-                if envvar.split("_")[0] in ("GST", "GTK", "G") or \
-                        envvar in ["WAYLAND_DISPLAY", "DISPLAY", "LANG"]:
+                if envvar.split("_")[0] in env_var_prefixes_to_keep or envvar in env_vars_to_keep:
                     forwarded[envvar] = value
 
             for envvar, value in forwarded.items():