bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

testsuite safety fix


From: Ralf Wildenhues
Subject: testsuite safety fix
Date: Fri, 30 Nov 2007 06:28:13 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Jim,

please apply.

Thanks,
Ralf

2007-11-30  Ralf Wildenhues  <address@hidden>

        * 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.  

diff --git a/tests/CuTmpdir.pm b/tests/CuTmpdir.pm
index f8d43d5..38bc724 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;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]