unsafe-byname.test
来自「Rsync 3.0.5 source code」· TEST 代码 · 共 52 行
TEST
52 行
#! /bin/sh# Copyright (C) 2002 by Martin Pool# Call directly into unsafe_symlink and test its handling of various filenames. "$suitedir/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 test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\"" fi}test_unsafe file from safetest_unsafe dir/file from safetest_unsafe dir/./file from safetest_unsafe dir/. from safetest_unsafe dir/ from safetest_unsafe /etc/passwd from unsafetest_unsafe //../etc/passwd from unsafetest_unsafe //./etc/passwd from unsafetest_unsafe ./foo from safetest_unsafe ../foo from unsafetest_unsafe ../dest from/dir safetest_unsafe .. from/file safetest_unsafe ../.. from/file unsafetest_unsafe dir/.. from safetest_unsafe dir/../.. from unsafetest_unsafe '' from unsafe# Based on tests from unsafe-links by Vladim韗 Michltest_unsafe ../../unsafe/unsafefile from/safe unsafetest_unsafe ../files/file1 from/safe safetest_unsafe ../../unsafe/unsafefile safe unsafetest_unsafe ../files/file1 safe unsafetest_unsafe ../../unsafe/unsafefile `pwd`/from/safe safetest_unsafe ../files/file1 `pwd`/from/safe safe
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?