Skip to content

Commit 49c01c6

Browse files
authored
askpass: Remove attempt to surface friendly error if zed exe path is not executable before use in askpass script (#30396)
Closes #29819 Release Notes: - Removed a faulty check in the askpass implementation causing unintended "Failed to check metadata of Zed executable path for use in askpass" errors when remoting via SSH or doing git operations that require authentication.
1 parent 863d7cc commit 49c01c6

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

crates/askpass/src/askpass.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,20 @@ fn get_shell_safe_zed_path() -> anyhow::Result<String> {
167167
.to_string_lossy()
168168
.to_string();
169169

170-
// sanity check on unix systems that the path exists and is executable
171-
// todo(windows): implement this check for windows (or just use `is-executable` crate)
172-
use std::os::unix::fs::MetadataExt;
173-
let metadata = std::fs::metadata(&zed_path)
174-
.context("Failed to check metadata of Zed executable path for use in askpass")?;
175-
let is_executable = metadata.is_file() && metadata.mode() & 0o111 != 0;
176-
anyhow::ensure!(
177-
is_executable,
178-
"Failed to verify Zed executable path for use in askpass"
179-
);
170+
// NOTE: this was previously enabled, however, it caused errors when it shouldn't have
171+
// (see https://github.com/zed-industries/zed/issues/29819)
172+
// The zed path failing to execute within the askpass script results in very vague ssh
173+
// authentication failed errors, so this was done to try and surface a better error
174+
//
175+
// use std::os::unix::fs::MetadataExt;
176+
// let metadata = std::fs::metadata(&zed_path)
177+
// .context("Failed to check metadata of Zed executable path for use in askpass")?;
178+
// let is_executable = metadata.is_file() && metadata.mode() & 0o111 != 0;
179+
// anyhow::ensure!(
180+
// is_executable,
181+
// "Failed to verify Zed executable path for use in askpass"
182+
// );
183+
180184
// As of writing, this can only be fail if the path contains a null byte, which shouldn't be possible
181185
// but shlex has annotated the error as #[non_exhaustive] so we can't make it a compile error if other
182186
// errors are introduced in the future :(

0 commit comments

Comments
 (0)