Restrict screenshot D-Bus access to portal - #2940
Open
Sean-StarLabs wants to merge 2 commits into
Open
Sean-StarLabs wants to merge 2 commits into
Sean-StarLabs wants to merge 2 commits into
Conversation
org.gnome.Shell.Screenshot is currently available to any session bus client. Check that the caller owns the Pantheon portal backend name, while keeping keyboard shortcuts on private methods. Test=Direct D-Bus calls returned AccessDenied; portal and keyboard shortcut captures still produced PNGs in a Pantheon Wayland session.
leolost2605
requested changes
Sep 30, 2026
leolost2605
left a comment
Member
There was a problem hiding this comment.
We also need an exception for the screenshot app https://github.com/elementary/screenshot which usually uses the portal but it does directly call the gala interface for when a non interactive screenshot is taken (which I think is only possible via the desktop actions).
Also this should probably all be async just to be safe
Apart from that LGTM thanks :)
The Screenshot app uses Gala directly for its desktop actions. Allow its current bus owner alongside the portal backend, including when the other service is not running. Make the proxy and name-owner lookups asynchronous, including FlashArea, so caller checks do not block the compositor.
Sean-StarLabs
force-pushed
the
restrict-screenshot-portal
branch
from
October 1, 2026 13:57
ea96c8c to
82e720c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Any client on the session bus can currently call
org.gnome.Shell.Screenshotdirectly, bypassing the screenshot portal. Restrict the exported methods to the Pantheon portal backend and Screenshot app, while keeping keyboard shortcuts on private paths. Make caller checks asynchronous.The Screenshot exception preserves its whole-screen, window and area desktop actions.
Testing
The original revision was tested in a Fedora 44 Pantheon Wayland session: unrelated direct calls returned
AccessDenied, portal deny/allow worked, and the Print shortcut produced a screenshot.