-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-12041) Handle libuser's unavailability in Fedora 40 #9346
Conversation
shubhamshinde360
commented
May 13, 2024
•
edited
Loading
edited
- Starting from version 40, Fedora does not have the lgroup* commands available due to deprecation of libuser: https://fedoraproject.org/wiki/Changes/LibuserDeprecation.
- groupadd relies on libuser to add/purge members to/from groups.
- Add manages_members feature to Fedora 40 and above since groupmod can add members to groups now. Historically, it was unable to do so that's why puppet used lgroupmod for it.
- Handle flags for lgroupmod (-M) and groupmod (-aU) commands properly.
- Only use lgroup* commands if libuser is supported.
- When libuser is not supported, members should be purged using the usermod command. Since usermod does not support comma separated list of users they should be removed one by one.
8256d3b
to
dae7ca8
Compare
Could you add a link to https://fedoraproject.org/wiki/Changes/LibuserDeprecation in your commit message for future reference? Also please squash the code and test changes so that future Also found a good background thread, including a reference to Puppet https://lists.fedoraproject.org/archives/list/[email protected]/thread/M6UATQKVB7IQKJ6EIOAVPYGJB5KQM7VN/ One thing I didn't realize is that libuser can still be installed from epel (since it's deprecated, but not removed yet). One thing that doesn't seem right. Puppet can either manage the complete list of group members or a partial list. For example, you may want to ensure the To differentiate between these cases, the First create a group, two users and add them to the group:
Notice if we remove one of the users, puppet doesn't do anything:
But if we specify
Based on the thread, we may be able to purge specific users with |
854fcbb
to
9a31c7b
Compare
- Starting from version 40, Fedora does not have the lgroup* commands available due to deprecation of libuser: https://fedoraproject.org/wiki/Changes/LibuserDeprecation. - groupadd relies on libuser to add/purge members to/from groups. - Add manages_members feature to Fedora 40 and above since groupmod can add members to groups now. Historically, it was unable to do so that's why puppet used lgroupmod for it. - Handle flags for lgroupmod (-M) and groupmod (-aU) commands properly. - Only use lgroup* commands if libuser is supported. - When libuser is not supported, members should be purged using the usermod command. Since usermod does not support comma separated list of users they should be removed one by one.
9a31c7b
to
6a1db9e
Compare
Thanks @joshcooper for pointing this out, I have added a way to work around the purge_members issue with the 'usermod -rG' command. Since usermod is not allowing a list of comma separated list of members, I had to loop on the members and remove them one by one. Please let me know your thoughts on this. |
Also, not sure if we should also look at the direction of installing libuser from epel for Fedora 40. I guess puppet could try to look at the EPEL repo and try to find libuser in case it is missing. But not sure if thats a good way to go. It would be great if you could share your thoughts on this too. Thanks! |
Did a quick sanity check on RHEL for any impact. It works fine without any issues. |
Hey @joshcooper, @cthorn42, @mhashizume |
Picked up several linux based platforms with puppet component pointed to these changes, all platforms ran the puppet tests successfully |
Successfully created backport PR for |