X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4eea7793ea7f3a2b336aa68dc778ce7f9ee5cdbb..0f6b683c8ebf2a26988909c46a31543a5fb17302:/testsuite/unsafe-byname.test diff --git a/testsuite/unsafe-byname.test b/testsuite/unsafe-byname.test index 47809dcb..69b338f6 100644 --- a/testsuite/unsafe-byname.test +++ b/testsuite/unsafe-byname.test @@ -4,7 +4,7 @@ # Call directly into unsafe_symlink and test its handling of various filenames -. $srcdir/testsuite/rsync.fns +. "$suitedir/rsync.fns" test_unsafe() { # $1 is the target of a symlink @@ -19,37 +19,41 @@ test_unsafe() { fi } -test_unsafe file from safe -test_unsafe dir/file from safe -test_unsafe dir/./file from safe -test_unsafe dir/. from safe -test_unsafe dir/ from safe - -test_unsafe /etc/passwd from unsafe -test_unsafe //../etc/passwd from unsafe -test_unsafe //./etc/passwd from unsafe - -test_unsafe ./foo from safe -test_unsafe ../foo from unsafe -test_unsafe ../dest from/dir safe - -test_unsafe '' from unsafe +test_unsafe file from safe +test_unsafe dir/file from safe +test_unsafe dir/./file from safe +test_unsafe dir/. from safe +test_unsafe dir/ from safe + +test_unsafe /etc/passwd from unsafe +test_unsafe //../etc/passwd from unsafe +test_unsafe //./etc/passwd from unsafe + +test_unsafe ./foo from safe +test_unsafe ../foo from unsafe +test_unsafe ./../foo from unsafe +test_unsafe .//../foo from unsafe +test_unsafe ./../foo from/.. unsafe +test_unsafe ../dest from/dir safe +test_unsafe ../../dest from//dir unsafe +test_unsafe ..//../dest from/dir unsafe + +test_unsafe .. from/file safe +test_unsafe ../.. from/file unsafe +test_unsafe ..//.. from//file unsafe +test_unsafe dir/.. from safe +test_unsafe dir/../.. from unsafe +test_unsafe dir/..//.. from unsafe + +test_unsafe '' from unsafe # Based on tests from unsafe-links by VladimĂ­r Michl -test_unsafe ../../unsafe/unsafefile from/safe unsafe -test_unsafe ../files/file1 from/safe safe - -test_unsafe ../../unsafe/unsafefile safe unsafe -test_unsafe ../files/file1 safe unsafe - -test_unsafe ../../unsafe/unsafefile `pwd`/from/safe safe -test_unsafe ../files/file1 `pwd`/from/safe safe - -# I think these are correct, but I don't really understand the code. -# Waiting for an answer from dwd -test_skipped "correct behaviour is unclear" +test_unsafe ../../unsafe/unsafefile from/safe unsafe +test_unsafe ..//../unsafe/unsafefile from/safe unsafe +test_unsafe ../files/file1 from/safe safe -# Test suspicious handling of '..' in srcdir -test_unsafe ../../unsafe/unsafefile from/safe/../safe unsafe -test_unsafe ../files/file1 from/safe/../safe safe +test_unsafe ../../unsafe/unsafefile safe unsafe +test_unsafe ../files/file1 safe unsafe +test_unsafe ../../unsafe/unsafefile `pwd`/from/safe safe +test_unsafe ../files/file1 `pwd`/from/safe safe