From the duplicate
To reproduce this issue.
1. Fetch the source code from here http://bazaar.launchpad.net/~gary-wzl77/+junk/test-hooks/files
2. snap the project
snapcraft && sudo snap install --devmode hooks_0.1_amd64.snap
3. run the following command
sudo hooks.test
5. goto ${SNAP_DATA}/hooks/current to check new folder's owner(It's an expected result)
drwxr-xr-x 2 daemon daemon 4096 3月 9 15:39 new_folder
6. disalbe and enable the snap
sudo snap disable hooks && sudo snap enable hooks
7. run the test command again
/snap/hooks/x1/bin/test: 11: /snap/hooks/x1/bin/test: chown: Permission denied
From the duplicate bazaar. launchpad. net/~gary- wzl77/+ junk/test- hooks/files 1_amd64. snap DATA}/hooks/ current to check new folder's owner(It's an expected result) hooks/x1/ bin/test: 11: /snap/hooks/ x1/bin/ test: chown: Permission denied
To reproduce this issue.
1. Fetch the source code from here
http://
2. snap the project
snapcraft && sudo snap install --devmode hooks_0.
3. run the following command
sudo hooks.test
5. goto ${SNAP_
drwxr-xr-x 2 daemon daemon 4096 3月 9 15:39 new_folder
6. disalbe and enable the snap
sudo snap disable hooks && sudo snap enable hooks
7. run the test command again
/snap/
chown syscall is allowed in devmode but forbidden in strict confinement mode at this moment due to the bug. /bugs.launchpad .net/ubuntu/ +source/ snapd/+ bug/1581310
https:/
So from the above step, devmode capability is dropped after running snap enable/disable and the snap has become a strict confinement snap.