jfarcand    2003/03/03 07:56:26

  Modified:    jasper2/src/share/org/apache/jasper/runtime
                        PageContextImpl.java
  Log:
  Add missing AccesController.doPrivileged block.
  
  Revision  Changes    Path
  1.45      +22 -5     
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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- PageContextImpl.java      15 Feb 2003 00:24:22 -0000      1.44
  +++ PageContextImpl.java      3 Mar 2003 15:56:26 -0000       1.45
  @@ -63,6 +63,7 @@
   
   import java.io.*;
   import java.security.AccessController;
  +import java.security.PrivilegedAction;
   import java.security.PrivilegedExceptionAction;
   import java.security.PrivilegedActionException;
   import java.util.EmptyStackException;
  @@ -541,13 +542,29 @@
            response = ((ServletResponseWrapperInclude)response).getResponse();
           }
   
  -        String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  +        final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
           String includeUri
               = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
  +        
  +        final ServletResponse fresponse = response;
  +        final ServletRequest frequest = request;
  +        
           if (includeUri != null)
               request.removeAttribute(Constants.INC_SERVLET_PATH);
           try {
  -            context.getRequestDispatcher(path).forward(request, response);
  +            if (System.getSecurityManager() != null){
  +                AccessController.doPrivileged(new PrivilegedExceptionAction(){      
              
  +                    public Object run() throws ServletException, IOException{
  +                        context.getRequestDispatcher(path).forward(frequest, 
  +                                                                   fresponse);
  +                        return (null);
  +                    }                    
  +                });
  +            } else {
  +                context.getRequestDispatcher(path).forward(request, response);
  +            } 
  +        } catch(PrivilegedActionException e){
  +            ;                    
           } finally {
               if (includeUri != null)
                   request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to