[Commits] Rev 4614: Add error handling on realpath() call. in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Fri Feb 20 15:17:15 EET 2015


At http://bazaar.launchpad.net/~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4614
revision-id: knielsen at knielsen-hq.org-20150220131711-k66nzlpzsrm4wq48
parent: knielsen at knielsen-hq.org-20150219144327-1l6i5i0leebyyj14
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0
timestamp: Fri 2015-02-20 14:17:11 +0100
message:
  Add error handling on realpath() call.
      
  (Without this, it happened for me that realpath() failed returning
  undef for the default vardir. This in turn caused mysql-test-run.pl to
  delete the source mysql-test/ directory.)
  
  Backport from 10.1, it's not nice to get one's source directory nuked
  by a rouge mysql-test-run.
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2015-01-21 11:03:02 +0000
+++ b/mysql-test/mysql-test-run.pl	2015-02-20 13:17:11 +0000
@@ -1502,7 +1502,12 @@ sub command_line_setup {
   {
     $default_vardir= "$glob_mysql_test_dir/var";
   }
-  $default_vardir = realpath $default_vardir unless IS_WINDOWS;
+  unless (IS_WINDOWS) {
+    my $realpath = realpath($default_vardir);
+    die "realpath('$default_vardir') failed: $!\n"
+      unless defined($realpath) && $realpath ne '';
+    $default_vardir = $realpath;
+  }
 
   if ( ! $opt_vardir )
   {



More information about the commits mailing list