aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/storage
diff options
context:
space:
mode:
authorzousar <[email protected]>2026-03-18 10:04:37 -0600
committerzousar <[email protected]>2026-03-18 10:04:37 -0600
commita192118b1a6f27c55c5b716642fa14f162c5eafe (patch)
treeeb0b32c022bf250607d73b69c3cdce1b16745859 /src/zenserver/storage
parentMerge branch 'main' into zs/long-filename-improvement (diff)
downloadzen-a192118b1a6f27c55c5b716642fa14f162c5eafe.tar.xz
zen-a192118b1a6f27c55c5b716642fa14f162c5eafe.zip
Addressing review feedback
Diffstat (limited to 'src/zenserver/storage')
-rw-r--r--src/zenserver/storage/projectstore/httpprojectstore.cpp10
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)
{