You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by gl...@locus.apache.org on 2000/08/24 16:25:39 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/context PolicyInterceptor.java

glenn       00/08/24 07:25:36

  Modified:    src/share/org/apache/tomcat/context PolicyInterceptor.java
  Log:
  Added PropertyPermission "line.separator" to default Permissions.
  This Permission is required at runtime by getPageContext() so that
  it can return the pageContext when JSP servlet is started.
  
  Revision  Changes    Path
  1.6       +6 -2      jakarta-tomcat/src/share/org/apache/tomcat/context/PolicyInterceptor.java
  
  Index: PolicyInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/PolicyInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PolicyInterceptor.java	2000/08/18 17:31:44	1.5
  +++ PolicyInterceptor.java	2000/08/24 14:25:33	1.6
  @@ -137,7 +137,11 @@
   	FilePermission fp = new FilePermission(base + "/-", "read");
   	if( fp != null )
   	    p.add((Permission)fp);
  -	
  +	// JspFactory.getPageContext() runs in JSP Context and needs the below
  +	// permission during the init of a servlet generated from a JSP.
  +	PropertyPermission pp = new PropertyPermission("line.separator","read");
  +	if( pp != null )
  +	    p.add((Permission)pp);
       }
       
       public void contextInit( Context context)
  @@ -184,7 +188,7 @@
   		    p.add((Permission)enum.nextElement());
   		}
   	    }
  -	    
  +
   	    ProtectionDomain pd = new ProtectionDomain(cs,p);
   	    context.setProtectionDomain(pd);
   	    // new permissions - added context manager and file to whatever was