ubuntu / gnome-sdk

GNOME SDK/Platform snap
22 stars 21 forks source link

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

Closed popey closed 5 months ago

popey commented 8 months ago

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 commented 7 months ago

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

similar issue, I posted in the forum sometimes ago

kenvandine commented 5 months ago

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

sergio-costas commented 5 months ago

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

sergio-costas commented 5 months ago

@kenvandine I think that this patch should fix it... https://github.com/snapcore/snapcraft-desktop-integration/pull/25

sergio-costas commented 5 months ago

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

kenvandine commented 5 months ago

@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 commented 5 months ago

Tested, and it works.

kenvandine commented 5 months ago

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

popey commented 5 months ago

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

I tested this via the following method:

image

image

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

Recydywa commented 5 months ago

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.