diff options
| -rw-r--r-- | mullvad-daemon/src/bin/problem-report.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mullvad-daemon/src/bin/problem-report.rs b/mullvad-daemon/src/bin/problem-report.rs index f993ccb5cb..d7579ff9a8 100644 --- a/mullvad-daemon/src/bin/problem-report.rs +++ b/mullvad-daemon/src/bin/problem-report.rs @@ -205,13 +205,17 @@ impl ProblemReport { } fn redact(&self, input: &str) -> String { - let mut out = self.redact_home_dir(input); - + let mut out = self.redact_account_number(input); + out = self.redact_home_dir(&out); out = self.redact_network_info(&out); - self.redact_custom_strings(out) } + fn redact_account_number(&self, input: &str) -> String { + let re = Regex::new("\\d{16}").unwrap(); + re.replace_all(input, "[REDACTED ACCOUNT NUMBER]").to_string() + } + fn redact_home_dir(&self, input: &str) -> String { match env::home_dir() { Some(home) => input.replace(home.to_string_lossy().as_ref(), "~"), |
