diff options
author | 2020-02-20 15:47:06 +0000 | |
---|---|---|
committer | 2020-02-21 00:07:17 +0000 | |
commit | 2c5eb697ef7c3230c85a92a17c9f53d6e19b1a12 (patch) | |
tree | 51420f3e27d4bcc2e16b20ae7da535893fa5b633 /jni/node-inl.h | |
parent | cbf94b2ccb15f4f35eccab77ed243b1c830ba25d (diff) |
Fix sensitive logging
Removed file paths and other unnecessary info from logs
Added more consistent logging
Test: No file paths in logs. Example logs
V libfuse : unique: 126, opcode: GETATTR (3), nodeid: 523136724464, insize: 56, pid: 2841
D FuseDaemon: pf_getattr : node = [/storage/emulated/523136724464/]
V libfuse : unique: 126, success, outsize: 120
Bug: 149470210
Change-Id: Iee7c2ac085608c0fcd6ecdf9d64a1ae62ebc676b
Diffstat (limited to 'jni/node-inl.h')
-rw-r--r-- | jni/node-inl.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/jni/node-inl.h b/jni/node-inl.h index e21ae5448..b6083de86 100644 --- a/jni/node-inl.h +++ b/jni/node-inl.h @@ -22,6 +22,7 @@ #include <list> #include <memory> #include <mutex> +#include <sstream> #include <string> #include <vector> @@ -114,6 +115,10 @@ class node { // associated with its descendants. std::string BuildPath() const; + // Builds the full PII safe path associated with this node, including all path segments + // associated with its descendants. + std::string BuildSafePath() const; + // Looks up a direct descendant of this node by name. If |acquire| is true, // also Acquire the node before returning a reference to it. node* LookupChildByName(const std::string& name, bool acquire) const { @@ -262,9 +267,9 @@ class node { } } - // A helper function to recursively construct the absolute path of a given - // node. - static void BuildPathForNodeRecursive(node* node, std::string* path); + // A helper function to recursively construct the absolute path of a given node. + // If |safe| is true, builds a PII safe path instead + static void BuildPathForNodeRecursive(bool safe, const node* node, std::stringstream* path); // The name of this node. Non-const because it can change during renames. std::string name_; |