[Webkit-unassigned] [Bug 231670] [GLIB] Simplify SleepDisabler by checking if we are under sandbox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 16 01:32:15 PDT 2021


--- Comment #9 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Michael Catanzaro from comment #8)
> Comment on attachment 441063 [details]
> Patch
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=441063&action=review
> >>> Source/WTF/wtf/glib/Sandbox.cpp:35
> >>> +    return g_file_test("/.flatpak-info", G_FILE_TEST_EXISTS);
> >> 
> >> Hm, it sould test for snap too, since we should also generally use portals when running under snap. But not under docker, since portals do not expect to be used from docker, even though docker is also a sandbox.
> >> 
> >> I think I would move isInsideDocker, isInsideFlatpak, and isInsideSnap to here from ProcessLauncherGLib.cpp, then rename shouldUsePortal to mustUseDesktopPortal, and have it check isInsideFlatpak || isInsideSnap, but not isInsideDocker.
> > 
> > 
> Anyway, you've convinced me on everything else, but still need to fix
> isRunningInSandbox. At minimum, test for snap as well. But probably better
> to delete it and just directly call isInsideFlatpak/isInsideSnap from
> shouldUsePortal, and not have isRunningInSandbox at all.
> Definitely do not implement isInsideFlatpak using isRunningInSandbox.

isInsideFlatpak is not exactly the same in this case, that caches the result and it's used by the process launcher to see if we are already under flatpak. If we are not under flatpak false will be cached, but then the bubblewrap launcher will create the flatpak-info, but isInsideFlatpak will return false. That's why isInsideSandbox doesn't cache the result.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211016/9356d2e5/attachment.htm>

More information about the webkit-unassigned mailing list