Restrictive umask creates unusable snaps
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapcraft (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
OS
Ubuntu Focal Fossa 20.04
Snapcraft Version
snapcraft, version 4.1.3
Contrary to the status of https:/
In general, I set my umask to 027 on my systems. When `snapcraft init` is run, it creates ./snap/ and ./snap/
cannot snap-exec: cannot exec "/snap/
The current workaround is to fix the permissions of ./snap and ./snap/
Below is a terminal session that demonstrates the issue:
[testuser@test ~/test1]$ umask
0027
[testuser@test ~/test1]$ snapcraft init
Created snap/snapcraft.
Go to https:/
[testuser@test ~/test1]$ cp $HOME/test/
[testuser@test ~/test1]$ cp $HOME/test/
[testuser@test ~/test1]$ ls -la .
total 16
drwxr-x--- 3 testuser testuser 4096 Aug 5 11:44 ./
drwxrwx--- 12 testuser testuser 4096 Aug 5 11:42 ../
drwxr-x--- 2 testuser testuser 4096 Aug 5 11:44 snap/
-rwxr-x--- 1 testuser testuser 26 Aug 5 11:44 testme.sh*
[testuser@test ~/test1]$ ls -la snap/
total 12
drwxr-x--- 2 testuser testuser 4096 Aug 5 11:44 ./
drwxr-x--- 3 testuser testuser 4096 Aug 5 11:44 ../
-rw-r----- 1 testuser testuser 803 Aug 5 11:44 snapcraft.yaml
[testuser@test ~/test1]$ chmod 755 testme.sh
[testuser@test ~/test1]$ snapcraft
...
Snapped testme_
[testuser@test ~/test1]$ sudo snap install --dangerous testme_
testme 0.1 installed
[testuser@test ~/test1]$ testme
cannot snap-exec: cannot exec "/snap/
[testuser@test ~/test1]$ ls -la /snap/testme/x1/
total 5
drwxr-xr-x 4 root root 56 Aug 5 11:53 ./
drwxr-xr-x 4 root root 4096 Aug 5 11:54 ../
drwxr-xr-x 2 root root 32 Aug 5 11:53 meta/
drwxr-x--- 3 root root 36 Aug 5 11:53 snap/
-rwxr-xr-x 1 root root 26 Aug 5 11:44 testme.sh*
[testuser@test ~/test1]$ unsquashfs testme_
Parallel unsquashfs: Using 12 processors
3 inodes (3 blocks) to write
[======
created 3 files
created 4 directories
created 0 symlinks
created 0 devices
created 0 fifos
[testuser@test ~/test1]$ ls -la squashfs-root/
total 20
drwxr-xr-x 4 testuser testuser 4096 Aug 5 11:53 ./
drwxr-x--- 4 testuser testuser 4096 Aug 5 11:54 ../
drwxr-xr-x 2 testuser testuser 4096 Aug 5 11:53 meta/
drwxr-x--- 3 testuser testuser 4096 Aug 5 11:53 snap/
-rwxr-x--- 1 testuser testuser 26 Aug 5 11:44 testme.sh*
[testuser@test ~/test1]$