Closed Bug 1770462 Opened 4 years ago Closed 4 years ago

Firefox snap can't open html files outside of /home

Categories

(Core :: Widget: Gtk, defect)

Firefox 100
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: thomasnak, Assigned: gerard-majax)

References

(Blocks 1 open bug, )

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0

Steps to reproduce:

Kubuntu 22.04, using the default Firefox snap installation, set as the default browser.

Try using the "help" functionality in, for example, Gimp (or any other program that uses a html help file stored in /usr/share), with Firefox set as the default browser.

Actual results:

The following error message appears: Firefox can’t find the file at /usr/share/gimp/2.0/help/en/index.html

The file is there, but Firefox can't find it. Presumably due to snappy sandboxing behaviour, Firefox seems to be unable to access any file outside of /home.

Expected results:

It should be able to display these help files.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: snap
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Component: Widget: Gtk → General
Product: Core → Firefox
Component: General → Widget: Gtk
Product: Firefox → Core

I can confirm that uninstalling the Firefox snap then installing as --devmode (disabling FS sandbox) helps. I'm wondering how much we can help there.

Assignee: nobody → lissyx+mozillians

Oh, gimp places its docs in /usr/share/gimp and the system-package-doc grants access to /usr/share/doc.
Obviously, we could grant specific access via system-files but this might be a can of worm.

Olivier, how should that kind of usecase be handled ?

Flags: needinfo?(olivier)

cups also seems to install its doc in /usr/share/cups/doc-root

This would require an update to the system-packages-doc interface, similar to https://github.com/snapcore/snapd/pull/11588. But this is indeed opening a can of worms, and I'm not sure the snapd team would be happy with this approach. It's worth discussing in any case, and a good way to initiate the discussion is to open a PR.

Note that there is a currently open PR to broaden the set of doc packages that the interface will allow reading (https://github.com/snapcore/snapd/pull/11699), but it wouldn't help in this specific case.

Flags: needinfo?(olivier)

PR has been r+, so now it's probably just a matter of:

  • CLA signing
  • green tests
  • merging

I'll mark the bug as RESOLVED:FIXED when it is merged.

Thank you for getting on this so quickly!

There are probably a lot more of these, though. A more minor example I ran into recently is Simon Tatham's Portable Puzzle Collection. These puzzle games all have help files located in usr/share/sgt-puzzles/help/ (at least, when installed from the default Ubuntu repo's), which means these help files don't work on a Ubuntu 22.04 installation with Firefox Snap as the default browser. Is some sort of more general solution unfeasible?

(In reply to thomasnak from comment #7)

Thank you for getting on this so quickly!

There are probably a lot more of these, though. A more minor example I ran into recently is Simon Tatham's Portable Puzzle Collection. These puzzle games all have help files located in usr/share/sgt-puzzles/help/ (at least, when installed from the default Ubuntu repo's), which means these help files don't work on a Ubuntu 22.04 installation with Firefox Snap as the default browser. Is some sort of more general solution unfeasible?

That's something outside of my scope, unfortunately, you need to take that to either snapd / ubuntu packagers

This specific issue is fixed upstream

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.