Closed Bug 1925353 Opened 5 months ago Closed 13 days ago

[snap only] thunderbird.tmp outside of proper place for temporary files (in user Downloads)

Categories

(Thunderbird :: OS Integration, defect, P3)

Thunderbird 128
Unspecified
Linux

Tracking

(thunderbird_esr128 affected)

RESOLVED WONTFIX
Tracking Status
thunderbird_esr128 --- affected

People

(Reporter: nobodyman665, Assigned: dandarnell)

References

Details

(Keywords: snap)

Attachments

(1 file, 1 obsolete file)

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

Steps to reproduce:

Install fresh Ubuntu 24.10 x64 .
sudo apt-get install thunderbird
Y
wait until ready
run Thunderbird
Look for inappropriate files in $HOME/Downloads

Actual results:

thunderbird.tmp is present in $HOME/Downloads .
thunderbird.tmp reappears after deleting it manually after each Thunderbird (ver. 128.3.1esr (64-bit) , by the way) launch.
thunderbird.tmp is not present in whichever place is appropriate for Mozilla Thunderbird's .tmp files.

Expected results:

$HOME/Downloads contains user's downloads.
Whatever utility folder Thunderbird uses contains thunderbird.tmp .
User downloads and thunderbird.tmp do not mix.

I am also seeing this with 128.3.1esr on Ubuntu 24.4.

https://searchfox.org/comm-central/rev/d848039720bedf2c2b5f7ba8f37b2c670e38b605/taskcluster/docker/tb-snap/tmpdir.sh#4 does that, but indeed that does not seem appropriate. I don't know why the normal temp dir isn't used.

Status: UNCONFIRMED → NEW
Component: Untriaged → OS Integration
Ever confirmed: true
Flags: needinfo?(daniel)
OS: Unspecified → Linux
Summary: thunderbird.tmp outside of proper place for temporary files (in user Downloads) → [snap only] thunderbird.tmp outside of proper place for temporary files (in user Downloads)

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

https://searchfox.org/comm-central/rev/d848039720bedf2c2b5f7ba8f37b2c670e38b605/taskcluster/docker/tb-snap/tmpdir.sh#4 does that, but indeed that does not seem appropriate. I don't know why the normal temp dir isn't used.

Because /tmp is a private mount in snaps and not shared with the system

What is the right choice then?

Same with snapd version of Firefox - $XDG_CACHE_HOME ?
https://github.com/mozilla/gecko-dev/blob/ec82d34b786f309f9901efe989d59cb55bd61cf0/taskcluster/docker/firefox-flatpak/launch-script.sh#L2
Works to me, does not cause any unexpected things with very similarly fresh install of Firefox, stores files in expected place, does not mix with user files.

Can't edit my own comments. Read "snapd" as "pre-packed".

Assignee: nobody → daniel
Status: NEW → ASSIGNED
Attachment #9433065 - Attachment description: Bug 1925353 - Fix temporary directory in Thunderbird snap. r=#thunderbuild → Bug 1925353 - Change tmpdir to use user's cache directory. r=#thunderbuild
Flags: needinfo?(daniel)

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

https://searchfox.org/comm-central/rev/d848039720bedf2c2b5f7ba8f37b2c670e38b605/taskcluster/docker/tb-snap/tmpdir.sh#4 does that, but indeed that does not seem appropriate. I don't know why the normal temp dir isn't used.

This particular link is to our internal snap build for testing, not the one that is pushed to the snap store. The snap store version is on GitHub.

(In reply to Aliaksandr from comment #6)

Same with snapd version of Firefox - $XDG_CACHE_HOME ?
https://github.com/mozilla/gecko-dev/blob/ec82d34b786f309f9901efe989d59cb55bd61cf0/taskcluster/docker/firefox-flatpak/launch-script.sh#L2
Works to me, does not cause any unexpected things with very similarly fresh install of Firefox, stores files in expected place, does not mix with user files.

This is actually from the Firefox Flatpak, not the Firefox Snap. The Flatpak is able to access the standard tmp directory without any extra permissions.

There is currently an open GitHub issue concerning the TMPDIR issue.

Attachment #9433065 - Attachment is obsolete: true

I as mere user don't see much of a difference.
I as mere user also don't see what are my options to get rid of this junk in least amount of actions with least amount of consequences.
Rollback to pre-snapd-being-mandatory was an option back in 24.04 days. And here and now I'm... a bit too busy and a bit too unskilled to go on a voyage of apt usage and repo linkage just to get rid of one pesky folder. Was unable to set up non-snapd official version of Thunderbirs by usual means.

Severity: -- → S3
Keywords: snap
Priority: -- → P3

Unfortunately, this bug is outside the scope of what we can do. Snaps cannot access the user's temp directory without a major increase in filesystem permissions. The Firefox snap actually handles this problem the same way we do, putting the temp directory in ~/Downloads. [1]

This quirk is a side effect of snaps being sandboxed, and allowing the use of TMPDIR by the Thunderbird snap would break the sandbox. The best place I've found to follow movement on the issue is the GitHub bug I linked in comment 9. [2]

If Canonical adds scoped filesystem permissions (or some other sandboxed mechanism) to access TMPDIR, we can definitely add the option to let the user map the temp directory, or just default to TMPDIR. However, given the current design of snap's sandbox, we cannot add this. I'm closing this bug for now, but will reopen it if the situation changes.

[1] https://forum.snapcraft.io/t/accessing-tmp-from-snaps/22384

[2] https://github.com/ubuntu/thunderbird/issues/3

Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → WONTFIX

The snap cannot write to /tmp because of snap confinement and the thunderbird.tmp has to go somewhere. ~/Downloads is currently the location but https://github.com/ubuntu/thunderbird/pull/29 allows you to overwrite that location, as long as it's still somewhere in $HOME so that the snap still has access to the location.

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

Attachment

General

Creator:
Created:
Updated:
Size: