Add more test cases.
[rsync/rsync.git] / testsuite / unsafe-byname.test
CommitLineData
d25c0e42
MP
1#! /bin/sh
2
3# Copyright (C) 2002 by Martin Pool
4
5# Call directly into unsafe_symlink and test its handling of various filenames
6
7. $srcdir/testsuite/rsync.fns
8
9test_unsafe() {
10 result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2"
11 if [ "$result" != "$3" ]
12 then
13 test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\""
14 fi
15}
16
17set -x
18
c81a32f0
MP
19test_unsafe file from safe
20test_unsafe dir/file from safe
21test_unsafe dir/./file from safe
22test_unsafe dir/. from safe
23test_unsafe dir/ from safe
24
25test_unsafe /etc/passwd from unsafe
26test_unsafe //../etc/passwd from unsafe
27test_unsafe //./etc/passwd from unsafe
28
29test_unsafe ./foo from safe
30test_unsafe ../foo from unsafe
31test_unsafe ../dest from/dir safe
32
33