diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-05-29 16:27:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 17:27:43 +0200 |
commit | 8e39275429c36ff5dfa5d62a80713c5b288fe26a (patch) | |
tree | 1d6d2781682bed1c29f81366f08db65c604fef2c /cli/state.rs | |
parent | ad6d2a7734aafb4a64837abc6abd1d1d0fb20017 (diff) |
fix(cli/permissions): Fix CWD and exec path leaks (#5642)
Diffstat (limited to 'cli/state.rs')
-rw-r--r-- | cli/state.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/state.rs b/cli/state.rs index 00337c286..a15d113c8 100644 --- a/cli/state.rs +++ b/cli/state.rs @@ -425,6 +425,17 @@ impl State { self.borrow().permissions.check_read(path) } + /// As `check_read()`, but permission error messages will anonymize the path + /// by replacing it with the given `display`. + #[inline] + pub fn check_read_blind( + &self, + path: &Path, + display: &str, + ) -> Result<(), OpError> { + self.borrow().permissions.check_read_blind(path, display) + } + #[inline] pub fn check_write(&self, path: &Path) -> Result<(), OpError> { self.borrow().permissions.check_write(path) |