1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
summary: directories created by snap-confine are immune from umask
details: |
The setting of umask is inherited across the snap-{run,confine,exec} chain
but does not hinder execution of snap-confine itself.
prepare: |
"$TESTSTOOLS"/snaps-state install-local test-snapd-sh
restore: |
snap remove test-snapd-sh
rm -rf ~/snap
execute: |
# See if umask 777 is respected.
( umask 777 && test-snapd-sh.sh -c /bin/true )
# shellcheck disable=SC2016
( umask 777 && test-snapd-sh.sh -c 'touch "$SNAP_USER_COMMON"/canary' )
test "$(stat -c %a "$HOME"/snap/test-snapd-sh/common/canary)" = 0
rm -rf ~/snap
# See if umask 000 is respected.
( umask 000 && test-snapd-sh.sh -c /bin/true )
# shellcheck disable=SC2016
( umask 000 && test-snapd-sh.sh -c 'touch "$SNAP_USER_COMMON"/canary' )
test "$(stat -c %a "$HOME"/snap/test-snapd-sh/common/canary)" = 666
|