Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usermod: allow all group types with -G option #397

Merged
merged 1 commit into from Aug 4, 2021

Conversation

ikerexxe
Copy link
Collaborator

@ikerexxe ikerexxe commented Aug 3, 2021

The only way of removing a group from the supplementary list is to use
-G option, and list all groups that the user is a member of except for
the one that wants to be removed. The problem lies when there's a user
that contains both local and remote groups, and the group to be removed
is a local one. As we need to include the remote group with -G option
the command will fail.

This reverts commit 140510d. This way,
it would be possible to remove the remote groups from the supplementary
list.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967641
Resolves: #338

Signed-off-by: Iker Pedrosa ipedrosa@redhat.com

The only way of removing a group from the supplementary list is to use
-G option, and list all groups that the user is a member of except for
the one that wants to be removed. The problem lies when there's a user
that contains both local and remote groups, and the group to be removed
is a local one. As we need to include the remote group with -G option
the command will fail.

This reverts commit 140510d. This way,
it would be possible to remove the remote groups from the supplementary
list.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967641
Resolves: shadow-maint#338

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
@hallyn
Copy link
Member

hallyn commented Aug 4, 2021

So then to replace 140510d, would you want to add an extra cli flag pair to separately specify local/remote groups?

@hallyn hallyn merged commit 1c1e0b0 into shadow-maint:master Aug 4, 2021
@ikerexxe
Copy link
Collaborator Author

ikerexxe commented Aug 5, 2021

No, I think it would be best for usermod to only check the group type if there's a real change to process. For example: to add a new group. If the group was already present nothing should be done about it.

@ikerexxe ikerexxe deleted the revert_local_groups_check branch August 9, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: 'usermod -G' fails if user has any remote groups
2 participants