aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/unsafe-byname.test
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-04-08 04:47:01 +0000
committerMartin Pool <mbp@samba.org>2002-04-08 04:47:01 +0000
commitd25c0e42c72f2399b44b0c666fc823daa9874521 (patch)
treebbbec1e77d71314b9f6c603ab6e0d24863ade5ea /testsuite/unsafe-byname.test
parent0ecfbf27c3b9e01d498201e90e7d0a89a9d0a47c (diff)
downloadandroid_external_rsync-d25c0e42c72f2399b44b0c666fc823daa9874521.tar.gz
android_external_rsync-d25c0e42c72f2399b44b0c666fc823daa9874521.tar.bz2
android_external_rsync-d25c0e42c72f2399b44b0c666fc823daa9874521.zip
A test suite that calls unsafe_symlink() directly to see how it
handles different strings.
Diffstat (limited to 'testsuite/unsafe-byname.test')
-rw-r--r--testsuite/unsafe-byname.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/unsafe-byname.test b/testsuite/unsafe-byname.test
new file mode 100644
index 00000000..2c199720
--- /dev/null
+++ b/testsuite/unsafe-byname.test
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Copyright (C) 2002 by Martin Pool
+
+# Call directly into unsafe_symlink and test its handling of various filenames
+
+. $srcdir/testsuite/rsync.fns
+
+test_unsafe() {
+ result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2"
+ if [ "$result" != "$3" ]
+ then
+ test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\""
+ fi
+}
+
+set -x
+
+test_unsafe foo foo safe
+test_unsafe ../foo foo unsafe