diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2007-11-30 08:53:38 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2007-11-30 08:53:38 +0100 |
commit | 688073771da95df0d7551b8361e264180bfffe5f (patch) | |
tree | 9d4391b5282a96ad4df3dc3e0b8e43b2886ff1ac /tests/CuTmpdir.pm | |
parent | 9962f24cc458e7d7588d4d043339823067aa3b83 (diff) | |
download | coreutils-688073771da95df0d7551b8361e264180bfffe5f.tar.gz coreutils-688073771da95df0d7551b8361e264180bfffe5f.tar.bz2 coreutils-688073771da95df0d7551b8361e264180bfffe5f.zip |
* tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not
defined, because it then goes wild and changes the mode of all
directories below $HOME. Undefined $dir can happen if the test
is to be skipped because of an unsafe working directory name.
Diffstat (limited to 'tests/CuTmpdir.pm')
-rw-r--r-- | tests/CuTmpdir.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/CuTmpdir.pm b/tests/CuTmpdir.pm index f8d43d5ff..38bc7245e 100644 --- a/tests/CuTmpdir.pm +++ b/tests/CuTmpdir.pm @@ -64,11 +64,14 @@ sub wanted END { my $saved_errno = $?; - chdir $dir - or warn "$ME: failed to chdir to $dir: $!\n"; - # Perform the equivalent of find . -type d -print0|xargs -0 chmod -R 700. - my $options = {untaint => 1, wanted => \&wanted}; - find ($options, '.'); + if (defined $dir) + { + chdir $dir + or warn "$ME: failed to chdir to $dir: $!\n"; + # Perform the equivalent of find . -type d -print0|xargs -0 chmod -R 700. + my $options = {untaint => 1, wanted => \&wanted}; + find ($options, '.'); + } $? = $saved_errno; } |