Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

useradd, groupadd: system IDs allocated from the bottom of the range

Open
#342 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@jayhemnani9910 is already working on this.

Since Oct 23, 2026.

  • #344 by @jayhemnani9910 — open

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
linux, rust

Research direction

Read the useradd -r and groupadd -r ID allocation paths and compare their system ID behavior with the regular account allocation rule added in #263. Reproduce the listed command sequences, including the explicit UID and deletion cases, and check how the allocation handles occupied IDs and gaps. Done means system IDs follow the GNU ordering described in the issue; pull request #344 is already open.

Written by the indexing model from the issue text.

Description

useradd -r and groupadd -r hand out the lowest free ID in SYS_UID_MIN..SYS_UID_MAX. GNU shadow 4.17.4 (Ubuntu 26.04) counts down from the top:

# useradd -r a; useradd -r b; id -u a b
GNU:        999 998
shadow-rs:  101 102
# groupadd -r ga; getent group ga
GNU:        ga:x:999:
shadow-rs:  ga:x:101:

GNU goes one below the lowest system ID already in use (after useradd -r -u 500 x the next is 499, and after deleting the newest system user the next one still gets a fresh ID), and fills the highest gap once the bottom of the range is reached. Regular accounts already follow the matching rule upwards since #263 (one past the highest in use).

The same sequence of commands gives different IDs than on a GNU system.

shadow-rs main 2e1032a.

Dominant language
Rust
Stars
17
Forks
10
Avg merge
15h 14m
Merged PRs (30d)
15

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/shadow

All issues in uutils/shadow

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.