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

usermod: -g does not move home directory files to the new primary group

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

Maintainers usually reply within 1 day

@jayhemnani9910 is already working on this.

Since Oct 24, 2026.

  • #349 by @jayhemnani9910 — open

Assessment

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

Research direction

Start by comparing usermod -g with the existing -u home ownership handling; the issue says -u already changes ownership this way, but gives no file or test paths. Reproduce the shown case and check that only entries in the home directory owned by the previous primary group change group, including symlinks themselves. Confirm other groups, files outside the home directory, and combined -g and -d behavior remain unchanged; pull request #349 is already open.

Written by the indexing model from the issue text.

Description

usermod(8), -g: "Any file from the user's home directory owned by the previous primary group the user was member of will be owned by this new group." shadow-rs changes the GID in /etc/passwd and leaves the files alone:

# useradd -m alice; groupadd dev
# touch /home/alice/f; chown root:alice /home/alice/f
# usermod -g dev alice
# stat -c '%n %U:%G' /home/alice /home/alice/.bashrc /home/alice/f
GNU:        /home/alice alice:dev    /home/alice/.bashrc alice:dev    /home/alice/f root:dev
shadow-rs:  /home/alice alice:alice  /home/alice/.bashrc alice:alice  /home/alice/f root:alice

GNU changes the group of every entry in the home directory that had the old primary group, whoever owns it, including symlinks themselves. Files in other groups, files outside the home directory, and -g together with -d keep their group. -u already re-owns the home directory this way.

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

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.