aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2025-09-04 13:20:38 -0700
committerGitHub Enterprise <[email protected]>2025-09-04 22:20:38 +0200
commitf23ec0ba83696ae1a6ec7ebaaea5f6cc500bd918 (patch)
treed42715f9f4c264cfbd8e58ba38f181757b20d37d /src
parentasio large header support (#484) (diff)
downloadzen-f23ec0ba83696ae1a6ec7ebaaea5f6cc500bd918.tar.xz
zen-f23ec0ba83696ae1a6ec7ebaaea5f6cc500bd918.zip
Avoid mutating executable paths when copying files during full service install (#486)
Diffstat (limited to 'src')
-rw-r--r--src/zen/cmds/service_cmd.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/zen/cmds/service_cmd.cpp b/src/zen/cmds/service_cmd.cpp
index 3847c423d..398bbfc83 100644
--- a/src/zen/cmds/service_cmd.cpp
+++ b/src/zen/cmds/service_cmd.cpp
@@ -435,13 +435,14 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
ExePath,
m_ServerExecutable,
#if ZEN_PLATFORM_WINDOWS
- ExePath.replace_extension("pdb"),
- m_ServerExecutable.replace_extension("pdb"),
- ExePath
- .replace_filename("crashpad_handler.exe")
+ ExePath.parent_path() / ExePath.stem().replace_extension("pdb"),
+ m_ServerExecutable.parent_path() / m_ServerExecutable.stem().replace_extension("pdb"),
+ ExePath.parent_path() /
+ std::filesystem::path("crashpad_handler.exe")
#endif
#if ZEN_PLATFORM_MAC
- ExePath.replace_filename("crashpad_handler")
+ ExePath.parent_path() /
+ std::filesystem::path("crashpad_handler")
#endif
};
@@ -457,6 +458,7 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
for (const std::filesystem::path& File : FilesToCopy)
{
std::filesystem::path Destination = m_InstallPath / File.filename();
+
if (!CopyFile(File, Destination, {.EnableClone = false}))
{
ZEN_CONSOLE("Failed to copy '{}' to '{}'", File, Destination);