From d6c998a1a8f01b05d136667612e8fb350d9fdb59 Mon Sep 17 00:00:00 2001 From: Carbenium Date: Thu, 6 Aug 2020 22:55:16 +0200 Subject: 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) --- src/server/database/Updater/DBUpdater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/database') diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp index 34b3fc8f8a6..3b9f7617a64 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -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(); -- cgit v1.2.3