[kaffe] CVS kaffe (guilhem): Fixed JAR builder.

Kaffe CVS cvs-commits at kaffe.org
Sun Apr 25 08:38:06 PDT 2004


PatchSet 4693 
Date: 2004/04/25 15:34:18
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixed JAR builder.

        * libraries/javalib/kaffe/tools/jar/Jar.java
        (createFileLookupTable): JDK's jar tool is authorizing "../"
        in entries. This fixes an entry name problem while building
        rt.jar.

Members: 
	ChangeLog:1.2269->1.2270 
	libraries/javalib/kaffe/tools/jar/Jar.java:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2269 kaffe/ChangeLog:1.2270
--- kaffe/ChangeLog:1.2269	Sun Apr 25 13:29:14 2004
+++ kaffe/ChangeLog	Sun Apr 25 15:34:18 2004
@@ -1,5 +1,12 @@
 2004-04-24  Guilhem Lavaux <guilhem at kaffe.org>
 
+	* libraries/javalib/kaffe/tools/jar/Jar.java
+	(createFileLookupTable): JDK's jar tool is authorizing "../"
+	in entries. This fixes an entry name problem while building
+	rt.jar.
+
+2004-04-24  Guilhem Lavaux <guilhem at kaffe.org>
+
 	* config/sparc/openbsd2/md.h: Added #include <sys/time.h>
 	because sys/resource.h has an undefined struct on openbsd.
 
Index: kaffe/libraries/javalib/kaffe/tools/jar/Jar.java
diff -u kaffe/libraries/javalib/kaffe/tools/jar/Jar.java:1.4 kaffe/libraries/javalib/kaffe/tools/jar/Jar.java:1.5
--- kaffe/libraries/javalib/kaffe/tools/jar/Jar.java:1.4	Mon Mar 22 11:25:34 2004
+++ kaffe/libraries/javalib/kaffe/tools/jar/Jar.java	Sun Apr 25 15:34:20 2004
@@ -524,36 +524,6 @@
 		System.out.println("canon     was \"" + canon + "\"");
 	    }
 
-
-	    if (canon.length() < absolute_name.length()) {
-		// Take care of the really nasty case where
-		// a dir path included . or .. which can
-		// really mess up the entry names that get
-		// put into the archive. To fix this we
-		// need to get the last path element in
-		// the canonical path and use that as our
-		// short file name
-
-		if (debug) {
-		    System.out.println("name got smaller");
-		}
-
-		int index = canon.lastIndexOf('/');
-
-		if (index == -1) {
-		    // Something really strange happended, the file
-		    // name is absolute so something is really screwed up
-
-		    throw new RuntimeException("absolute file " +
-			          canon + " had no '/' chars in it");
-		}
-
-		// gaurd against the case where / is at the end of the string
-		if ((index + 1) < canon.length()) {
-		    files[i] = canon.substring(index + 1);
-		}
-	    }
-
 	    if (debug) {
 		System.out.println("file name is \"" + files[i]
 				   + "\"");




More information about the kaffe mailing list