Repository navigation
fix(user_ldap): do not cache unknown names in the local mapping cache - #66181
Merged
Merged
Conversation
A web request that looked up a user or group before it was mapped stored the miss in the local cache for 30 days. Mapping it later from the CLI (occ ldap:search, the Sync job) does not touch that cache, so web requests kept treating it as unknown. Only found DNs are cached now, and a cached miss is ignored. Fixes #66003 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
come-nc
approved these changes
Nov 3, 2026
1 task done
Contributor
|
/backport to stable35 |
Contributor
|
/backport to stable34 |
Contributor
|
/backport to stable33 |
AndyScherzinger
approved these changes
Nov 3, 2026
This was referenced Nov 3, 2026
Contributor
|
This pull request has been automatically locked because it has been closed for more than 7 days. As we do not monitor merged or closed pull requests, we are locking this pull request to prevent further comments from getting lost in the noise. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
AbstractMapping::getDNByName()stored a miss (false) in the local cache for 30 days. When a web request looked up a user or group before it was mapped, and the CLI mapped it afterwards (occ ldap:search, theSyncjob), web requests kept treating it as unknown, because the CLI does not write to the local cache. With user_saml and "Only allow authentication if an account exists on some other backend", this locked new AD users out of SSO for up to 30 days.Now only found DNs are cached, and a cached miss left over from an earlier version is ignored and looked up again.
The new test looks a name up through a mapper with a local cache, maps it through a CLI mapper, and checks that a fresh web mapper finds it, that the miss was never cached, and that found DNs are. It fails without the change, for both user and group mapping. All 421 user_ldap unit tests pass with sqlite. The bug and the effect of the cache were reproduced on 33.0.9 with OpenLDAP and with user_saml 8.1.2 (see #66003).
Checklist
3. to review, feature component)stable32)AI (if applicable)