Title: [250036] trunk/Source/WebKit
Revision
250036
Author
[email protected]
Date
2019-09-18 08:53:11 -0700 (Wed, 18 Sep 2019)

Log Message

[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: trunk/Source/WebKit/ChangeLog (250035 => 250036)


--- trunk/Source/WebKit/ChangeLog	2019-09-18 15:53:06 UTC (rev 250035)
+++ trunk/Source/WebKit/ChangeLog	2019-09-18 15:53:11 UTC (rev 250036)
@@ -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  Ross Kirsling  <[email protected]>
 
         Unreviewed WinCairo build fix following r249985.

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


--- trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-18 15:53:06 UTC (rev 250035)
+++ trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-18 15:53:11 UTC (rev 250036)
@@ -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;
@@ -159,9 +169,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