Core/Updater: Fix detection of the mysql binary when a directory is given as path

This ensures that we never pass a directory path StartProcess which results in a crash.

Closes #25216

(cherry picked from commit 98b1b20d6b)
This commit is contained in:
Carbenium
2020-08-06 22:55:16 +02:00
committed by Shauren
parent cd392970e3
commit d6c998a1a8

View File

@@ -40,10 +40,10 @@ std::string DBUpdaterUtil::GetCorrectedMySQLExecutable()
bool DBUpdaterUtil::CheckExecutable()
{
boost::filesystem::path exe(GetCorrectedMySQLExecutable());
if (!exists(exe))
if (!is_regular_file(exe))
{
exe = Trinity::SearchExecutableInPath("mysql");
if (!exe.empty() && exists(exe))
if (!exe.empty() && is_regular_file(exe))
{
// Correct the path to the cli
corrected_path() = absolute(exe).generic_string();