Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces: give priority to desktop-launch over desktop-legacy #13933

Commits on Jun 26, 2024

  1. interfaces: give priority to desktop-launch over desktop-legacy

    The interface 'desktop-legacy' (and 'unity7') specifically
    denies read access to the .desktop files, which means that any
    extension that requires it (like gnome or kde) won't be able
    to read them.
    
    Unfortunately, there are some specific cases where reading the
    .desktop files is mandatory, like when implementing the new
    Refresh Awareness specification. This specification requires
    to show the "visible name" of a snap, and its icon, and in
    order to have access to that, it is mandatory to be able to
    read the .desktop files.
    
    The 'desktop-launch' interface does include read access to the
    .desktop files. Although it is a very privileged interface, it
    is not a problem because the snaps that implement the Refresh
    Awareness specification are too, so using it to gain access to
    the .desktop files should be enough. Unfortunately, mixing it
    with 'desktop-legacy' interface (which happens when the snap
    implementing the Refresh Awareness specification also uses the
    gnome or the kde extension) results in not having access to
    the files, because the 'deny' rules set by the later have
    priority over any 'allow' rule set by the former.
    
    This PR adds a check when adding the specific .desktop rules
    in the 'desktop-legacy' interface: if the snap has a plug for
    the 'desktop-launch' interface, it won't apply the .desktop
    rules. This is not a problem, because without them, no access
    is granted by default (the rules added by 'desktop-legacy'
    allow to list the .desktop files, but not read them).
    sergio-costas committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    4e44ef0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9dbfa00 View commit details
    Browse the repository at this point in the history
  3. Fix tests

    sergio-costas committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    9a29fa7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9144760 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5d83449 View commit details
    Browse the repository at this point in the history
  6. Changes requested

    sergio-costas committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    9812cbc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7e41181 View commit details
    Browse the repository at this point in the history