Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Notes about handling machines lacking getaddrinfo().
[rsync/rsync.git]
/
testsuite
/
unsafe-byname.test
diff --git
a/testsuite/unsafe-byname.test
b/testsuite/unsafe-byname.test
index
adb9515
..
47809dc
100644
(file)
--- a/
testsuite/unsafe-byname.test
+++ b/
testsuite/unsafe-byname.test
@@
-7,6
+7,11
@@
. $srcdir/testsuite/rsync.fns
test_unsafe() {
. $srcdir/testsuite/rsync.fns
test_unsafe() {
+ # $1 is the target of a symlink
+ # $2 is the directory we're copying
+ # $3 is the expected outcome: "safe" if the link lies within $2,
+ # or "unsafe" otherwise
+
result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2"
if [ "$result" != "$3" ]
then
result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2"
if [ "$result" != "$3" ]
then
@@
-24,9
+29,11
@@
test_unsafe /etc/passwd from unsafe
test_unsafe //../etc/passwd from unsafe
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 ./foo from safe
+test_unsafe ../foo from unsafe
+test_unsafe ../dest from/dir safe
+
+test_unsafe '' from unsafe
# Based on tests from unsafe-links by Vladimír Michl
test_unsafe ../../unsafe/unsafefile from/safe unsafe
# Based on tests from unsafe-links by Vladimír Michl
test_unsafe ../../unsafe/unsafefile from/safe unsafe
@@
-38,6
+45,10
@@
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
+# 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 suspicious handling of '..' in srcdir
test_unsafe ../../unsafe/unsafefile from/safe/../safe unsafe
test_unsafe ../files/file1 from/safe/../safe safe
# Test suspicious handling of '..' in srcdir
test_unsafe ../../unsafe/unsafefile from/safe/../safe unsafe
test_unsafe ../files/file1 from/safe/../safe safe