diff options
author | Carbenium <carbenium@outlook.com> | 2020-08-06 22:55:16 +0200 |
---|---|---|
committer | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-08-07 11:23:10 +0200 |
commit | 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb (patch) | |
tree | 7f6fa0ab98ef3522325e3e8bd3c7fd836cc7c8ef | |
parent | 23886881b4c527d1b4b5a3de4f95855a62142edf (diff) |
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
-rw-r--r-- | src/server/database/Updater/DBUpdater.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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(); |