This is an automated email from the ASF dual-hosted git repository.
remm 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 51a4c8efcf Only add the servlet context attribute if the realm is on
the context
51a4c8efcf is described below
commit 51a4c8efcfc925a1744b5a1290feca30ed52cff2
Author: remm <[email protected]>
AuthorDate: Thu Nov 17 11:35:40 2022 +0100
Only add the servlet context attribute if the realm is on the context
Partial revert.
---
java/org/apache/catalina/core/StandardContext.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/java/org/apache/catalina/core/StandardContext.java
b/java/org/apache/catalina/core/StandardContext.java
index f1cbf86aa9..243c18b1b0 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -5105,22 +5105,19 @@ public class StandardContext extends ContainerBase
if (realm instanceof Lifecycle) {
((Lifecycle) realm).start();
}
- }
- realm = getRealm();
- if (null != realm) {
// Place the CredentialHandler into the ServletContext so
// applications can have access to it. Wrap it in a "safe"
// handler so application's can't modify it.
CredentialHandler safeHandler = new CredentialHandler() {
@Override
public boolean matches(String inputCredentials, String
storedCredentials) {
- return
getRealm().getCredentialHandler().matches(inputCredentials, storedCredentials);
+ return
getRealmInternal().getCredentialHandler().matches(inputCredentials,
storedCredentials);
}
@Override
public String mutate(String inputCredentials) {
- return
getRealm().getCredentialHandler().mutate(inputCredentials);
+ return
getRealmInternal().getCredentialHandler().mutate(inputCredentials);
}
};
context.setAttribute(Globals.CREDENTIAL_HANDLER,
safeHandler);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]