diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-03-01 11:14:27 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-03-05 21:37:20 +0100 |
| commit | 950f467b5c65d84b2a68590b9e6d59e828c41848 (patch) | |
| tree | 8e8999afe29e8acac94e23117c50c738cdabd25f | |
| parent | c669ccadf1b0448b4d0a0422d49387e07ca7fb46 (diff) | |
| download | mullvadvpn-950f467b5c65d84b2a68590b9e6d59e828c41848.tar.xz mullvadvpn-950f467b5c65d84b2a68590b9e6d59e828c41848.zip | |
Redact all 16 digits numbers from problem reports
| -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(), "~"), |
