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.
This commit is contained in:
parent
863d7ccb6d
commit
49c01c60b7
1 changed files with 14 additions and 10 deletions
|
@ -167,16 +167,20 @@ fn get_shell_safe_zed_path() -> anyhow::Result<String> {
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
// sanity check on unix systems that the path exists and is executable
|
// NOTE: this was previously enabled, however, it caused errors when it shouldn't have
|
||||||
// todo(windows): implement this check for windows (or just use `is-executable` crate)
|
// (see https://github.com/zed-industries/zed/issues/29819)
|
||||||
use std::os::unix::fs::MetadataExt;
|
// The zed path failing to execute within the askpass script results in very vague ssh
|
||||||
let metadata = std::fs::metadata(&zed_path)
|
// authentication failed errors, so this was done to try and surface a better error
|
||||||
.context("Failed to check metadata of Zed executable path for use in askpass")?;
|
//
|
||||||
let is_executable = metadata.is_file() && metadata.mode() & 0o111 != 0;
|
// use std::os::unix::fs::MetadataExt;
|
||||||
anyhow::ensure!(
|
// let metadata = std::fs::metadata(&zed_path)
|
||||||
is_executable,
|
// .context("Failed to check metadata of Zed executable path for use in askpass")?;
|
||||||
"Failed to verify Zed executable path for use in askpass"
|
// let is_executable = metadata.is_file() && metadata.mode() & 0o111 != 0;
|
||||||
);
|
// anyhow::ensure!(
|
||||||
|
// is_executable,
|
||||||
|
// "Failed to verify Zed executable path for use in askpass"
|
||||||
|
// );
|
||||||
|
|
||||||
// As of writing, this can only be fail if the path contains a null byte, which shouldn't be possible
|
// As of writing, this can only be fail if the path contains a null byte, which shouldn't be possible
|
||||||
// but shlex has annotated the error as #[non_exhaustive] so we can't make it a compile error if other
|
// but shlex has annotated the error as #[non_exhaustive] so we can't make it a compile error if other
|
||||||
// errors are introduced in the future :(
|
// errors are introduced in the future :(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue