diff --git a/crates/rustic_core/src/repository.rs b/crates/rustic_core/src/repository.rs index 973b18fbf..e8fe8cf33 100644 --- a/crates/rustic_core/src/repository.rs +++ b/crates/rustic_core/src/repository.rs @@ -3,7 +3,7 @@ use std::{ fs::File, io::{BufRead, BufReader}, path::PathBuf, - process::Command, + process::{Command, Stdio}, }; use bytes::Bytes; @@ -106,7 +106,7 @@ pub struct RepositoryOptions { )] pub password_file: Option, - /// Command to read the password from + /// Command to read the password from. Password is read from stdout #[cfg_attr(feature = "clap", clap( long, global = true, @@ -267,7 +267,11 @@ impl

Repository

{ .map_err(RepositoryErrorKind::FromNomError)? .1; debug!("commands: {commands:?}"); - let Ok(output) = Command::new(commands[0]).args(&commands[1..]).output() else { + let command = Command::new(commands[0]) + .args(&commands[1..]) + .stdout(Stdio::piped()) + .spawn()?; + let Ok(output) = command.wait_with_output() else { return Err( RepositoryErrorKind::PasswordCommandParsingFailed.into()); };