diff options
Diffstat (limited to 'test3.bash')
| -rw-r--r-- | test3.bash | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test3.bash b/test3.bash new file mode 100644 index 0000000..d136732 --- /dev/null +++ b/test3.bash @@ -0,0 +1,24 @@ +#!/bin/bash + +TDIR=testdir-test3 +[[ -d testdir-test3 ]] || mkdir "$TDIR" +chmod +rwx "$TDIR" + +touch "$TDIR/rwfile" +chmod +rw "$TDIR/rwfile" +./test3-a "$TDIR/rwfile" || exit 1 +./test3-b "$TDIR/rwfile" || exit 1 +LD_PRELOAD=./libdynsymlink.so ./test3-a "$TDIR/rwfile" || exit 1 +LD_PRELOAD=./libdynsymlink.so ./test3-b "$TDIR/rwfile" || exit 1 +rm -f "$TDIR/rwfile" + +touch "$TDIR/rofile" +chmod +r "$TDIR/rofile" +chmod -w "$TDIR/rofile" +./test3-a "$TDIR/rofile" || exit 2 +./test3-b "$TDIR/rofile" && exit 2 +LD_PRELOAD=./libdynsymlink.so ./test3-a "$TDIR/rofile" || exit 2 +LD_PRELOAD=./libdynsymlink.so ./test3-b "$TDIR/rofile" || exit 2 +rm -f "$TDIR/rofile" + +rmdir "$TDIR" |
