blob: 96395f5152601ea81729edc13ba448e9400a9191 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
# A script that cannot be read is an error, not an empty script.
"$TSH" /nonexistent/x >/dev/null 2>&1; echo "missing $?"
"$TSH" /nonexistent/x >/dev/null 2>msg; cat msg
"$TSH" /tmp >/dev/null 2>&1; echo "dir $?"
"$TSH" /tmp >/dev/null 2>msg; cat msg
# root can read anything; only test the permission denied case as a user.
if [ "$(id -u)" != 0 ]; then
echo 'echo hi' >unreadable.sh
chmod 000 unreadable.sh
"$TSH" unreadable.sh >/dev/null 2>&1; echo "unreadable $?"
chmod 644 unreadable.sh
fi
|