4523159: suggestion for a bugfix for 13 year old "jars in path with !"

Seán Coffey sean.coffey at oracle.com
Tue Sep 15 09:48:54 UTC 2015


Daniel,

Thanks for your investigation on this issue. Networking issues should be 
discussed on the net-dev [1] mailing list. Please post your comments and 
patch to that list.

[1] http://mail.openjdk.java.net/mailman/listinfo/net-dev

Regards,
Sean.

On 15/09/2015 09:31, Daniel Wilhlem wrote:
> Hi,
>
> Our download manager http://jdownloader.org/ has millions of customers.
> Some of them also suffered from the 13 year old bug 
> http://bugs.java.com/view_bug.do?bug_id=4523159.
> The issue happens because '!/' is used as seperator between a jar file 
> and its content in URLStreamHandler and JarURLConnection.
>
> I hereby want to suggest our bugfix.
>
> It consists of a modified sun.net.www.protocol.jar.Handler and 
> sun.net.www.protocol.jar.JarURLConnection.
> Instead of searching for '!/' and using the first hit, our customized 
> sun.net.www.protocol.jar.Handler loops through URL.getFile()
> via indexof and substring and tests if it specifies the actual jar 
> file on disk.
> In case the path contains '!/' we return a customized 
> sun.net.www.protocol.jar.JarURLConnection that overrides
> getJarFileURL(),getJarEntry(),getEntryName() to provide the correct 
> information.
>
> The one disadvantage of this bugfix is the additional IO introduced by 
> File.exits(), but that can be considered//neglectable/./
>
> Please find attached our customized classes.
>
> Best Regards
> Daniel Wilhelm
>
> PS: cc'ed to jdk9-dev
>



More information about the jdk8u-dev mailing list