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 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb)
This commit is contained in:
Carbenium
2022-01-26 18:41:14 +01:00
committed by Shauren
parent cd392970e3
commit d6c998a1a8
+2 -2
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();