diff options
author | Martin Pool <mbp@samba.org> | 2002-04-08 04:47:01 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2002-04-08 04:47:01 +0000 |
commit | d25c0e42c72f2399b44b0c666fc823daa9874521 (patch) | |
tree | bbbec1e77d71314b9f6c603ab6e0d24863ade5ea /testsuite/unsafe-byname.test | |
parent | 0ecfbf27c3b9e01d498201e90e7d0a89a9d0a47c (diff) | |
download | android_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.test | 20 |
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 |