Open Bug 1868956 Opened 8 months ago Updated 4 months ago

Cannot open attachment with Firefox or Libreoffice (Linux)

Categories

(Thunderbird :: Untriaged, defect)

Thunderbird 115
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: marco.contenti, Unassigned)

References

Details

Attachments

(1 obsolete file)

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

Steps to reproduce:

Observed on Ubuntu 22.04.3 LTS - standard installation - only after upgrade to Thunderbird 115.
Steps:

  1. Select a message with an attachment with a type suitable for Firefox (e.g. XML or HTML) or Libreoffice (document type)
  2. Double-click on the attachment
  3. Select open with Firefox (or Libreoffice respectively)

Actual results:

Program shows error "cannot find file" /tmp/pid-<TB's pid>/<filename>
Saving the attachment file and then opening it with same application works instead.

Expected results:

Program shows attachment file content.

Same thing happens with Chromium.
Actually Libreoffice, Firefox, Chromium and maybe other programs cannot access files temporarily saved by Thunderbird in /tmp/<pid>/
The error is ERR_FILE_NOT_FOUND but I guess it's a permission issue, since the file is there and I can cat its content or open it with gedit

I think this is not a Thunderbird issue.
AFAIKT it's because Firefox is run a a snap on Ubuntu and has limitations to to that...
In Firefox if you go to File | Open file and find the same file, it will open. It's just not "allowed" somehow.
Its' the same if you from command line firefox /path/to/file

(In reply to Magnus Melin [:mkmelin] from comment #2)

I think this is not a Thunderbird issue.
AFAIKT it's because Firefox is run a a snap on Ubuntu and has limitations to to that...

  1. I first noticed this probelm after upgrade to Thunderbird 115 - I upgraded Ubuntu to 22.04 several months before and had no problems with Thunderbird before 115, so hardly an Ubuntu issue.
  2. Firefox is installed by snap but Libreoffice is installed as a normal package.
  3. If Ubuntu implements a security policy, I think Mozilla should comply with it to be compatible, or give the Ubuntu team a valid reason to change it.

In Firefox if you go to File | Open file and find the same file, it will open. It's just not "allowed" somehow.
Its' the same if you from command line firefox /path/to/file
No, it won't open (both ways), unless you saved the file to another location.
Doing chmod 777 doesn't change the situation, so it must be some security setting beyond ordinary file permission.
I'm a developer but not so expert about the topic. Googling about the issues I found out that, IIUC, files under /tmp have a "sticky" attribute preventing access from other processes. Despite this the shell and programs like gedit and evince can access such files.

(In reply to Magnus Melin [:mkmelin] from comment #2)

I think this is not a Thunderbird issue.
AFAIKT it's because Firefox is run a a snap on Ubuntu and has limitations to to that...
In Firefox if you go to File | Open file and find the same file, it will open. It's just not "allowed" somehow.
Its' the same if you from command line firefox /path/to/file

Sorry, I just realized Libreoffice is now installed by snap, it used to be a package and I mistakenly thought it still is, since it's reported as installed by the package manager.
Looking at running processes it turns out Thunderbird has "unconfined" security context, while Firefox and Libreoffice have their own "snap..." security context, so this may be the cause indeed.

Doing more focused search I found this Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1790608
saying the exact same thing I am reporting.
So it turns out that the tmp directory is meant to be private to each snap application, while Thunderbird (since 115?) is using it to pass files to other applications. This is clearly contradictory: Thunderbird and Ubuntu teams should find an agreement about this.

Attachment #9384981 - Attachment is obsolete: true

(In reply to keunes from comment #7)

Related: https://forum.snapcraft.io/t/opening-the-attachments-with-snap/9862/6

Not strictly related, sorry. (Also about attachments, but that's about an issue in Thunderbird's snap while this is about LibreOffice/Firefox' snap.) Can't edit or delete, unfortunately.

My mum is also complaining about not being able to open attachments. Thunderbird is flatpak, LibreOffice snap. Latter gives an error that access to /run/user/1000/app/org.mozilla.Thunderbird/pid-2/documenttitle.docx has been denied.
Ubuntu 23.10 // Thunderbird Flatpak 115.9.0 // LibreOffice Snap 24.2.2.2

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: