Support emptying groups when no members in list and auth_membership is true - #24
Open
legooolas wants to merge 3 commits into
Open
Support emptying groups when no members in list and auth_membership is true#24legooolas wants to merge 3 commits into
auth_membership is true#24legooolas wants to merge 3 commits into
Conversation
…M ''" empties the group as expected.
Author
|
I need to test this more on different platforms, but it's working as a first-pass change on my Ubuntu 22.04 test box :) |
Author
|
Fixes #20 |
Author
|
Tested on Ubuntu 18.04/20.04/22.04, CentOS 6, CentOS 7, Rocky 8 and all working OK, so presumably will work on pretty much everything this module already worked on :) |
op-ct
reviewed
Nov 30, 2023
op-ct
left a comment
Member
There was a problem hiding this comment.
Thanks, @legooolas!
The code lgtm 👍, but be aware that it might take a while before someone is free to add unit tests for this prior to a release—however, we'd happily accept any tests if they were contributed!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This just allows passing through of the empty
to_be_addedlist to thegpasswd -Marguments list, which causes the group to indeed be emptied successfully.(Also moved the "Ignoring unknown user" debug print to the rescue block in
members_insync?, as this is where the control jumps to on getpwuid or getpwnam throwing an exception when the user isn't found. No logic change, just that the message was printed when users were found rather than not 👍 )