Title: [249639] releases/WebKitGTK/webkit-2.26/Source/WebKit
Revision
249639
Author
carlo...@webkit.org
Date
2019-09-09 01:51:08 -0700 (Mon, 09 Sep 2019)

Log Message

Merge r249569 - [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: releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog (249638 => 249639)


--- releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog	2019-09-09 08:51:05 UTC (rev 249638)
+++ releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog	2019-09-09 08:51:08 UTC (rev 249639)
@@ -1,3 +1,20 @@
+2019-09-06  Patrick Griffis  <pgrif...@igalia.com>
+
+        [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-04  Patrick Griffis  <pgrif...@igalia.com>
 
         [WPE][GTK] Fix sandbox parsing DISPLAY on X11

Modified: releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp (249638 => 249639)


--- releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-09 08:51:05 UTC (rev 249638)
+++ releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-09 08:51:08 UTC (rev 249639)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to