Author: markt Date: Thu Sep 28 13:30:46 2017 New Revision: 1809992 URL: http://svn.apache.org/viewvc?rev=1809992&view=rev Log: Fix failing tests on Windows
Modified: tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=1809992&r1=1809991&r2=1809992&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/FileDirContext.java Thu Sep 28 13:30:46 2017 @@ -805,11 +805,12 @@ public class FileDirContext extends Base */ protected File file(String name, boolean mustExist) { File file = new File(base, name); - return validate(file, name, mustExist, absoluteBase); + return validate(file, name, mustExist, absoluteBase, canonicalBase); } - protected File validate(File file, String name, boolean mustExist, String absoluteBase) { + protected File validate(File file, String name, boolean mustExist, String absoluteBase, + String canonicalBase) { // If the requested names ends in '/', the Java File API will return a // matching file if one exists. This isn't what we want as it is not @@ -850,8 +851,8 @@ public class FileDirContext extends Base // Ensure that the file is not outside the fileBase. This should not be // possible for standard requests (the request is normalized early in // the request processing) but might be possible for some access via the - // Servlet API (RequestDispatcheretc.) therefore these checks are - // retained as an additional safety measure absoluteBase has been + // Servlet API (RequestDispatcher etc.) therefore these checks are + // retained as an additional safety measure. absoluteBase has been // normalized so absPath needs to be normalized as well. String absPath = normalize(file.getAbsolutePath()); if ((absoluteBase.length() > absPath.length())) { Modified: tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java?rev=1809992&r1=1809991&r2=1809992&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/naming/resources/VirtualDirContext.java Thu Sep 28 13:30:46 2017 @@ -330,4 +330,9 @@ public class VirtualDirContext extends F return null; } } + + + protected File validate(File file, String name, boolean mustExist, String absoluteBase) { + return validate(file, name, mustExist, normalize(absoluteBase), absoluteBase); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org