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/naming/resources FileDirContext.java
Date Wed, 31 Oct 2001 18:58:36 GMT
remm        01/10/31 10:58:36

  Modified:    catalina/src/share/org/apache/naming/resources
                        FileDirContext.java
  Log:
  - Fix security manager bug when using Windows. The base should be an
    absolute path (instead of a relative path), otherwise a security exception would
    be thrown by the case sensitivity checking code when trying to access the
    user.dir system property.
  
  Revision  Changes    Path
  1.9       +10 -6     jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/FileDirContext.java
  
  Index: FileDirContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/FileDirContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FileDirContext.java	2001/09/28 02:22:27	1.8
  +++ FileDirContext.java	2001/10/31 18:58:36	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/FileDirContext.java,v
1.8 2001/09/28 02:22:27 remm Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/09/28 02:22:27 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/FileDirContext.java,v
1.9 2001/10/31 18:58:36 remm Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/10/31 18:58:36 $
    *
    * ====================================================================
    *
  @@ -99,7 +99,7 @@
    * Filesystem Directory Context implementation helper class.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.8 $ $Date: 2001/09/28 02:22:27 $
  + * @version $Revision: 1.9 $ $Date: 2001/10/31 18:58:36 $
    */
   
   public class FileDirContext extends BaseDirContext {
  @@ -175,13 +175,17 @@
   		(sm.getString("resources.null"));
   
   	// Calculate a File object referencing this document base directory
  -	File base = new File(docBase);
  +	base = new File(docBase);
  +        try {
  +            base = base.getCanonicalFile();
  +        } catch (IOException e) {
  +            // Ignore
  +        }
   
   	// Validate that the document base is an existing directory
   	if (!base.exists() || !base.isDirectory() || !base.canRead())
   	    throw new IllegalArgumentException
   		(sm.getString("fileResources.base", docBase));
  -	this.base = base;
           this.absoluteBase = normalize(base.getAbsolutePath());
           super.setDocBase(docBase);
   
  
  
  

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