glenn       02/03/20 04:29:56

  Modified:    catalina/src/share/org/apache/catalina/core
                        LocalStrings.properties StandardHost.java
                        StandardHostDeployer.java
               catalina/src/share/org/apache/catalina/startup
                        HostConfig.java
  Log:
  Add the Host deployXML attribute. If false, Context config XML files
  found in the Host's appBase are not deployed.  Default is true.
  
  When Catalina deploys an application in runs with the security
  policy settings of the server.  In a virtual web hosting environment
  this could allow the virtual host outside of its security sandbox.
  
  Revision  Changes    Path
  1.45      +1 -0      
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- LocalStrings.properties   9 Dec 2001 22:03:11 -0000       1.44
  +++ LocalStrings.properties   20 Mar 2002 12:29:55 -0000      1.45
  @@ -90,6 +90,7 @@
   standardHost.alreadyStarted=Host has already been started
   standardHost.appBase=Application base directory {0} does not exist
   standardHost.configRequired=URL to configuration file is required
  +standardHost.configNotAllowed=Use of configuration file is not allowed
   standardHost.installing=Installing web application at context path {0} from URL {1}
   standardHost.installingWAR=Installing web application from URL {0}
   standardHost.installError=Error deploying application at context path {0}
  
  
  
  1.26      +30 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- StandardHost.java 5 Mar 2002 02:01:02 -0000       1.25
  +++ StandardHost.java 20 Mar 2002 12:29:55 -0000      1.26
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
 1.25 2002/03/05 02:01:02 craigmcc Exp $
  - * $Revision: 1.25 $
  - * $Date: 2002/03/05 02:01:02 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
 1.26 2002/03/20 12:29:55 glenn Exp $
  + * $Revision: 1.26 $
  + * $Date: 2002/03/20 12:29:55 $
    *
    * ====================================================================
    *
  @@ -95,7 +95,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.25 $ $Date: 2002/03/05 02:01:02 $
  + * @version $Revision: 1.26 $ $Date: 2002/03/20 12:29:55 $
    */
   
   public class StandardHost
  @@ -162,6 +162,12 @@
   
   
       /**
  +     * deploy Context XML config files property.
  +     */
  +    private boolean deployXML = true;
  +
  +
  +    /**
        * The Java class name of the default error reporter implementation class 
        * for deployed web applications.
        */
  @@ -329,6 +335,26 @@
           this.contextClass = contextClass;
           support.firePropertyChange("contextClass",
                                      oldContextClass, this.contextClass);
  +
  +    }
  +
  +
  +    /**
  +     * Deploy XML Context config files flag accessor.
  +     */
  +    public boolean isDeployXML() {
  +
  +        return (deployXML);
  +
  +    }
  +
  +
  +    /**
  +     * Deploy XML Context config files flag mutator.
  +     */
  +    public void setDeployXML(boolean deployXML) {
  +
  +        this.deployXML = deployXML;
   
       }
   
  
  
  
  1.8       +8 -4      
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java
  
  Index: StandardHostDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StandardHostDeployer.java 13 Mar 2002 01:26:49 -0000      1.7
  +++ StandardHostDeployer.java 20 Mar 2002 12:29:55 -0000      1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
 1.7 2002/03/13 01:26:49 craigmcc Exp $
  - * $Revision: 1.7 $
  - * $Date: 2002/03/13 01:26:49 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
 1.8 2002/03/20 12:29:55 glenn Exp $
  + * $Revision: 1.8 $
  + * $Date: 2002/03/20 12:29:55 $
    *
    * ====================================================================
    *
  @@ -91,7 +91,7 @@
    * <code>StandardHost</code> implementation class.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2002/03/13 01:26:49 $
  + * @version $Revision: 1.8 $ $Date: 2002/03/20 12:29:55 $
    */
   
   public class StandardHostDeployer implements Deployer {
  @@ -292,6 +292,10 @@
           if (config == null)
               throw new IllegalArgumentException
                   (sm.getString("standardHost.configRequired"));
  +
  +        if (!host.isDeployXML())
  +            throw new IllegalArgumentException
  +                (sm.getString("standardHost.configNotAllowed"));
   
           // Calculate the document base for the new web application (if needed)
           String docBase = null; // Optional override for value in config file
  
  
  
  1.20      +40 -7     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- HostConfig.java   14 Mar 2002 23:58:35 -0000      1.19
  +++ HostConfig.java   20 Mar 2002 12:29:56 -0000      1.20
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
 1.19 2002/03/14 23:58:35 craigmcc Exp $
  - * $Revision: 1.19 $
  - * $Date: 2002/03/14 23:58:35 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
 1.20 2002/03/20 12:29:56 glenn Exp $
  + * $Revision: 1.20 $
  + * $Date: 2002/03/20 12:29:56 $
    *
    * ====================================================================
    *
  @@ -102,7 +102,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.19 $ $Date: 2002/03/14 23:58:35 $
  + * @version $Revision: 1.20 $ $Date: 2002/03/20 12:29:56 $
    */
   
   public class HostConfig
  @@ -157,6 +157,12 @@
   
   
       /**
  +     * Should we deploy XML Context config files?
  +     */
  +    private boolean deployXML = false;
  +
  +
  +    /**
        * Should we monitor the <code>appBase</code> directory for new
        * applications and automatically deploy them?
        */
  @@ -265,6 +271,28 @@
   
   
       /**
  +     * Return the deploy XML config file flag for this component.
  +     */
  +    public boolean isDeployXML() {
  +
  +        return (this.deployXML);
  +
  +    }
  +
  +
  +    /**
  +     * Set the deploy XML config file flag for this component.
  +     *
  +     * @param deployXML The new deploy XML flag
  +     */
  +    public void setDeployXML(boolean deployXML) {
  +
  +        this.deployXML= deployXML;
  +
  +    }
  +
  +
  +    /**
        * Return the live deploy flag for this component.
        */
       public boolean isLiveDeploy() {
  @@ -326,6 +354,7 @@
                   if (hostDebug > this.debug) {
                       this.debug = hostDebug;
                   }
  +                setDeployXML(((StandardHost) host).isDeployXML());
                   setLiveDeploy(((StandardHost) host).getLiveDeploy());
                   setUnpackWARs(((StandardHost) host).isUnpackWARs());
               }
  @@ -389,6 +418,9 @@
        */
       protected void deployDescriptors(File appBase, String[] files) {
   
  +        if (!deployXML)
  +           return;
  +
           for (int i = 0; i < files.length; i++) {
   
               if (files[i].equalsIgnoreCase("META-INF"))
  @@ -888,7 +920,7 @@
   
       /**
        * Start the background thread that will periodically check for
  -     * session timeouts.
  +     * web application autoDeploy and changes to the web.xml config.
        *
        * @exception IllegalStateException if we should not be starting
        *  a background thread now
  @@ -913,7 +945,7 @@
   
       /**
        * Stop the background thread that is periodically checking for
  -     * modified classes.
  +     * for web application autoDeploy and changes to the web.xml config.
        */
       protected void threadStop() {
   
  @@ -954,7 +986,8 @@
   
   
       /**
  -     * The background thread that checks for session timeouts and shutdown.
  +     * The background thread that checks for web application autoDeploy
  +     * and changes to the web.xml config.
        */
       public void run() {
   
  
  
  

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

Reply via email to