groupmod -U: members change in /etc/group but not in /etc/gshadow
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #369 by @jayhemnani9910 — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Start in src/uu/groupmod/src/groupmod.rs, especially around line 178 where the issue says gshadow is opened only for -n and -p. Trace how -U and -a update the group member list, then compare the result in /etc/group and /etc/gshadow; done means both files reflect added and removed members consistently.
Written by the indexing model from the issue text.
Description
groupmod -U updates the member list in /etc/group and leaves the one in /etc/gshadow as it was, so the two files disagree:
# groupadd g1
# gpasswd -a root g1
# groupmod -U daemon g1
# grep ^g1 /etc/group /etc/gshadow
/etc/group:g1:x:1001:daemon
/etc/gshadow:g1:!::root
# grpck -r
'daemon' is a member of the 'g1' group in /etc/group but not in /etc/gshadow
'root' is a member of the 'g1' group in /etc/gshadow but not in /etc/group
GNU groupmod 4.17.4 writes daemon to both files. groupmod -a -U has the same gap. A user removed with -U stays a member in gshadow.
groupmod opens gshadow only for -n and -p (src/uu/groupmod/src/groupmod.rs:178), so the member change never reaches it. I have a fix that applies the same -U/-a change to the gshadow entry; happy to open a PR.
GNU shadow 4.17.4 (Ubuntu 26.04). shadow-rs main 1b2d8de.
- Dominant language
- Rust
- Stars
- 18
- Forks
- 10
- Avg merge
- 1d 15m
- Merged PRs (30d)
- 37
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 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
uutils/shadow#362 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
storytold/craft-libs#471 ·
Maintainers usually reply within 1 day
-
enhancement parity priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
storytold/gridcraft#3053 · 1 comment ·
Maintainers usually reply within 2 days
-
bug file-compat parity priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
i18n multiple issues parity priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
storytold/vectorcraft#4943 · 3 comments ·
Maintainers usually reply within 1 day