diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-07-25 15:37:53 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-08-08 10:56:20 +0200 |
commit | 63ff75d2818a3613b01c5ad322802c305d2282f8 (patch) | |
tree | e45ba21d34763d104874dc6b3b6e976edbf29cb5 /src/buildtool/file_system/file_root.hpp | |
parent | 776347cd196ab16eec72e186dcf7f86dd620b42b (diff) | |
download | justbuild-63ff75d2818a3613b01c5ad322802c305d2282f8.tar.gz |
just execute: Fix uncollected upwards symlinks
Upwards symlinks should still be collected from actions, even if
only the non-upwards symlinks are supported artifact types. The
client side is thus the one responsible with enforcing the
non-upwardness condition.
Diffstat (limited to 'src/buildtool/file_system/file_root.hpp')
-rw-r--r-- | src/buildtool/file_system/file_root.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp index b332f9cd..feb5519a 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -362,7 +362,7 @@ class FileRoot { // std::holds_alternative<fs_root_t>(root_) == true auto root_path = std::get<fs_root_t>(root_) / path; auto exists = FileSystemManager::Exists(root_path); - auto type = FileSystemManager::Type(root_path); + auto type = FileSystemManager::Type(root_path, /*allow_upwards=*/true); return (ignore_special_ ? exists and type and IsNonSpecialObject(*type) : exists); } @@ -431,7 +431,8 @@ class FileRoot { return std::nullopt; } auto full_path = std::get<fs_root_t>(root_) / file_path; - if (auto type = FileSystemManager::Type(full_path)) { + if (auto type = + FileSystemManager::Type(full_path, /*allow_upwards=*/true)) { return IsSymlinkObject(*type) ? FileSystemManager::ReadSymlink(full_path) : FileSystemManager::ReadFile(full_path); @@ -461,6 +462,7 @@ class FileRoot { map.emplace(name.string(), type); return true; }, + /*allow_upwards=*/false, ignore_special_)) { return DirectoryEntries{std::move(map)}; } @@ -486,8 +488,8 @@ class FileRoot { } return std::nullopt; } - auto type = - FileSystemManager::Type(std::get<fs_root_t>(root_) / file_path); + auto type = FileSystemManager::Type( + std::get<fs_root_t>(root_) / file_path, /*allow_upwards=*/true); if (type and IsBlobObject(*type)) { return type; } |