You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2003/09/19 21:29:15 UTC
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java
jfarcand 2003/09/19 12:29:15
Modified: jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
Log:
Add missing doPrivileged block.
Revision Changes Path
1.53 +21 -8 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
Index: PageContextImpl.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- PageContextImpl.java 2 Sep 2003 21:39:59 -0000 1.52
+++ PageContextImpl.java 19 Sep 2003 19:29:15 -0000 1.53
@@ -64,6 +64,7 @@
import java.io.IOException;
import java.io.Writer;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Enumeration;
@@ -399,12 +400,24 @@
return 0;
}
- public Object findAttribute(String name) {
+ public Object findAttribute(final String name) {
+ if (name == null) {
+ throw new NullPointerException(
+ Localizer.getMessage("jsp.error.attribute.null_name"));
+ }
- if (name == null) {
- throw new NullPointerException(
- Localizer.getMessage("jsp.error.attribute.null_name"));
- }
+ if (System.getSecurityManager() != null){
+ return AccessController.doPrivileged(new PrivilegedAction(){
+ public Object run(){
+ return doFindAttribute(name);
+ }
+ });
+ } else {
+ return doFindAttribute(name);
+ }
+ }
+
+ private Object doFindAttribute(String name){
Object o = attributes.get(name);
if (o != null)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org