Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect env set by desktop-launch for AD users #4348

Closed
dargad opened this issue Sep 5, 2023 · 5 comments · Fixed by canonical/snapcraft-desktop-integration#16
Closed
Assignees
Labels
bug Actual bad behavior that don't fall into maintenance or documentation

Comments

@dargad
Copy link

dargad commented Sep 5, 2023

Bug Description

When the logged in user comes from AD the getent call returns an empty string making the REALHOME var having an incorrect value.

This makes some apps (e.g. snapped browsers like Firefox and Chromium) to incorrectly set their home under ~/snap//... instead of /home/. This nests directories like Downloads unnecessarily deep.

More details in LP: #2025447.

I've experimented with setting REALHOME to ${SNAP_REAL_HOME} with good results, but maybe the getent call has some other intended implications that I am not aware of.

To Reproduce

  1. Log in to Gnome as an 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.

Environment

Up to date Ubuntu 22.04.3 connected to AD according to this tutorial.

snapcraft.yaml

Reproducible with firefox and chromium available from the snap store.

- 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

Relevant log output

Default download dir is:
~/snap/firefox/common/Downloads
~/snap/chromium/current/Downloads

Additional context

No response

@dargad dargad added the bug Actual bad behavior that don't fall into maintenance or documentation label Sep 5, 2023
@kenvandine
Copy link
Contributor

@sergio-costas can you please take a look at this? Our use of REALHOME predated the existence of SNAP_REAL_HOME. I suspect we can just replace REALHOME with SNAP_REAL_HOME, but that requires some testing to ensure it doesn't regress.

@sergio-costas
Copy link
Contributor

@kenvandine I'm on it.

@sergio-costas
Copy link
Contributor

@dargad We prepared a patched snap. Can you test it? To install it, just run in a terminal

sudo snap refresh gnome-42-2204 --channel=latest/stable/ad-fix

and to revert to the stable one, just run

sudo snap refresh gnome-42-2204 --channel=latest/stable

@dargad
Copy link
Author

dargad commented Sep 6, 2023

Thank you @sergio-costas. I have just tested it and can confirm that REALHOME is set correctly with gnome from the latest/stable/ad-fix channel.
This results in both: Firefox and Chromium downloading files to ~/Downloads by default.

@sergio-costas
Copy link
Contributor

Good news, then. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants