1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #7123 from AnirbanHalder654322/chroot_stuff

chroot: make group option self overwriting
This commit is contained in:
Sylvestre Ledru 2025-01-12 01:42:29 +01:00 committed by GitHub
commit 70cc905592
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View file

@ -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..."),
)

View file

@ -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!());