Title: [249882] trunk/Source/WebKit
Revision
249882
Author
[email protected]
Date
2019-09-14 15:45:30 -0700 (Sat, 14 Sep 2019)

Log Message

[GTK][WPE] Check for a Snap sandbox a bit harder
https://bugs.webkit.org/show_bug.cgi?id=201793

Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION
environment variables are defined as well.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (249881 => 249882)


--- trunk/Source/WebKit/ChangeLog	2019-09-14 22:31:02 UTC (rev 249881)
+++ trunk/Source/WebKit/ChangeLog	2019-09-14 22:45:30 UTC (rev 249882)
@@ -1,3 +1,14 @@
+2019-09-14  Adrian Perez de Castro  <[email protected]>
+
+        [GTK][WPE] Check for a Snap sandbox a bit harder
+        https://bugs.webkit.org/show_bug.cgi?id=201793
+
+        Reviewed by Michael Catanzaro.
+
+        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
+        (WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION
+        environment variables are defined as well.
+
 2019-09-14  Youenn Fablet  <[email protected]>
 
         Add release logging in WebLoaderStrategy to check that a load is going through service worker

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


--- trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-14 22:31:02 UTC (rev 249881)
+++ trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2019-09-14 22:45:30 UTC (rev 249882)
@@ -66,7 +66,10 @@
     if (ret)
         return *ret;
 
-    ret = g_getenv("SNAP");
+    // The "SNAP" environment variable is not unlikely to be set for/by something other
+    // than Snap, so check a couple of additional variables to avoid false positives.
+    // See: https://snapcraft.io/docs/environment-variables
+    ret = g_getenv("SNAP") && g_getenv("SNAP_NAME") && g_getenv("SNAP_REVISION");
     return *ret;
 }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to