Title: [250206] releases/WebKitGTK/webkit-2.26/Source/WebKit
Revision
250206
Author
[email protected]
Date
2019-09-23 01:21:08 -0700 (Mon, 23 Sep 2019)

Log Message

Merge r250036 - [GTK][WPE] bubblewrap sandbox should be disabled when running inside docker
https://bugs.webkit.org/show_bug.cgi?id=201914

Reviewed by Michael Catanzaro.

Detect if running inside Docker by checking the file /.dockerenv
In that case, disable the sandbox.

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

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog (250205 => 250206)


--- releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog	2019-09-23 08:21:04 UTC (rev 250205)
+++ releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog	2019-09-23 08:21:08 UTC (rev 250206)
@@ -1,3 +1,17 @@
+2019-09-18  Carlos Alberto Lopez Perez  <[email protected]>
+
+        [GTK][WPE] bubblewrap sandbox should be disabled when running inside docker
+        https://bugs.webkit.org/show_bug.cgi?id=201914
+
+        Reviewed by Michael Catanzaro.
+
+        Detect if running inside Docker by checking the file /.dockerenv
+        In that case, disable the sandbox.
+
+        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
+        (WebKit::isInsideDocker):
+        (WebKit::ProcessLauncher::launchProcess):
+
 2019-09-17  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Crash closing web view while hardware acceleration is enabled

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


--- releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-23 08:21:04 UTC (rev 250205)
+++ releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-23 08:21:08 UTC (rev 250206)
@@ -50,6 +50,16 @@
 }
 
 #if ENABLE(BUBBLEWRAP_SANDBOX)
+static bool isInsideDocker()
+{
+    static Optional<bool> ret;
+    if (ret)
+        return *ret;
+
+    ret = g_file_test("/.dockerenv", G_FILE_TEST_EXISTS);
+    return *ret;
+}
+
 static bool isInsideFlatpak()
 {
     static Optional<bool> ret;
@@ -146,9 +156,9 @@
     if (sandboxEnv)
         sandboxEnabled = !strcmp(sandboxEnv, "1");
 
-    // You cannot use bubblewrap within Flatpak so lets ensure it never happens.
+    // You cannot use bubblewrap within Flatpak or Docker so lets ensure it never happens.
     // Snap can allow it but has its own limitations that require workarounds.
-    if (sandboxEnabled && !isInsideFlatpak() && !isInsideSnap())
+    if (sandboxEnabled && !isInsideFlatpak() && !isInsideSnap() && !isInsideDocker())
         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