This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new ed42cb3c72 Fix isAvailable for CombinedRealm
ed42cb3c72 is described below

commit ed42cb3c72e14f4229d7f7e0de339e2b700a6bfb
Author: remm <[email protected]>
AuthorDate: Tue Jun 2 12:27:57 2026 +0200

    Fix isAvailable for CombinedRealm
---
 java/org/apache/catalina/realm/CombinedRealm.java | 6 +++---
 webapps/docs/changelog.xml                        | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/realm/CombinedRealm.java 
b/java/org/apache/catalina/realm/CombinedRealm.java
index 7b54ce7e56..d4d8ba86d2 100644
--- a/java/org/apache/catalina/realm/CombinedRealm.java
+++ b/java/org/apache/catalina/realm/CombinedRealm.java
@@ -387,11 +387,11 @@ public class CombinedRealm extends RealmBase {
     @Override
     public boolean isAvailable() {
         for (Realm realm : realms) {
-            if (!realm.isAvailable()) {
-                return false;
+            if (realm.isAvailable()) {
+                return true;
             }
         }
-        return true;
+        return false;
     }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 07f0322552..3978b76e2c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -227,6 +227,10 @@
         When encoding URLs with the <code>CsrfPreventionFilter</code>, don't 
add
         the nonce to URLs that are known not to require it. (markt)
       </fix>
+      <fix>
+        Fix <code>CombinedRealm</code> <code>isAvailable</code>, it allows
+        authentication if at least one sub realm is available. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to