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

[master] Prevent possible KeyError exception on calling salt.utils.user.get_group_dict #64599

Merged
merged 11 commits into from
Aug 18, 2023

Conversation

vzhestkov
Copy link
Contributor

What does this PR do?

What issues does this PR fix or reference?

Fixes: #62377 (the fix was merged already) with #62378, but this change is addressing specific corner case when the user has imporper duplicate of the group.

Steps to reproduce the issue:
Add the following entry to /etc/group:

+:::

And set group: files compat in /etc/nsswitch.conf
Note: it's not a proper configuration, but a way to reproduce the issue appearing on some of the system having NIS configured.

Previous Behavior

Possible KeyError exception on calling salt.utils.user.get_group_dict if user has improper duplicate group assigned.

KeyError: "getgrnam(): name not found: '+'"

New Behavior

Ignoring such group entry.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@vzhestkov vzhestkov requested a review from a team as a code owner July 5, 2023 14:32
@vzhestkov vzhestkov requested review from twangboy and removed request for a team July 5, 2023 14:32
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Prevent possible KeyError exception on calling salt.utils.user.get_group_dict [master] Prevent possible KeyError exception on calling salt.utils.user.get_group_dict Jul 5, 2023
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 14:51 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 14:51 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 14:53 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 14:54 — with GitHub Actions Inactive
for the user having improper duplicate group
@vzhestkov vzhestkov force-pushed the handle-keyerror-on-grp.getgrnam branch from 802d1c3 to 0fbfdc8 Compare July 5, 2023 15:26
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 15:44 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 15:44 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 15:45 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 15:45 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 16:01 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 16:05 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:32 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:32 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:32 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:32 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:32 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:32 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:51 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:51 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:51 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:51 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 5, 2023 18:52 — with GitHub Actions Inactive
@vzhestkov vzhestkov requested a review from twangboy July 19, 2023 11:07
@vzhestkov vzhestkov temporarily deployed to ci July 19, 2023 11:21 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 19, 2023 11:21 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 19, 2023 11:21 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 19, 2023 11:21 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 19, 2023 11:37 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 19, 2023 11:46 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 31, 2023 13:39 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 31, 2023 13:39 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 31, 2023 13:39 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 31, 2023 13:39 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 31, 2023 13:56 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci July 31, 2023 14:02 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 08:28 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 08:28 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 08:29 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 08:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 08:46 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 08:49 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 11:15 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 11:15 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 11:15 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 11:15 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 11:15 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci August 9, 2023 11:15 — with GitHub Actions Inactive
@Ch3LL Ch3LL merged commit 478ed70 into saltstack:master Aug 18, 2023
321 checks passed
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.

[BUG] groups with duplicate GIDs are not returned by get_group_list
4 participants