fix: unreachable LDAP backend must not block local/DB account login#62220
Open
mvanhorn wants to merge 1 commit into
Open
fix: unreachable LDAP backend must not block local/DB account login#62220mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
mvanhorn
requested review from
Altahrim,
icewind1991,
leftybournes and
salmart-dev
and removed request for
a team
July 16, 2026 04:55
9 tasks
CarlSchwan
reviewed
Jul 16, 2026
Member
There was a problem hiding this comment.
Suggested change
| $this->logger->warning('Unable to check password against user backend:' . $backend instanceof IUserBackend ? $backend->getBackendName() : get_class($backend), ['exception' => $e]); |
Member
There was a problem hiding this comment.
Suggested change
| $this->logger->warning('Unable to check password against user backend:' . $backend instanceof IUserBackend ? $backend->getBackendName() : get_class($backend), ['exception' => $e]); |
Member
There was a problem hiding this comment.
Need to be adapted too afterward
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.
Summary
In
OC\User\Manager::checkPasswordNoLogging()the twoforeach ($backends ...)loops call$backend->checkPassword()directly; when the LDAP backend (OCA\User_LDAP\User_Proxy) cannot reach the server it throwsOC\ServerNotAvailableException, which propagates uncaught out ofSession::loginWithPassword()(the login command chain catches only Session/Token exceptions), surfacing as the reported 500 and preventing any later backend (the localOC\User\Databasebackend that would authenticate the local admin) from being tried. Wrap each per-backendcheckPassword()call in atry/catch (\OC\ServerNotAvailableException $e)that logs a warning via the injected logger andcontinues to the next backend, so an unavailable backend degrades gracefully instead of blocking login for users of other backends. The exception is logged (not silently swallowed) to preserve diagnosability, and credential validation for every backend is unchanged, so this is a purely defensive hardening with no authentication-bypass surface. Adduse OC\ServerNotAvailableException;(or fully-qualify) sinceManagerlives in theOC\Usernamespace.Checklist
AI (if applicable)