snapd icon indicating copy to clipboard operation
snapd copied to clipboard

tests: add check that removal of snaps works with user data

Open NucciTheBoss opened this issue 1 year ago • 4 comments

Test adds check to see if https://bugs.launchpad.net/snapd/+bug/2002697 is easily reproducible when using home directories exported via NFSv3 or NFSv4.

This issue is easily reproducible on HPC deployments where NFS is used as the shared filesystem for exporting data across the cluster. Snaps can be installed and used by "remote users" - defined in LDAP and not in /etc/passwd - but they cannot be refreshed an/or removed when root_squash is enabled as snapshotting SNAP_USER_DATA and SNAP_USER_COMMON is disallowed by the filesystem.

NucciTheBoss avatar Jun 05 '24 17:06 NucciTheBoss

@zyga the test is showing a real issue, is it not?

bboozzoo avatar Jun 07 '24 06:06 bboozzoo

@zyga the test is showing a real issue, is it not?

Yes. I discussed this on the chat and suggested opening this PR to show what is broken.

zyga avatar Jun 07 '24 06:06 zyga

@zyga the test is showing a real issue, is it not?

Yes, the test is meant to show that you cannot remove snaps when user /home directories are exported as an NFS share, specifically when root_squash is enabled as an export option for the NFS share. NFS will "anonymize" (reassign root to a different configured uid and gid) the uid and gid of the snapd process when snapd goes to snapshot SNAP_USER_DATA and SNAP_USER_COMMON in the users' home directory. Since snapd no longer has permission to perform operations within user home directories, it fails to remove or refresh the snap.

NucciTheBoss avatar Jun 07 '24 14:06 NucciTheBoss

I think we can explore fixing this after we're done with our roadmap tasks. In real terms it might land in Ubuntu by the end of the year.

zyga avatar Sep 09 '24 07:09 zyga

@zyga Any news ? This has been a nasty bug for Firefox users for the last three years and I know it blocked deployment in some places.

lissyx avatar Apr 02 '25 14:04 lissyx