Debian Codegraph @

tests/ansible/files/cwd_show

raw
1 #!/usr/bin/env bash
2
3 # Show permissions and identities that impact the current working directory.
4 # On macOS libc cwd() can return EACCES after su or sudo.
5 # See also
6 # - https://github.com/ansible/ansible/pull/7078
7 # - https://github.com/python/cpython/issues/115911
8
9 set -o errexit
10 set -o nounset
11 set -o pipefail
12
13 whoami
14 groups
15 pwd
16
17 d=$(pwd)
18 while [[ "$d" != "/" && -n "$d" ]]; do
19 ls -ld "$d"
20 d=$(dirname "$d")
21 done
22 ls -ld /