tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java WebappLoader.java
Date Wed, 31 Oct 2001 19:00:43 GMT
remm        01/10/31 11:00:43

  Modified:    catalina/src/share/org/apache/catalina/loader
                        WebappClassLoader.java WebappLoader.java
  Log:
  - Clean up a bit the code.
  - The context root permission wasn't a canonical path.
  
  Revision  Changes    Path
  1.23      +8 -6      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
  Index: WebappClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- WebappClassLoader.java	2001/10/20 18:19:25	1.22
  +++ WebappClassLoader.java	2001/10/31 19:00:43	1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
1.22 2001/10/20 18:19:25 remm Exp $
  - * $Revision: 1.22 $
  - * $Date: 2001/10/20 18:19:25 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
1.23 2001/10/31 19:00:43 remm Exp $
  + * $Revision: 1.23 $
  + * $Date: 2001/10/31 19:00:43 $
    *
    * ====================================================================
    *
  @@ -124,7 +124,7 @@
    *
    * @author Remy Maucherat
    * @author Craig R. McClanahan
  - * @version $Revision: 1.22 $ $Date: 2001/10/20 18:19:25 $
  + * @version $Revision: 1.23 $ $Date: 2001/10/31 19:00:43 $
    */
   public class WebappClassLoader
       extends URLClassLoader
  @@ -402,11 +402,13 @@
        */
       public void setPermissions(String path) {
           if( securityManager != null ) {
  +            Permission permission = null;
               if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
  -                permissionList.add(new JndiPermission(path + "*"));
  +                permission = new JndiPermission(path + "*");
               } else {
  -                permissionList.add(new FilePermission(path + "-","read"));
  +                permission = new FilePermission(path + "-","read");
               }
  +            permissionList.add(permission);
           }
       }
   
  
  
  
  1.16      +12 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WebappLoader.java	2001/10/23 19:11:38	1.15
  +++ WebappLoader.java	2001/10/31 19:00:43	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
1.15 2001/10/23 19:11:38 craigmcc Exp $
  - * $Revision: 1.15 $
  - * $Date: 2001/10/23 19:11:38 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
1.16 2001/10/31 19:00:43 remm Exp $
  + * $Revision: 1.16 $
  + * $Date: 2001/10/31 19:00:43 $
    *
    * ====================================================================
    *
  @@ -119,7 +119,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.15 $ $Date: 2001/10/23 19:11:38 $
  + * @version $Revision: 1.16 $ $Date: 2001/10/31 19:00:43 $
    */
   
   public class WebappLoader
  @@ -809,7 +809,14 @@
   
               String contextRoot = servletContext.getRealPath("/");
               if (contextRoot != null) {
  -                classLoader.setPermissions(contextRoot);
  +                try {
  +                    contextRoot = 
  +                        (new File(contextRoot)).getCanonicalPath() 
  +                        + File.separator;
  +                    classLoader.setPermissions(contextRoot);
  +                } catch (IOException e) {
  +                    // Ignore
  +                }
               }
   
               URL classesURL =
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message