summaryrefslogtreecommitdiff
path: root/jni/node.cpp
diff options
context:
space:
mode:
author Cody Schuffelen <schuffelen@google.com> 2020-02-21 17:40:56 +0000
committer Cody Schuffelen <schuffelen@google.com> 2020-02-21 17:41:09 +0000
commit338bd1adbe7320ed1605ed4c7249362f16be258d (patch)
tree4fbfd27d46316c46fe4d88d5615b2cbd35b5a1e9 /jni/node.cpp
parent2c5eb697ef7c3230c85a92a17c9f53d6e19b1a12 (diff)
Revert "Fix sensitive logging"
This reverts commit 2c5eb697ef7c3230c85a92a17c9f53d6e19b1a12. Reason for revert: Boot tests failing on treehugger. Bug: 149996303 Change-Id: I6738eb36eb97bfdef9f7e1b90fb27a689c3faffd
Diffstat (limited to 'jni/node.cpp')
-rw-r--r--jni/node.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/jni/node.cpp b/jni/node.cpp
index 6c530cbcd..8898b7b5b 100644
--- a/jni/node.cpp
+++ b/jni/node.cpp
@@ -41,33 +41,20 @@ namespace mediaprovider {
namespace fuse {
// Assumes that |node| has at least one child.
-void node::BuildPathForNodeRecursive(bool safe, const node* node, std::stringstream* path) {
- if (node->parent_) {
- BuildPathForNodeRecursive(safe, node->parent_, path);
- }
+void node::BuildPathForNodeRecursive(node* node, std::string* path) {
+ if (node->parent_) BuildPathForNodeRecursive(node->parent_, path);
- if (safe && node->parent_) {
- (*path) << reinterpret_cast<uintptr_t>(node);
- } else {
- (*path) << node->GetName();
- }
- (*path) << "/";
+ (*path) += node->GetName() + "/";
}
std::string node::BuildPath() const {
std::lock_guard<std::recursive_mutex> guard(*lock_);
- std::stringstream path;
-
- BuildPathForNodeRecursive(false, this, &path);
- return path.str();
-}
-
-std::string node::BuildSafePath() const {
- std::lock_guard<std::recursive_mutex> guard(*lock_);
- std::stringstream path;
+ std::string path;
- BuildPathForNodeRecursive(true, this, &path);
- return path.str();
+ path.reserve(PATH_MAX);
+ if (parent_) BuildPathForNodeRecursive(parent_, &path);
+ path += name_;
+ return path;
}
const node* node::LookupAbsolutePath(const node* root, const std::string& absolute_path) {