Skip to content

chroot: fails to parse valid userspec of the form uid: or :gid #7040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfinkels opened this issue Dec 31, 2024 · 0 comments · Fixed by #7043
Closed

chroot: fails to parse valid userspec of the form uid: or :gid #7040

jfinkels opened this issue Dec 31, 2024 · 0 comments · Fixed by #7043

Comments

@jfinkels
Copy link
Collaborator

jfinkels commented Dec 31, 2024

Environment: Ubuntu 20.04, main branch (git commit a3b7a08), GNU coreutils v8.30

Steps to reproduce:

sudo chroot --userspec=65534: / pwd

What happens now: uutils chroot fails with

chroot: invalid userspec: '65534:'

What I expected to happen: GNU chroot succeeds and prints

/

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

The same issue occurs if you provide only the group ID, as in --userspec=:65534.

@jfinkels jfinkels changed the title chroot: fails to parse valid userspec of the form uid: chroot: fails to parse valid userspec of the form uid: or :gid Dec 31, 2024
jfinkels added a commit to jfinkels/coreutils that referenced this issue Dec 31, 2024
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.

Closes uutils#7040.
jfinkels added a commit to jfinkels/coreutils that referenced this issue Dec 31, 2024
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.

Closes uutils#7040.
jfinkels added a commit to jfinkels/coreutils that referenced this issue Dec 31, 2024
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.

Closes uutils#7040.
jfinkels added a commit to jfinkels/coreutils that referenced this issue Dec 31, 2024
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.

Closes uutils#7040.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant