aboutsummaryrefslogtreecommitdiff
blob: a80108b6343ded80bb330e156cad15134f7dce34 (plain)
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
#!/bin/sh
# handle targets of dangling symlinks correctly #540828
[ "${at_xfail}" = "yes" ] && exit 77 # see script-0

# this should pass
mkdir subdir
ln -s subdir/target symlink

# make sure the log is in a writable location
SANDBOX_LOG="${PWD}/subdir/log"

(
# This clobbers all existing writable paths for this one write.
SANDBOX_WRITE="${PWD}/subdir"
echo pass >symlink
)
# we should be able to write through the symlink
if [ $? -ne 0 ] ; then
	exit 1
fi

# and not gotten a sandbox violation
test ! -s "${SANDBOX_LOG}"

exit $?