From 0a9ff3a87edcf6dd8fe0a1f68083f25c90f513b6 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 13 Sep 2024 15:38:20 +0200 Subject: local execution: Check validity of symlinks Invalid entries, currently all upwards symlinks (pending implementation of a better way of handling them), are now identified and handled similarly to remote execution: in compatible mode on the client side, during handling of local response, and in native mode during the population of the local action result. --- src/buildtool/execution_api/common/tree_reader_utils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/buildtool/execution_api/common/tree_reader_utils.cpp') diff --git a/src/buildtool/execution_api/common/tree_reader_utils.cpp b/src/buildtool/execution_api/common/tree_reader_utils.cpp index 855c1842..13775201 100644 --- a/src/buildtool/execution_api/common/tree_reader_utils.cpp +++ b/src/buildtool/execution_api/common/tree_reader_utils.cpp @@ -106,6 +106,12 @@ 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; } -- cgit v1.2.3