No filepicker in Firefox with enforced AppArmor profile

Bug #1974449 reported by Gyorgy Kortvelyessy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Medium
Olivier Tilloy
Focal
Fix Released
Medium
Olivier Tilloy

Bug Description

# System
Ubuntu 22.04 LTS (Jammy Jellyfish) {kubuntu-ppa/backports/ubuntu jammy main | mozillateam/ppa/ubuntu/ jammy main}
Package: firefox
Version: 100.0.1+build1-0ubuntu0.22.04.1~mt1
---
# Description
I’m using Firefox stand-alone package (not the mainline Ubuntu Snap version) under KDE (native KDE filepicker) with enforced `usr.bin.firefox AppArmor` profile (included in `firefox` package) and when I try to open a file, save a screenshot or print to file, no filepicker shown.
---
# Error message
Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", […] interface="org.freedesktop.portal.FileChooser" member="OpenFile" […] destination="org.freedesktop.portal.Desktop" […])
---
# Suggested fix
Please see commit:
https://github.com/snapcore/snapd/pull/8793/files/ec7f01e8c15bf9303cfb30354470d2a7b3783f25

# Fix result
Implementing the part for `org.freedesktop.portal.Desktop` from the above commit resolves the filepicker issue.

Revision history for this message
Gyorgy Kortvelyessy (gkortvelyessy) wrote :
Revision history for this message
Gyorgy Kortvelyessy (gkortvelyessy) wrote :

Fix only for the pilepicker

Revision history for this message
Gyorgy Kortvelyessy (gkortvelyessy) wrote (last edit ):

On Thu, 19 May 2022 17:45:40 +0200 Olivier Tilloy <email address hidden> wrote:
> The portal-related changes appear to be copied from the apparmor profile
> generated by snapd, but there's more to it in the desktop interface (see
> https://github.com/snapcore/snapd/blob/master/interfaces/builtin/desktop.go=#L240).
> It looks like the "Allow access to xdg-desktop-portal and
> xdg-document-portal" section would also be needed.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "usr.bin.firefox.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Thank you for taking the time to report this bug and trying to help make Ubuntu better. However, it seems that you are not using a software package provided by the official Ubuntu repositories. Because of this the Ubuntu project can not support or fix your particular bug. Please report this bug to the provider of the software package. Thanks!

If you are interested in learning more about software repositories and Ubuntu, check https://help.ubuntu.com/community/Repositories.

Changed in firefox (Ubuntu):
status: New → Incomplete
status: Incomplete → Invalid
Revision history for this message
Olivier Tilloy (osomon) wrote :

Even though the reporter wasn't using an officially-supported package, the problem is actually valid for officially-supported packages of firefox on bionic and focal, so I'm going to update the apparmor profiles for those to address the issue.

Changed in firefox (Ubuntu Bionic):
status: New → Confirmed
assignee: nobody → Olivier Tilloy (osomon)
Changed in firefox (Ubuntu Focal):
assignee: nobody → Olivier Tilloy (osomon)
status: New → Confirmed
Changed in firefox (Ubuntu Bionic):
importance: Undecided → Medium
Changed in firefox (Ubuntu Focal):
importance: Undecided → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in firefox (Ubuntu Bionic):
status: Confirmed → Fix Committed
Changed in firefox (Ubuntu Focal):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 104.0+build3-0ubuntu0.18.04.1

---------------
firefox (104.0+build3-0ubuntu0.18.04.1) bionic; urgency=medium

  * New upstream release (104.0+build3)

firefox (104.0+build2-0ubuntu0.18.04.1) bionic; urgency=medium

  * New upstream release (104.0+build2)

firefox (104.0+build1-0ubuntu0.18.04.1) bionic; urgency=medium

  * New upstream release (104.0+build1)

  [ Olivier Tilloy ]
  * Update the apparmor profile to allow access to xdg-desktop-portal
    and xdg-document-portal (LP: #1974449)
    - debian/usr.bin.firefox.apparmor.14.10

  [ Rico Tzschichholz ]
  * Bump build-dep on nodejs(-mozilla) >= 12.22.1
    - debian/control{,.in}

 -- Olivier Tilloy <email address hidden> Fri, 19 Aug 2022 07:23:58 +0200

Changed in firefox (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 104.0+build3-0ubuntu0.20.04.1

---------------
firefox (104.0+build3-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream release (104.0+build3)

firefox (104.0+build2-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream release (104.0+build2)

firefox (104.0+build1-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream release (104.0+build1)

  [ Olivier Tilloy ]
  * Update the apparmor profile to allow access to xdg-desktop-portal
    and xdg-document-portal (LP: #1974449)
    - debian/usr.bin.firefox.apparmor.14.10

  [ Rico Tzschichholz ]
  * Bump build-dep on nodejs(-mozilla) >= 12.22.1
    - debian/control{,.in}

 -- Olivier Tilloy <email address hidden> Fri, 19 Aug 2022 07:25:17 +0200

Changed in firefox (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Gyorgy Kortvelyessy (gkortvelyessy) wrote :

Upgraded to `firefox/jammy 104.0+build2-0ubuntu0.22.04.1~mt1`
After a quick testing (removing site-specific configurations for `usr.bin.firefox` + apparmor service force-reload'ed) I can confirm that the implemented fix works for me.

Thank you all, especially thanks to Oliver Tilloy.

Changed in firefox (Ubuntu):
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.