From 1e6a05d0d87652c708d41e97f9d31af4a9cf6cd0 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 26 Nov 2025 13:17:57 +0100 Subject: [PATCH] askpass: Quote askpass script in askpass helper command (#43542) Closes #40276 Release Notes: - Fixed askpass execution failing on windows sometimes --- crates/askpass/src/askpass.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/askpass/src/askpass.rs b/crates/askpass/src/askpass.rs index a9047a567fd3b6323fb6edc64be4854f4da0a958..8e911f1654572d2bcd9f906c82449e1524d0ce9d 100644 --- a/crates/askpass/src/askpass.rs +++ b/crates/askpass/src/askpass.rs @@ -249,11 +249,15 @@ impl PasswordProxy { fs::write(&askpass_script_path, askpass_script) .await .with_context(|| format!("creating askpass script at {askpass_script_path:?}"))?; - make_file_executable(&askpass_script_path).await?; + make_file_executable(&askpass_script_path) + .await + .with_context(|| { + format!("marking askpass script executable at {askpass_script_path:?}") + })?; // todo(shell): There might be no powershell on the system #[cfg(target_os = "windows")] let askpass_helper = format!( - "powershell.exe -ExecutionPolicy Bypass -File {}", + "powershell.exe -ExecutionPolicy Bypass -File '{}'", askpass_script_path.display() );