New lightweight sysdb_entry_in_cache() helper#8482
Closed
alexey-tikhonov wants to merge 2 commits intoSSSD:masterfrom
Closed
New lightweight sysdb_entry_in_cache() helper#8482alexey-tikhonov wants to merge 2 commits intoSSSD:masterfrom
sysdb_entry_in_cache() helper#8482alexey-tikhonov wants to merge 2 commits intoSSSD:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new lightweight helper function sysdb_entry_in_cache() to check if a user or group entry exists in the cache, and updates sdap_add_incomplete_groups() to use it. This simplifies the code by replacing a more complex sysdb_search_group_by_name() call.
My review found a critical use-after-free vulnerability in the implementation of sysdb_entry_in_cache(). The function attempts to access memory after it has been freed, which could lead to application instability. I've provided a suggestion to fix this issue.
Unlike `sysdb_search_*_by_name()`, which does filter sanitization, subtree search with filter evaluation, and timestamp attribute merge, this helper constructs the DN directly and performs a base-scoped ldb_search with no attributes. This makes it suitable for callers that only need to check entry existence in the cache. Assisted-by: Claude Code (Opus 4.6)
in `sdap_add_incomplete_groups()` This also avoids memory pressure from 'msg' piling on 'tmp_ctx'.
b2fa4fc to
c782153
Compare
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.
and its usage.