tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfarc...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Catalina.java CatalinaService.java
Date Wed, 16 Oct 2002 20:10:01 GMT
jfarcand    2002/10/16 13:10:01

  Modified:    catalina/src/share/org/apache/catalina/startup Catalina.java
                        CatalinaService.java
  Log:
  Refactoring Catalina.java and CatalinaService.java. Merge the code into one class: o.a.c.security.SecurityConfig.
  
  Revision  Changes    Path
  1.7       +9 -28     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Catalina.java	15 Oct 2002 20:44:45 -0000	1.6
  +++ Catalina.java	16 Oct 2002 20:10:01 -0000	1.7
  @@ -69,10 +69,7 @@
   import java.io.FileInputStream;
   import java.io.IOException;
   import java.io.OutputStream;
  -import java.lang.reflect.InvocationTargetException;
  -import java.lang.reflect.Constructor;
   import java.net.Socket;
  -import java.security.Security;
   import java.util.Stack;
   import org.apache.catalina.Container;
   import org.apache.catalina.Lifecycle;
  @@ -80,6 +77,7 @@
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Server;
   import org.apache.catalina.Loader;
  +import org.apache.catalina.security.SecurityConfig;
   import org.apache.commons.digester.Digester;
   import org.apache.commons.digester.Rule;
   import org.apache.tomcat.util.log.SystemLogHandler;
  @@ -479,27 +477,10 @@
               }
           }
   
  -        // If a SecurityManager is being used, set properties for
  -        // checkPackageAccess() and checkPackageDefinition
  -        if( System.getSecurityManager() != null ) {
  -            String access = Security.getProperty("package.access");
  -            if( access != null && access.length() > 0 )
  -                access += ",";
  -            else
  -                access = "sun.,";
  -            Security.setProperty("package.access",
  -                access + "org.apache.catalina.,org.apache.jasper.,org.apache.coyote., org.apache.tomcat.");
  -            String definition = Security.getProperty("package.definition");
  -            if( definition != null && definition.length() > 0 )
  -                definition += ",";
  -            else
  -                definition = "sun.,";
  -            Security.setProperty("package.definition",
  -                // FIX ME package "javax." was removed to prevent HotSpot
  -                // fatal internal errors
  -                definition + "java.,org.apache.catalina.,org.apache.jasper.,org.apache.coyote.,
org.apache.tomcat.");
  -        }
  -
  +        SecurityConfig securityConfig = SecurityConfig.newInstance();
  +        securityConfig.setPackageDefinition();
  +        securityConfig.setPackageAccess();
  +        
           // Replace System.out and System.err with a custom PrintStream
           SystemLogHandler systemlog = new SystemLogHandler(System.out);
           System.setOut(systemlog);
  
  
  
  1.6       +8 -28     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaService.java
  
  Index: CatalinaService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CatalinaService.java	15 Oct 2002 20:44:45 -0000	1.5
  +++ CatalinaService.java	16 Oct 2002 20:10:01 -0000	1.6
  @@ -68,10 +68,6 @@
   import java.io.File;
   import java.io.IOException;
   import java.io.OutputStream;
  -import java.lang.reflect.InvocationTargetException;
  -import java.lang.reflect.Constructor;
  -import java.net.Socket;
  -import java.security.Security;
   import java.util.Stack;
   import org.apache.catalina.Container;
   import org.apache.catalina.Lifecycle;
  @@ -79,6 +75,7 @@
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Server;
   import org.apache.catalina.Loader;
  +import org.apache.catalina.security.SecurityConfig;
   import org.apache.commons.digester.Digester;
   
   //import org.apache.tomcat.util.IntrospectionUtils;
  @@ -264,26 +261,9 @@
                                  "org.apache.naming.java.javaURLContextFactory");
           }
   
  -        // If a SecurityManager is being used, set properties for
  -        // checkPackageAccess() and checkPackageDefinition
  -        if( System.getSecurityManager() != null ) {
  -            String access = Security.getProperty("package.access");
  -            if( access != null && access.length() > 0 )
  -                access += ",";
  -            else
  -                access = "sun.,";
  -            Security.setProperty("package.access",
  -                access + "org.apache.catalina.,org.apache.jasper.,org.apache.coyote.,org.apache.tomcat.");
  -            String definition = Security.getProperty("package.definition");
  -            if( definition != null && definition.length() > 0 )
  -                definition += ",";
  -            else
  -                definition = "sun.,";
  -            Security.setProperty("package.definition",
  -                // FIX ME package "javax." was removed to prevent HotSpot
  -                // fatal internal errors
  -                definition + "java.,org.apache.catalina.,org.apache.jasper.,org.apache.coyote.,org.apache.tomcat.");
  -        }
  +        SecurityConfig securityConfig = SecurityConfig.newInstance();
  +        securityConfig.setPackageDefinition();
  +        securityConfig.setPackageAccess();
   
           // Start the new server
           if (server instanceof Lifecycle) {
  
  
  

--
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