commit | 09f7620fec287d90ba80df3796ac75c98d7b8f35 | [log] [tgz] |
---|---|---|
author | Thomas Gales <tgales@google.com> | Wed Jul 17 00:20:33 2024 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Jul 17 00:20:33 2024 +0000 |
tree | c6442ad1857e5a7a25dd7f11a40de0b061ee246c | |
parent | 3386f65d6f31bca8f39de9034902ac12ee889b4c [diff] |
[forensics] Fix redaction application with empty characters Previously, redaction would find a match using regex and record the match as plain text. After all matches were found, the redactions would be applied by finding the plain text within the original content and making the replacement. This scheme would result in incorrect behavior if a plain text match was a subset of another, later plain text match such as "abc" and "abcd" resulting in "<REDACTED-HEX: 1>" and "<REDACTED-HEX: 1>d", with the trailing "d" not redacted by mistake. This CL changes from the plain text find-replace scheme to one which records the position within the original content and makes the replacements at those positions. Note that a 2-step approach is necessary because we want to insert an ID for the redacted hex, and want this ID to match for multiple instances of the same original text being redacted. So a 1-step re2::GlobalReplace would not work because all text matching a pattern would have the same ID. Fixed: 350095296 Tested: `fx test //src/developer/forensics` Change-Id: I5bbc94eb8c2f600c6e6098c03260801fbe7b75a7 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1082700 Reviewed-by: Alex Pankhurst <pankhurst@google.com> Commit-Queue: Thomas Gales <tgales@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.