From 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb 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 --- 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 ac75e64e9d3..bf283cf640f 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