uutils/coreutils

Various problems in different id handling in `id` command

Open

#10.006 geöffnet am 3. Jan. 2026

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (1.852 Forks)batch import
U - idgood first issuereported-canonical

Repository-Metriken

Stars
 (23.246 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 9T 14h) (216 gemergte PRs in 30 T)

Beschreibung

Component

id

Description

Various problems in different id handling in id command

Test / Reproduction Steps

  1. id pretty print crash on malformed group id Issue: uutils id command crashes when given a malformed group id for pretty printing. Test:
sudo setpriv --regid 1337 --clear-groups target/release/id -p
login    root
uid    root

thread 'main' panicked at src/uu/id/src/id.rs:503:49:
called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: "No such id: 1337" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  1. inconsistency in uutil's id & C version Issue: uutils id command shows incorrect group information when the effective group ID is changed. Test: add two users first
useradd -u 2000 u2000 -M
useradd -u 3000 u3000 -M

then

sudo setpriv --reuid 3000 --egid 2000 --clear-groups target/release/id
uid=3000(u3000) gid=0(root) egid=2000(u2000) groups=0(root)
sudo setpriv --reuid 3000 --egid 2000 --clear-groups id
uid=3000(u3000) gid=0(root) egid=2000(u2000) groups=2000(u2000)
  1. Incorrect User ID Handling in uutils id Command Issue: The uutils id command incorrectly displays user information when the effective group ID is changed, leading to inconsistencies with the expected output (pretty print & compact print). Test: add two users first
useradd -u 2000 u2000 -M
useradd -u 3000 u3000 -M

then

sudo setpriv --euid 3000 --egid 2000 --clear-groups target/release/id
uid=0(root) gid=0(root) euid=3000(u3000) egid=2000(u2000) groups=0(root)
sudo setpriv --euid 3000 --egid 2000 --clear-groups target/release/id -p
login    root
uid    root
euid    root
groups    u2000

Contributor Guide