Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/uu/chroot/src/chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ pub fn uu_app() -> Command {
.arg(
Arg::new(options::GROUPS)
.long(options::GROUPS)
.overrides_with(options::GROUPS)
.help("Comma-separated list of groups to switch to")
.value_name("GROUP1,GROUP2..."),
)
Expand Down
16 changes: 16 additions & 0 deletions tests/by-util/test_chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ fn test_no_such_directory() {
.code_is(125);
}

#[test]
fn test_multiple_group_args() {
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
at.mkdir("id");

if let Ok(result) = run_ucmd_as_root(
&ts,
&["--groups='invalid ignored'", "--groups=''", "/", "id", "-G"],
) {
result.success().stdout_is("0");
} else {
print!("Test skipped; requires root user");
}
}

#[test]
fn test_invalid_user_spec() {
let ts = TestScenario::new(util_name!());
Expand Down
Loading