Comment 277 for bug 1575053

Revision history for this message
Kevin Dong (kevin-dong-nai-jia) wrote :

For whom does not care about multi users and backward compatibility, this is actually quite straightforward to change the snap directory from '$HOME/snap' to '$HOME/.snap'. Changing the hard-coded path and the AppArmor rule is fairly enough for release 2.46:

diff --git a/dirs/dirs.go b/dirs/dirs.go
index 2986ef371a..ea37ad195e 100644
--- a/dirs/dirs.go
+++ b/dirs/dirs.go
@@ -136 +136 @@ const (
- UserHomeSnapDir = "snap"
+ UserHomeSnapDir = ".snap"
diff --git a/cmd/snap-confine/snap-confine.apparmor.in b/cmd/snap-confine/snap-confine.apparmor.in
index 8b53423ca0..cde82139b5 100644
--- a/cmd/snap-confine/snap-confine.apparmor.in
+++ b/cmd/snap-confine/snap-confine.apparmor.in
@@ -346 +346 @@
- @{HOME}/snap/{,*/,*/*/} rw,
+ @{HOME}/.snap/{,*/,*/*/} rw,