From 8e39275429c36ff5dfa5d62a80713c5b288fe26a Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 29 May 2020 16:27:43 +0100 Subject: fix(cli/permissions): Fix CWD and exec path leaks (#5642) --- cli/state.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cli/state.rs') 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) -- cgit v1.2.3