Repository navigation
usermod: add -r/--remove to leave the groups given with -G - #370
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
@jayhemnani9910 thanks for #366, #369 and this one. I checked each against Debian's packaged shadow 4.17.4 and they match: Before I merge anything more, two things I need from you. They apply to all your open and future PRs here.
Once I have the confirmation, I'll merge #366, #369 and #370. Then #350 after its rebase on #359. |
|
|
Thanks, that's exactly what I needed. One gap: the list covers your open PRs only. Can you confirm the same holds for the ones already merged: #339, #341, #344, #345, #349, #355, #356 and #357? Once you do, I'll merge #366, #369 and #370, then #350 after its rebase. On pace: three open at a time is fine, you don't have to stop. Mark #372 ready when you like. |
|
Yes, the same holds for the merged ones (#339, #341, #344, #345, #349, #355, #356, #357): the same reference material, and neither I nor any tool read, retrieved, was given or recalled code from shadow-maint/shadow or util-linux for any of them. Thanks on the pace. I'll mark #372 ready once these are in. |
Fixes #368
-rremoves the user from the groups listed with-Gand keeps the others, in /etc/group and /etc/gshadow. It needs-Gand can't be used with-a, as in GNU usermod. The plain-Gand-a -Gpaths now go through the same closure for both files; their behaviour is unchanged.Tests:
test_remove_from_groupsfails without the change; a unit test covers the-Grequirement and the conflict with-a. Root suite in ubuntu:26.04: 960 passed, 0 failed; clippy and fmt clean. Against GNU usermod 4.17.4:-rGwith one or more groups, a group the user is not in, a GID, a missing group, and-lwith-rGgive the same files and exit codes.AI tools assisted with this contribution.