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

Invalidating initgroups memory cache by a single name does not work #4728

Closed
sssd-bot opened this issue May 2, 2020 · 1 comment
Closed
Assignees
Labels
Closed: Fixed Issue was closed as fixed. Future milestone

Comments

@sssd-bot
Copy link

sssd-bot commented May 2, 2020

Cloned from Pagure issue: https://pagure.io/SSSD/sssd/issue/3718

  • Created at 2018-04-24 16:44:45 by jhrozek
  • Assigned to nobody

I found this bug while working on tests for the nss_ex interface, but even with the help of the design page, I'm not sure what would the best fix be, so I'm filing a ticket.

When a user is being invalidated from the initgroups memory cache, the sss_mmap_cache_invalidate function is passed the input name (e.g. user). Then the code goes to sss_mc_find_record where the name is used to generate the hash and the slot and an entry is found. But then we go to:

582         if (strcmp(key->str, t_key) == 0) {
583             break;
584         }

Which never matches, because the t_key is the unique name in case of the initgroup cache, so the comparison is always false..

There is a crude fix in PR #558 but it's probable that someone else will be doing a proper fix, so filing an issue is safer.

Comments


Comment from pbrezina at 2020-03-13 15:07:59

Metadata Update from @pbrezina:

  • Issue tagged with: Future milestone
@alexey-tikhonov alexey-tikhonov self-assigned this Jun 4, 2020
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Apr 28, 2022
Initgroups MC uses 'lookup_name' as a primary key, not output format.

Based on proposal by Jakub Hrozek in SSSD#558

Resolves: SSSD#4728
@alexey-tikhonov alexey-tikhonov linked a pull request Apr 28, 2022 that will close this issue
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue May 2, 2022
Initgroups MC uses 'lookup_name' as a primary key, not output format.

Based on proposal by Jakub Hrozek in SSSD#558

Resolves: SSSD#4728
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jun 20, 2022
According to the https://sssd.io/contrib/mmap_cache.html#the-initgr-data
one of keys should be a canonical name.

Based on the proposal by Sumit Bose:
SSSD#6128 (comment)

Resolves: SSSD#4728
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jun 21, 2022
According to the https://sssd.io/contrib/mmap_cache.html#the-initgr-data
one of keys should be a canonical name.

Based on the proposal by Sumit Bose:
SSSD#6128 (comment)

Resolves: SSSD#4728
alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jul 1, 2022
According to the https://sssd.io/contrib/mmap_cache.html#the-initgr-data
one of keys should be a canonical name.

Based on the proposal by Sumit Bose:
SSSD#6128 (comment)

Resolves: SSSD#4728
@alexey-tikhonov
Copy link
Member

Pushed PR: #6128

  • master
    • 810d922 - NSS: mem-cache: don't update domains other than the one where an entry was found.
    • cceb136 - NSS: fix initgroups store key (one of)
    • 7abc9cf - NSS: MC: no need to convert name to output format.
    • 1690ae1 - NSS MS: trivial simplification
    • ad7d1de - NSS MC: deleted misleading comment

@alexey-tikhonov alexey-tikhonov added the Closed: Fixed Issue was closed as fixed. label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Fixed Issue was closed as fixed. Future milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants