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.

fix escalation_command not used for interactive command (#478)

authored by

marshmallow and committed by
GitHub
d3b587d1 bf92f655

+6 -5
+1
CHANGELOG.md
··· 18 18 - Cargo dependency updates. 19 19 - Switched (back) to the https://snix.dev/ `nix_compat` crate for internal nix 20 20 json log parsing. 21 + - `deployment.privilegeEscalationCommand` not being consistently applied. 21 22 22 23 ### Fixed 23 24
+5 -5
crates/core/src/commands/pty/mod.rs
··· 244 244 async fn print_authenticate_warning<S: AsRef<str>>( 245 245 arguments: &CommandArguments<S>, 246 246 ) -> Result<(), HiveLibError> { 247 - if !arguments.is_elevated() { 247 + let Some(ref escalation_command) = arguments.privilege_escalation_command else { 248 248 return Ok(()); 249 - } 249 + }; 250 250 251 251 let target_display = if let Some(ref target) = arguments.target { 252 252 let target = target.0.read().await; ··· 264 264 if let Some(tx) = UI_SENDER.get() { 265 265 let _ = tx.send(UiMessage::LogLine( 266 266 format!( 267 - "{target_display} | Authenticate for \"sudo {}\":\n", 267 + "{target_display} | Authenticate for \"{escalation_command} {}\":\n", 268 268 arguments.command_string.as_ref() 269 269 ) 270 270 .into_bytes(), ··· 330 330 command 331 331 }; 332 332 333 - if arguments.is_elevated() { 334 - command.arg(format!("sudo -u root -- bash -c '{command_string}'")); 333 + if let Some(ref escalation_command) = arguments.privilege_escalation_command { 334 + command.arg(format!("{escalation_command} bash -c '{command_string}'")); 335 335 } else { 336 336 command.arg(format!("bash -c '{command_string}'")); 337 337 }