This is an automated email from the ASF dual-hosted git repository.
remm 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 16ef83ac5c Only add the servlet context attribute if the realm is on
the context
16ef83ac5c is described below
commit 16ef83ac5c07bf839be3350742d2c87173034da7
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 a38214cca8..d5ba7dff0d 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -5038,22 +5038,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]