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

usermod: -u and -g exit 0 on a symlinked home, GNU exits 12

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

The issue references PR #349 and commit 49bf35e as the current behavior. Read the usermod command logic for -u/-g with symlinked home directories to find where exit status is set. Done means shadow-rs prints the GNU-style error and exits 12, like GNU shadow 4.17.4.

Written by the indexing model from the issue text.

Description

When the home directory is a symlink, GNU usermod updates /etc/passwd, leaves the files alone, prints an error and exits 12 for -u and -g. shadow-rs updates /etc/passwd, leaves the files alone too (with #349), and exits 0:

# useradd -m alice; groupadd dev
# mv /home/alice /data/alice; ln -s /data/alice /home/alice
# usermod -g dev alice; echo $?
GNU:        usermod: Failed to change ownership of the home directory
            12
shadow-rs:  0

Same with usermod -u 1500 alice and usermod -u 1500 -g dev alice. A home directory owned by root is skipped quietly by both, with exit 0.

GNU shadow 4.17.4 (Ubuntu 26.04). shadow-rs #349 (49bf35e).

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

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.