summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-07-22 08:12:27 +0000
committerJim Meyering <jim@meyering.net>2002-07-22 08:12:27 +0000
commit2f17be04e3a76b7cbd5772f8fd7b5d09f412f5d9 (patch)
tree9d85197df5fead143a7db0cd72211244b3ba7ae3 /tests
parentdb6dff2e6ede15f55e329eec6ec091aa1354bc52 (diff)
downloadcoreutils-2f17be04e3a76b7cbd5772f8fd7b5d09f412f5d9.tar.xz
This test might remove a file owned by the person running `make check'.
Hoist definition of $target_file, and use that (not $f) in test for owner/dir/symlink. Patch by Michael Stone.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/fail-eperm5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/rm/fail-eperm b/tests/rm/fail-eperm
index a5eb4c18a..6d5f14c72 100755
--- a/tests/rm/fail-eperm
+++ b/tests/rm/fail-eperm
@@ -52,16 +52,17 @@ foreach my $dir (@dir_list)
foreach my $f (readdir DIR_HANDLE)
{
+ my $target_file = "$dir/$f";
+
# Skip files owned by self, symlinks, and directories.
# It's not technically necessary to skip symlinks, but it's simpler.
- -l $f || -o _ || -d _
+ -l $target_file || -o _ || -d _
and next;
$found_file = 1;
# Invoke rm on this file and ensure that we get the
# expected exit code and diagnostic.
- my $target_file = "$dir/$f";
my $cmd = "rm -f $target_file";
open RM, "$cmd 2>&1 |"
or die "$ME: cannot execute `$cmd'\n";