costin      01/08/21 20:02:46

  Modified:    src/share/org/apache/tomcat/modules/config
                        PolicyInterceptor.java
  Log:
  Better messages, more checks.
  
  Revision  Changes    Path
  1.12      +10 -3     
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/PolicyInterceptor.java
  
  Index: PolicyInterceptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/PolicyInterceptor.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PolicyInterceptor.java    2001/08/21 05:10:38     1.11
  +++ PolicyInterceptor.java    2001/08/22 03:02:46     1.12
  @@ -98,12 +98,16 @@
                               BaseInterceptor module)
        throws TomcatException
       {
  -     // Just override parent 
  +     // Just override parent
       }
   
       /** Set the security manager, so that policy will be used
        */
       public void engineInit(ContextManager cm) throws TomcatException {
  +     initSecurityManager( cm );
  +    }
  +    
  +    public void initSecurityManager(ContextManager cm) throws TomcatException {
        if( System.getSecurityManager() != null ) return;
        try {
            if( null == System.getProperty("java.security.policy")) {
  @@ -134,13 +138,16 @@
            Class c=Class.forName(securityManagerClass);
            Object o=c.newInstance();
            Policy.getPolicy().refresh();
  +         
            System.setSecurityManager((SecurityManager)o);
  -         log("Security Manager set to " + securityManagerClass +
  -             " " + System.getProperty("java.security.policy"));
  +         log("SANDBOX mode enabled");
  +         if( ! "java.lang.SecurityManager".equals(securityManagerClass) )
  +             log( "Security Manager=" + securityManagerClass);
        } catch( ClassNotFoundException ex ) {
            log("SecurityManager Class not found: " +
                               securityManagerClass, Log.ERROR);
        } catch( Exception ex ) {
  +         ex.printStackTrace();
               log("SecurityManager Class could not be loaded: " +
                               securityManagerClass, Log.ERROR);
        }
  
  
  

Reply via email to