ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

escape single quotes in command strings (#479)

authored by

marshmallow and committed by
GitHub
cbd2d863 d3b587d1

+7 -3
+4 -2
crates/core/src/commands/noninteractive.rs
··· 55 55 } 56 56 ); 57 57 58 + let command_string = command_string.replace('\'', "'\''"); 59 + 58 60 let command_string = if let Some(escalation_command) = &arguments.privilege_escalation_command { 59 - format!("{escalation_command} sh -c '{command_string}'") 61 + format!("{escalation_command} bash -c '{command_string}'") 60 62 } else { 61 - command_string 63 + format!("bash -c '{command_string}'") 62 64 }; 63 65 64 66 debug!("{command_string}");
+3 -1
crates/core/src/commands/pty/mod.rs
··· 313 313 314 314 async fn build_command<S: AsRef<str>>( 315 315 arguments: &CommandArguments<S>, 316 - command_string: &String, 316 + command_string: &str, 317 317 ) -> Result<CommandBuilder, HiveLibError> { 318 318 let mut command = if let Some(ref target) = arguments.target { 319 319 let mut command = create_int_ssh_command(target, arguments.modifiers).await?; ··· 329 329 330 330 command 331 331 }; 332 + 333 + let command_string = command_string.replace('\'', "'\''"); 332 334 333 335 if let Some(ref escalation_command) = arguments.privilege_escalation_command { 334 336 command.arg(format!("{escalation_command} bash -c '{command_string}'"));