JETTY-1080 modify previous fix to work on windows

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@817 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Jan Bartel 2009-09-04 04:41:33 +00:00
parent de111c511d
commit bab8d4d31a
2 changed files with 12 additions and 7 deletions

View File

@ -2,6 +2,7 @@ jetty-7.0.0.RC6-SNAPSHOT
+ 288055 jetty-client fails to resolve failed resolution attempts correctly
+ 288153 jetty-client resend doesn't reset exchange
+ 288182 PUT request fails during retry
+ JETTY-1080 modify previous fix to work on windows
+ JETTY-1086 Use UncheckedPrintWriter
+ JETTY-1090 resolve potential infinite loop with webdav listener
+ JETTY-1093 Request.toString throws exception when size exceeds 4k

View File

@ -24,6 +24,7 @@ import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;
@ -148,6 +149,7 @@ public class JarResource extends URLResource
JarInputStream jin = new JarInputStream(is);
JarEntry entry;
boolean shouldExtract;
String directoryCanonicalPath = directory.getCanonicalPath()+"/";
while((entry=jin.getNextJarEntry())!=null)
{
String entryName = entry.getName();
@ -192,14 +194,16 @@ public class JarResource extends URLResource
continue;
}
File file=new File(directory,entryName);
if(!file.getCanonicalPath().regionMatches(0,directory.getCanonicalPath()+"/",0,directory.getCanonicalPath().length()+1)) {
if (Log.isDebugEnabled()) Log.debug("Invalid entry: " + entryName);
String dotCheck = entryName.replace('\\', '/');
dotCheck = URIUtil.canonicalPath(dotCheck);
if (dotCheck == null)
{
if (Log.isDebugEnabled()) Log.debug("Invalid entry: "+entryName);
continue;
}
}
File file=new File(directory,entryName);
if (entry.isDirectory())
{
// Make directory