diff options
author | Jim Meyering <jim@meyering.net> | 2004-06-28 18:47:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-06-28 18:47:24 +0000 |
commit | d69237e2d60b636940c43a52bfbdffbb9632b808 (patch) | |
tree | b249f11010a36c129f7053e74ce0e68d35dee17e /tests/cp | |
parent | 14af6eb4620f20cf844e583354b81bf9bbd89186 (diff) | |
download | coreutils-d69237e2d60b636940c43a52bfbdffbb9632b808.tar.xz |
Add a test to verify that we get the new
diagnostic when failing to copy through a symlink-to-inaccessible-dir.
Diffstat (limited to 'tests/cp')
-rwxr-xr-x | tests/cp/fail-perm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/cp/fail-perm b/tests/cp/fail-perm index c2b18801b..218785a9f 100755 --- a/tests/cp/fail-perm +++ b/tests/cp/fail-perm @@ -16,7 +16,7 @@ framework_failure=0 mkdir -p $tmp || framework_failure=1 cd $tmp || framework_failure=1 -mkdir D || framework_failure=1 +mkdir D D/D || framework_failure=1 touch D/a || framework_failure=1 chmod 0 D/a || framework_failure=1 chmod 500 D || framework_failure=1 @@ -36,6 +36,20 @@ cp -pR D DD > /dev/null 2>&1 && fail=1 set X `ls -ld DD` shift test "$1" = dr-x------ || fail=1 + +chmod 0 D +ln -s D/D symlink +touch F +cat > exp <<\EOF +cp: accessing `symlink': Permission denied +EOF + +cp F symlink 2> out && fail=1 +cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; } + +cp --target-directory=symlink F 2> out && fail=1 +cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; } + chmod 700 D (exit $fail); exit $fail |