diff options
| author | zousar <[email protected]> | 2026-03-18 10:04:37 -0600 |
|---|---|---|
| committer | zousar <[email protected]> | 2026-03-18 10:04:37 -0600 |
| commit | a192118b1a6f27c55c5b716642fa14f162c5eafe (patch) | |
| tree | eb0b32c022bf250607d73b69c3cdce1b16745859 /src/zenserver/storage | |
| parent | Merge branch 'main' into zs/long-filename-improvement (diff) | |
| download | zen-a192118b1a6f27c55c5b716642fa14f162c5eafe.tar.xz zen-a192118b1a6f27c55c5b716642fa14f162c5eafe.zip | |
Addressing review feedback
Diffstat (limited to 'src/zenserver/storage')
| -rw-r--r-- | src/zenserver/storage/projectstore/httpprojectstore.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/zenserver/storage/projectstore/httpprojectstore.cpp b/src/zenserver/storage/projectstore/httpprojectstore.cpp index 3bde082e5..425caee97 100644 --- a/src/zenserver/storage/projectstore/httpprojectstore.cpp +++ b/src/zenserver/storage/projectstore/httpprojectstore.cpp @@ -3163,8 +3163,8 @@ HttpProjectService::HandleRpcRequest(HttpRouterRequest& Req) std::error_code Ec; // Long paths require MakeSafeAbsolutePath otherwise canonical will yield an error code - const std::filesystem::path FilePath = - std::filesystem::canonical(MakeSafeAbsolutePath(Project->RootDir / ServerPath), Ec); + const std::filesystem::path SafeAbsFilePath = MakeSafeAbsolutePath(Project->RootDir / ServerPath); + const std::filesystem::path FilePath = std::filesystem::canonical(SafeAbsFilePath, Ec); if (Ec) { @@ -3185,10 +3185,8 @@ HttpProjectService::HandleRpcRequest(HttpRouterRequest& Req) } BasicFile DataFile; - // Even after calling MakeSafeAbsolutePath on the input to canonical, we will fail to read - // long paths for the output of canonical unless we make them safe here again, because the - // output of canonical will have stripped things like the leading characters to handle long paths - DataFile.Open(MakeSafeAbsolutePath(FilePath), BasicFile::Mode::kRead, Ec); + // Must use SafeAbsFilePath because canonical will have removed leading chars for handling long paths + DataFile.Open(SafeAbsFilePath, BasicFile::Mode::kRead, Ec); if (Ec) { |