Title: [249569] trunk/Source/WebKit
Revision
249569
Author
[email protected]
Date
2019-09-06 02:00:04 -0700 (Fri, 06 Sep 2019)

Log Message

[GTK][WPE] Do not enable the sandbox in Snap
https://bugs.webkit.org/show_bug.cgi?id=201486

Reviewed by Carlos Garcia Campos.

Running inside of Snap adds its own complications and is simply
not supported for now.

Also update isInsideFlatpak() for consistency.

* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::isInsideFlatpak):
(WebKit::isInsideSnap):
(WebKit::ProcessLauncher::launchProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (249568 => 249569)


--- trunk/Source/WebKit/ChangeLog	2019-09-06 08:51:26 UTC (rev 249568)
+++ trunk/Source/WebKit/ChangeLog	2019-09-06 09:00:04 UTC (rev 249569)
@@ -1,3 +1,20 @@
+2019-09-06  Patrick Griffis  <[email protected]>
+
+        [GTK][WPE] Do not enable the sandbox in Snap
+        https://bugs.webkit.org/show_bug.cgi?id=201486
+
+        Reviewed by Carlos Garcia Campos.
+
+        Running inside of Snap adds its own complications and is simply
+        not supported for now.
+
+        Also update isInsideFlatpak() for consistency.
+
+        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
+        (WebKit::isInsideFlatpak):
+        (WebKit::isInsideSnap):
+        (WebKit::ProcessLauncher::launchProcess):
+
 2019-09-05  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Crashes when intercept response is a 404

Modified: trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp (249568 => 249569)


--- trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-06 08:51:26 UTC (rev 249568)
+++ trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-06 09:00:04 UTC (rev 249569)
@@ -52,13 +52,23 @@
 #if ENABLE(BUBBLEWRAP_SANDBOX)
 static bool isInsideFlatpak()
 {
-    static int ret = -1;
-    if (ret != -1)
-        return ret;
+    static Optional<bool> ret;
+    if (ret)
+        return *ret;
 
     ret = g_file_test("/.flatpak-info", G_FILE_TEST_EXISTS);
-    return ret;
+    return *ret;
 }
+
+static bool isInsideSnap()
+{
+    static Optional<bool> ret;
+    if (ret)
+        return *ret;
+
+    ret = g_getenv("SNAP");
+    return *ret;
+}
 #endif
 
 void ProcessLauncher::launchProcess()
@@ -137,7 +147,8 @@
         sandboxEnabled = !strcmp(sandboxEnv, "1");
 
     // You cannot use bubblewrap within Flatpak so lets ensure it never happens.
-    if (sandboxEnabled && !isInsideFlatpak())
+    // Snap can allow it but has its own limitations that require workarounds.
+    if (sandboxEnabled && !isInsideFlatpak() && !isInsideSnap())
         process = bubblewrapSpawn(launcher.get(), m_launchOptions, argv, &error.outPtr());
     else
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to