tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util FileUtil.java
Date Fri, 23 Jun 2000 21:41:18 GMT
nacho       00/06/23 14:41:17

  Modified:    src/share/org/apache/tomcat/util FileUtil.java
  Log:
  Fixed a bug in file security checks for windows
  
  Revision  Changes    Path
  1.8       +7 -5      jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FileUtil.java	2000/06/22 00:15:05	1.7
  +++ FileUtil.java	2000/06/23 21:41:15	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java,v 1.7
2000/06/22 00:15:05 costin Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/06/22 00:15:05 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java,v 1.8
2000/06/23 21:41:15 nacho Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/06/23 21:41:15 $
    *
    * ====================================================================
    *
  @@ -158,8 +158,10 @@
   	// happens on flavors of Windows.
   	if (File.separatorChar  == '\\') {
   	    // On Windows check ignore case....
  -	    if(!realPath.equalsIgnoreCase(canPath)) {
  -		return null;
  +	    if(!realPath.equalsIgnoreCase(canPath){
  +            int ls=realPath.lastIndexOf('\\');
  +            if  ( (ls > 0) && !realPath.substring(0,ls).equalsIgnoreCase(canPath)
))
  +        		return null;
   	    }
   	}
   
  
  
  

Mime
View raw message