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

Fix groups #340

Merged
merged 3 commits into from Oct 6, 2021
Merged

Fix groups #340

merged 3 commits into from Oct 6, 2021

Conversation

jreidinger
Copy link
Member

Issue: difference between old and new users in group is not detectable.

Fix: ensure it creates original group even when just syncing from edit user. And also ensure it do deep clone.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1311494142

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 56.193%

Totals Coverage Status
Change from base Build 1307493660: 0.0%
Covered Lines: 2849
Relevant Lines: 5070

💛 - Coveralls

@ancorgs
Copy link
Contributor

ancorgs commented Oct 6, 2021

The change makes sense, but at first glance I don't see why this works correctly in the master branch (I tested it manually and seemed to work) without this fix.

@jreidinger
Copy link
Member Author

@ancorgs well, what I expect is that it is enough that group reason is "user_change" https://github.com/yast/yast-users/blob/master/src/modules/Users.pm#L1796
and then write just write new list of users there if there is such modified flag.
On other hand linux writer check different between original and new config and in this case it result that both userlists are same and so do not write modified users list - https://github.com/yast/yast-users/blob/master/src/lib/y2users/linux/users_writer.rb#L334

@ancorgs
Copy link
Contributor

ancorgs commented Oct 6, 2021

@jreidinger got it. Makes sense, the version in master is "configuration-file-driven". It regenerates /etc/passwd and/or /etc/group as a whole when something changes and I guess there are many ways in which such a rewrite can be triggered.

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jreidinger jreidinger merged commit 2f4ef8f into y2users Oct 6, 2021
@jreidinger jreidinger deleted the fix_groups branch October 6, 2021 12:09
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.

None yet

3 participants