From 63ff75d2818a3613b01c5ad322802c305d2282f8 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 25 Jul 2023 15:37:53 +0200 Subject: 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. --- src/buildtool/file_system/file_root.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/buildtool/file_system/file_root.hpp') 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(root_) == true auto root_path = std::get(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(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(root_) / file_path); + auto type = FileSystemManager::Type( + std::get(root_) / file_path, /*allow_upwards=*/true); if (type and IsBlobObject(*type)) { return type; } -- cgit v1.2.3