You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/09/30 11:41:48 UTC

(tomcat) branch 9.0.x updated: Follow-up to 87ed9d47

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

markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 6c2cc55c38 Follow-up to 87ed9d47
6c2cc55c38 is described below

commit 6c2cc55c38eb0af9ffe3fb608ce08dc04ede9510
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 30 12:36:15 2026 +0100

    Follow-up to 87ed9d47
    
    - always set the callback result
---
 .../org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
index b5ea0f476f..f22e5e0ffd 100644
--- a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
@@ -83,6 +83,7 @@ public class CallbackHandlerImpl implements CallbackHandler, Contained {
                     GroupPrincipalCallback gpc = (GroupPrincipalCallback) callback;
                     groups = gpc.getGroups();
                 } else if (callback instanceof PasswordValidationCallback) {
+                    PasswordValidationCallback pvc = (PasswordValidationCallback) callback;
                     if (container == null) {
                         log.warn(sm.getString("callbackHandlerImpl.containerMissing", callback.getClass().getName()));
                         passwordValidationFailed = true;
@@ -91,15 +92,14 @@ public class CallbackHandlerImpl implements CallbackHandler, Contained {
                                 container.getName()));
                         passwordValidationFailed = true;
                     } else {
-                        PasswordValidationCallback pvc = (PasswordValidationCallback) callback;
                         principal =
                                 container.getRealm().authenticate(pvc.getUsername(), String.valueOf(pvc.getPassword()));
-                        pvc.setResult(principal != null);
                         if (principal == null) {
                             passwordValidationFailed = true;
                         }
                         subject = pvc.getSubject();
                     }
+                    pvc.setResult(!passwordValidationFailed);
                 } else {
                     log.error(sm.getString("callbackHandlerImpl.jaspicCallbackMissing", callback.getClass().getName()));
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org