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

Extension deletes user personal files from Music, Templates, Public, Desktop #188

Closed
popey opened this issue Dec 21, 2023 · 10 comments · Fixed by snapcore/snapcraft-desktop-integration#25

Comments

@popey
Copy link

popey commented Dec 21, 2023

The gnome extension deleted all my ~/Music ~/Public ~/Templates ~/Desktop.

I was prototyping a snap which tries to store files in $SNAP_USER_DATA/Appname, but the user expects the files to be $HOME/Appname. So I set an environment variable in the apps section of snapcraft.yaml.

Steps to reproduce

Backup your ~/Music, ~/Public, ~/Templates and ~/Desktop folders

Build a snap which has the following:

apps:
  environment:
    HOME: $SNAP_REAL_HOME

Install and run the snap.

Your ~/Music folder will be replaced with a recursive symlink to itself, deleting all the previous contents.

Expected outcome

The gnome extension should:

a) Do better checks before arbitrarily replacing files in the $HOME folder
b) Not delete user files

@soumyaDghosh
Copy link
Contributor

https://forum.snapcraft.io/t/snap-real-home-is-kinda-buggy/34463

similar issue, I posted in the forum sometimes ago

@kenvandine
Copy link
Member

@sergio-costas @jhenstridge any thoughts on how to deal with this?

@sergio-costas
Copy link
Contributor

I'll check the scripts in gnome extension...

sergio-costas added a commit to sergio-costas/snapcraft-desktop-integration that referenced this issue Mar 25, 2024
Some snaps set $HOME equal to $SNAP_REAL_HOME, which breaks
the HOME folder because the extensions scripts presumes that
$HOME points to the snap HOME. This can result in replacing
some XDG folders with a soft link to themselves, or config
data being deleted.

This patch tries to fix this.

Fix ubuntu/gnome-sdk#188
@sergio-costas
Copy link
Contributor

@kenvandine I think that this patch should fix it... snapcore/snapcraft-desktop-integration#25

@sergio-costas
Copy link
Contributor

I'll try to test it in a VM...

@kenvandine
Copy link
Member

@kenvandine I think that this patch should fix it... snapcore/snapcraft-desktop-integration#25

I think that would fix it. My initial reaction to this approach was that it would not create the necessary bookmarks, but actually in this use case we don't need to create those at all.

@sergio-costas
Copy link
Contributor

Tested, and it works.

@kenvandine
Copy link
Member

This fix is in the candidate channel of gnome-42-2204 now

@popey
Copy link
Author

popey commented Mar 27, 2024

(I'm not convinced this should be "closed" until it's in stable, but that's your decision. 😇

I tested this via the following method:

  • Installed Kubuntu 22.04 in a VM
  • Confirm home directories are intact

image

  • snap refresh gnome-42-2204 --candidate
  • snap install dosbox-staging
  • snap run dosbox-staging
  • Confirm home directories are still intact
  • snap remove --purge dosbox-staging
  • rm -rf ~/snap/dosbox-staging
  • snap refresh gnome-42-2204 --stable
  • snap install dosbox-staging
  • snap run dosbox-staging
  • Confirm home folders become symlinks to themselves.

image

I believe this confirms the issue is fixed in the candidate channel, and certainly still broken in the stable channel.

@Recydywa
Copy link

Recydywa commented Apr 2, 2024

Not sure, if it adds anything, seeing the issue is closed, but I can also confirm that running dosbox-staging in combination with gnome-42-2204 from candidate channel resolves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants