Incorrect Downloads directory for LDAP user in snapped firefox & chromium

Bug #2025447 reported by Dariusz Gadomski
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned
snapd
New
Undecided
Unassigned
chromium (Ubuntu)
Confirmed
Undecided
Unassigned
firefox (Ubuntu)
Confirmed
Undecided
Unassigned
snapd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Test procedure:
1. Log in to Gnome as a Active Directory user.
2. Launch browser (firefox or chrome) - make sure there's no existing config (we are interested in the default Downloads location).
3. Download a file via the browser.
4. Check where it was downloaded.

Expected result:
The files are downloaded to ~/Downloads (or a translated equivalent).

Actual result:
The files are downloaded to:
~/snap/firefox/common/Downloads
~/snap/chromium/current/Downloads

For local users the behavior is as expected (all files are downloaded to ~/Downloads).

This is very inconvenient for enterprise environments where manual setting modification is needed on every host.

This has been tested on 22.04 with the following versions:
- firefox (116.0.3 Mozilla Firefox Snap for Ubuntu canonical-002 - 1.0)
- chromium (Version 116.0.5845.110 (Official Build) snap (64-bit))
- snapd 2.58+22.04.1

[1] https://ubuntu.com/server/docs/service-sssd-ad

Tags: se
description: updated
description: updated
description: updated
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

I have been looking into this issue and I've noticed that in snap/command-chain/desktop-launch line 39 cases the issue:

REALHOME=$(getent passwd $UID | cut -d ':' -f 6)

Inside the snap getent passwd $UID returns an empty string for the AD/LDAP user.

Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

Simply replacing the line above with:
REALHOME=${SNAP_REAL_HOME}
makes the issue go away.

I'm not sure what was the purpose of the getent call, but clearly it has problems with accessing the passwd database inside the snap sandbox.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

The getent implementation pre-dates the existence of SNAP_REAL_HOME. We can probably leverage that.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in chromium (Ubuntu):
status: New → Confirmed
Changed in firefox (Ubuntu):
status: New → Confirmed
Changed in snapd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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