Environment: Ubuntu 20.04, uutils main branch (git commit 88cdf16), GNU coreutils v8.30.
Steps to reproduce:
sudo chroot --groups='invalid ignored' --groups='' / id -G
What happens now: the argument parsing in uutils chroot complains that the argument cannot be used multiple time:
error: the argument '--groups <GROUP1,GROUP2...>' cannot be used multiple times
Usage: ./target/debug/chroot [OPTION]... NEWROOT [COMMAND [ARG]...]
For more information, try '--help'.
What I expected to happen: GNU chroot takes only the last instance of --groups and successfully outputs the result of id -G:
Notes: this is causing a failure in the GNU test file tests/chroot/chroot-credentials.sh.