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
This commit is contained in:
Carbenium
2020-08-06 22:55:16 +02:00
committed by Peter Keresztes Schmidt
parent 23886881b4
commit 98b1b20d6b

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();