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.
+2007-11-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * 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.
+
2007-11-28 Paul Eggert <eggert@cs.ucla.edu>
Close a file descriptor leak when cp --preserve=context fails.
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;
}