summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/file_root.hpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-01-24 12:41:23 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-01-24 18:06:22 +0100
commit0026331ce0177bd3f902628aadcd1a84f3e2547d (patch)
tree328591a6214723d785c8348ed7d5216d020beba7 /src/buildtool/file_system/file_root.hpp
parentde17042b3c3296e0605f73df771111c6af49ca61 (diff)
downloadjustbuild-0026331ce0177bd3f902628aadcd1a84f3e2547d.tar.gz
FileSystemManager: Do not follow symlinks
... and ensure that cascades of checks are performed with only a single filesystem stat per method.
Diffstat (limited to 'src/buildtool/file_system/file_root.hpp')
-rw-r--r--src/buildtool/file_system/file_root.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp
index 726171b8..a1b21a81 100644
--- a/src/buildtool/file_system/file_root.hpp
+++ b/src/buildtool/file_system/file_root.hpp
@@ -186,8 +186,7 @@ class FileRoot {
if (std::holds_alternative<pairs_t>(data_)) {
auto const& data = std::get<pairs_t>(data_);
auto it = data.find(name);
- return (it != data.end() and
- it->second == ObjectType::File);
+ return (it != data.end() and IsFileObject(it->second));
}
} catch (...) {
}
@@ -238,7 +237,7 @@ class FileRoot {
auto const& data = std::get<pairs_t>(data_);
return Iterator{FilteredIterator{
data.begin(), data.end(), [](auto const& x) {
- return x.second == ObjectType::File;
+ return IsFileObject(x.second);
}}};
}
// std::holds_alternative<tree_t>(data_) == true
@@ -254,7 +253,7 @@ class FileRoot {
auto const& data = std::get<pairs_t>(data_);
return Iterator{FilteredIterator{
data.begin(), data.end(), [](auto const& x) {
- return x.second == ObjectType::Tree;
+ return IsTreeObject(x.second);
}}};
}