Skip to content

Commit

Permalink
feat(aura): preserve LANG and EDITOR across sudo boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
fosskers committed Jun 8, 2024
1 parent b6e0f0c commit 07291dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rust/aura-pm/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ impl Localised for SudoError {
}
}

/// Escalate the privileges of the Aura process, if necessary.
/// Escalate the privileges of the entire Aura process, if necessary.
pub(crate) fn sudo(env: &Env) -> Result<(), SudoError> {
if env.general.doas {
karen::doas().map_err(|_| SudoError).void()
} else {
karen::escalate_if_needed().map_err(|_| SudoError).void()
}
karen::builder()
.wrapper(env.sudo())
.with_env(&["LANG", "EDITOR"])
.map_err(|_| SudoError)
.void()
}

/// An [`Iterator`] that knows if the current iteration step is the last one.
Expand Down

0 comments on commit 07291dc

Please sign in to comment.