usermod: -g does not move home directory files to the new primary group
Maintainers usually reply within 1 day
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
- Domain
- backend, operating-systems
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
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/shadow
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
usermod: -m/--move-home is not implementedPossibly taken @jayhemnani9910 claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
useradd, groupadd: system IDs allocated from the bottom of the rangePossibly taken @jayhemnani9910 claimed this 2 days ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 3/5 1-2 days Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
bug easy good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lacs-project/sysknife#659 ·
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
registrystack/registry-stack#2431 ·
Maintainers usually reply within 1 day
-
contribution
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
farion1231/cc-switch#8863 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
DioxusLabs/dioxus#6006 ·
Maintainers usually reply within 1 day