Skip to content

chroot: rejects multiple instances of --groups option but shouldn't #7063

@jfinkels

Description

@jfinkels

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:

0

Notes: this is causing a failure in the GNU test file tests/chroot/chroot-credentials.sh.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions