Skip to content

Commit

Permalink
add failing compliance test for SHELL canonicalization
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Jan 21, 2025
1 parent 6c92185 commit 2146c8c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test-framework/sudo-compliance-tests/src/sudo/flag_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ echo $0";
Ok(())
}

#[ignore = "gh962"]
#[test]
fn shell_is_canonicalized() -> Result<()> {
let shell_path = "/bin/bash";
let env = Env("ALL ALL=(ALL:ALL) NOPASSWD: /usr/bin/bash")
.build()?;

Command::new("env")
.arg(format!("SHELL={shell_path}"))
.args(["sudo", "-s", "true"])
.output(&env)?
.stdout()?;

Ok(())
}

#[test]
fn argument_is_invoked_with_dash_c_flag() -> Result<()> {
let shell_path = "/root/my-shell";
Expand Down

0 comments on commit 2146c8c

Please sign in to comment.