diff options
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r-- | src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp | 20 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/TARGETS | 1 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/tree_reader_utils.cpp | 7 |
3 files changed, 2 insertions, 26 deletions
diff --git a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp index 6c0c5ae4..68da1b87 100644 --- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp +++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp @@ -382,23 +382,12 @@ auto BazelMsgFactory::CreateDirectoryDigestFromGitTree( if (not tree_content) { return unexpected{tree_content.error()}; } - auto const check_symlinks = - [&read_git](std::vector<ArtifactDigest> const& ids) { - return std::all_of(ids.begin(), - ids.end(), - [&read_git](auto const& id) -> bool { - auto content = GetContentFromGitEntry( - read_git, id, ObjectType::Symlink); - return content and - PathIsNonUpwards(*content); - }); - }; - // Git-SHA1 hashing is used for reading from git HashFunction const hash_function{HashFunction::Type::GitSHA1}; // the tree digest is in native mode, so no need for rehashing content + auto skip_symlinks = [](auto const& /*unused*/) { return true; }; auto const entries = GitRepo::ReadTreeData( - *tree_content, digest.hash(), check_symlinks, /*is_hex_id=*/true); + *tree_content, digest.hash(), skip_symlinks, /*is_hex_id=*/true); if (not entries) { return unexpected{fmt::format("failed reading entries of tree {}", digest.hash())}; @@ -645,11 +634,6 @@ auto BazelMsgFactory::CreateGitTreeDigestFromDirectory( } } else { - // check validity of symlink - if (not PathIsNonUpwards(sym.target())) { - return unexpected{fmt::format( - "found non-upwards symlink {}", sym_digest.hash())}; - } // rehash symlink auto const blob_digest = store_symlink(sym.target()); if (not blob_digest) { diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS index b13ac8b5..31a308ad 100644 --- a/src/buildtool/execution_api/common/TARGETS +++ b/src/buildtool/execution_api/common/TARGETS @@ -29,7 +29,6 @@ [ ["@", "json", "", "json"] , ["src/buildtool/logging", "log_level"] , ["src/utils/cpp", "hex_string"] - , ["src/utils/cpp", "path"] ] , "stage": ["src", "buildtool", "execution_api", "common"] } diff --git a/src/buildtool/execution_api/common/tree_reader_utils.cpp b/src/buildtool/execution_api/common/tree_reader_utils.cpp index 2ec90cc2..4d687bc5 100644 --- a/src/buildtool/execution_api/common/tree_reader_utils.cpp +++ b/src/buildtool/execution_api/common/tree_reader_utils.cpp @@ -29,7 +29,6 @@ #include "src/buildtool/logging/logger.hpp" #include "src/utils/cpp/expected.hpp" #include "src/utils/cpp/hex_string.hpp" -#include "src/utils/cpp/path.hpp" namespace { [[nodiscard]] auto CreateObjectInfo(HashFunction hash_function, @@ -104,12 +103,6 @@ auto TreeReaderUtils::ReadObjectInfos(bazel_re::Directory const& dir, } for (auto const& l : dir.symlinks()) { - // check validity of symlinks - if (not PathIsNonUpwards(l.target())) { - Logger::Log( - LogLevel::Error, "found invalid symlink at {}", l.name()); - return false; - } if (not store_info(l.name(), CreateObjectInfo(hash_function, l))) { return false; } |