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.
This commit is contained in:
parent
f2cb45daf3
commit
41cfdc838e
@ -1502,7 +1502,12 @@ sub command_line_setup {
|
|||||||
{
|
{
|
||||||
$default_vardir= "$glob_mysql_test_dir/var";
|
$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 )
|
if ( ! $opt_vardir )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user