aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-03-03 08:43:17 -0800
committerWayne Davison <wayned@samba.org>2009-03-03 08:46:57 -0800
commitb4d30300b9cf6cdb77a95bd2018c7152f06ec94b (patch)
tree7c78c775e40a91b38488e758bef1abc13a87a089 /testsuite
parente6f3a33c5e932dc82d487b55a3b12ed7aa5a90f5 (diff)
downloadandroid_external_rsync-b4d30300b9cf6cdb77a95bd2018c7152f06ec94b.tar.gz
android_external_rsync-b4d30300b9cf6cdb77a95bd2018c7152f06ec94b.tar.bz2
android_external_rsync-b4d30300b9cf6cdb77a95bd2018c7152f06ec94b.zip
Improved the unsafe_symlink() code to not get fooled by extra '/' chars
in the symlink's path. Added test cases. This fixes bug #6151.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/unsafe-byname.test60
1 files changed, 34 insertions, 26 deletions
diff --git a/testsuite/unsafe-byname.test b/testsuite/unsafe-byname.test
index 61e0e24a..69b338f6 100644
--- a/testsuite/unsafe-byname.test
+++ b/testsuite/unsafe-byname.test
@@ -19,33 +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/file safe
-test_unsafe ../.. from/file unsafe
-test_unsafe dir/.. from safe
-test_unsafe dir/../.. from unsafe
-
-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 from/safe unsafe
+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 safe unsafe
+test_unsafe ../files/file1 safe unsafe
-test_unsafe ../../unsafe/unsafefile `pwd`/from/safe safe
-test_unsafe ../files/file1 `pwd`/from/safe safe
+test_unsafe ../../unsafe/unsafefile `pwd`/from/safe safe
+test_unsafe ../files/file1 `pwd`/from/safe safe