ASF Bugzilla – Attachment 32944 Details for
Bug 58116
[PATCH] Running with SecurityManager: CometProcessor servlets throw NoSuchMethodException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Comet SecurityManager patch
comet_security_manager.patch (text/plain), 3.69 KB, created by
Johno Crawford
on 2015-07-29 18:05:06 UTC
(
hide
)
Description:
Comet SecurityManager patch
Filename:
MIME Type:
Creator:
Johno Crawford
Created:
2015-07-29 18:05:06 UTC
Size:
3.69 KB
patch
obsolete
>Index: java/org/apache/catalina/security/SecurityUtil.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>windows-1252 >=================================================================== >--- java/org/apache/catalina/security/SecurityUtil.java (revision 9b4508a3b5b4d5ffe0ca0826904df30915a307b8) >+++ java/org/apache/catalina/security/SecurityUtil.java (revision ) >@@ -35,6 +35,8 @@ > import javax.servlet.http.HttpSession; > > import org.apache.catalina.Globals; >+import org.apache.catalina.comet.CometFilter; >+import org.apache.catalina.comet.CometProcessor; > import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > /** >@@ -148,18 +150,21 @@ > Principal principal) > throws java.lang.Exception{ > >+ // CometProcessor servlets must not be cached as Servlet or NoSuchMethodException will be thrown. >+ Class<?> targetType = targetObject instanceof CometProcessor ? CometProcessor.class : Servlet.class; >+ > Method method = null; >- Method[] methodsCache = classCache.get(Servlet.class); >+ Method[] methodsCache = classCache.get(targetType); > if(methodsCache == null) { > method = createMethodAndCacheIt(methodsCache, >- Servlet.class, >+ targetType, > methodName, > targetParameterTypes); > } else { > method = findMethod(methodsCache, methodName); > if (method == null) { > method = createMethodAndCacheIt(methodsCache, >- Servlet.class, >+ targetType, > methodName, > targetParameterTypes); > } >@@ -228,18 +233,21 @@ > Principal principal) > throws java.lang.Exception{ > >+ // CometFilter servlets must not be cached as Filter or NoSuchMethodException will be thrown. >+ Class<?> targetType = targetObject instanceof CometFilter ? CometFilter.class : Filter.class; >+ > Method method = null; >- Method[] methodsCache = classCache.get(Filter.class); >+ Method[] methodsCache = classCache.get(targetType); > if(methodsCache == null) { > method = createMethodAndCacheIt(methodsCache, >- Filter.class, >+ targetType, > methodName, > targetParameterTypes); > } else { > method = findMethod(methodsCache, methodName); > if (method == null) { > method = createMethodAndCacheIt(methodsCache, >- Filter.class, >+ targetType, > methodName, > targetParameterTypes); > } >@@ -253,7 +261,7 @@ > * Perform work as a particular </code>Subject</code>. Here the work > * will be granted to a <code>null</code> subject. > * >- * @param methodName the method to apply the security restriction >+ * @param method the method to apply the security restriction > * @param targetObject the <code>Servlet</code> on which the method will > * be called. > * @param targetArguments <code>Object</code> array contains the
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 58116
:
32892
| 32944