diff options
author | Carbenium <carbenium@outlook.com> | 2020-08-06 22:55:16 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-26 18:41:14 +0100 |
commit | d6c998a1a8f01b05d136667612e8fb350d9fdb59 (patch) | |
tree | 58dd01c2e05565ea16ed22eb4f1ac1e4654a7568 /src/server/database/Updater/DBUpdater.cpp | |
parent | cd392970e3d4b0cea0fc625baa2df63826c943ac (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
(cherry picked from commit 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb)
Diffstat (limited to 'src/server/database/Updater/DBUpdater.cpp')
-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 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(); |