Skip to content

Commit ddc4030

Browse files
test for SignalState (#1465)
Adding test related to this issue #1462 to check the consistency of the PR #1420 related to the issue #1263
1 parent 391fd83 commit ddc4030

File tree

1 file changed

+13
-0
lines changed
  • test-framework/sudo-compliance-tests/src/sudo

1 file changed

+13
-0
lines changed

test-framework/sudo-compliance-tests/src/sudo/misc.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,16 @@ fn rootpw_takes_priority_over_targetpw() {
400400
.output(&env);
401401
assert!(!output.status().success());
402402
}
403+
404+
#[test]
405+
fn signal_handlers_should_be_restored_before_execve() {
406+
let env = Env([SUDOERS_ALL_ALL_NOPASSWD]).build();
407+
408+
let stdout = Command::new("/bin/sh")
409+
.args(["-c", "(false | timeout 1 sudo head /dev/tty); true"])
410+
.tty(true)
411+
.output(&env)
412+
.stdout();
413+
414+
assert_eq!(stdout, "");
415+
}

0 commit comments

Comments
 (0)