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

useradd: -U ignored when USERGROUPS_ENAB is no, accepted with -g

Closed
#343 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #345 by @jayhemnani9910 — merged

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start with the useradd(8) behavior described in the issue and trace how shadow-rs handles USERGROUPS_ENAB, -U, and -g. Compare both reported command cases with GNU shadow 4.17.4; done means explicit -U creates the user’s group despite the setting, and -U with -g is rejected. Pull request #345 is already open.

Written by the indexing model from the issue text.

Description

useradd(8) describes USERGROUPS_ENAB as the default for -U/-N. shadow-rs lets it override an explicit -U, and accepts -U together with -g:

# echo 'USERGROUPS_ENAB no' >> /etc/login.defs   (after removing the existing line)
# useradd -U u1; id u1
GNU:        uid=1001(u1) gid=1001(u1) groups=1001(u1)
shadow-rs:  uid=1001(u1) gid=100(users) groups=100(users)

# useradd -U -g users u2
GNU:        useradd: options -U and -g conflict   (exit 2)
shadow-rs:  exit 0, creates group u2 and makes it the primary group; -g is ignored

GNU shadow 4.17.4 (Ubuntu 26.04). shadow-rs main 2e1032a.

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

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.