changeset 1939:02f558ca98d8

Fix policy evaluation to match the proprietary JDK.
author Deepak Bhole <dbhole@redhat.com>
date Fri, 16 Jul 2010 15:19:55 -0400
parents f84adc4b21cf
children 7e7059a08814
files ChangeLog Makefile.am patches/icedtea-policy-evaluation.patch
diffstat 3 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 16 17:12:55 2010 +0100
+++ b/ChangeLog	Fri Jul 16 15:19:55 2010 -0400
@@ -1,3 +1,8 @@
+2010-07-16  Deepak Bhole <dbhole@redhat.com>
+
+	* patches/icedtea-policy-evaluation.patch: New patch. Fixes policy
+	evaluation to match the proprietary JDK.
+
 2010-07-15  Deepak Bhole <dbhole@redhat.com>
 
 	* patches/openjdk/6678385.patch: New file. Backpatched from jdk7 for 
--- a/Makefile.am	Fri Jul 16 17:12:55 2010 +0100
+++ b/Makefile.am	Fri Jul 16 15:19:55 2010 -0400
@@ -308,6 +308,7 @@
 	patches/icedtea-linux-separate-debuginfo.patch \
 	patches/icedtea-parisc.patch \
 	patches/icedtea-sh4-support.patch \
+	patches/icedtea-policy-evaluation.patch \
 	patches/libpng.patch \
 	patches/icedtea-jtreg-httpTest.patch \
 	patches/security/20100330/hotspot/$(HSBUILD)/6626217.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-policy-evaluation.patch	Fri Jul 16 15:19:55 2010 -0400
@@ -0,0 +1,35 @@
+# This patch aligns policy evaluation to be the same as the proprietary JDK.
+# http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-July/009658.html
+# https://bugs.openjdk.java.net/show_bug.cgi?id=100142
+
+diff -up ./openjdk/jdk/src/share/classes/sun/security/provider/PolicyFile.java.sav ./jdk/src/share/classes/sun/security/provider/PolicyFile.java
+--- ./openjdk.orig/jdk/src/share/classes/sun/security/provider/PolicyFile.java.sav	2010-04-20 14:49:13.000000000 -0400
++++ ./openjdk/jdk/src/share/classes/sun/security/provider/PolicyFile.java	2010-04-20 14:50:26.000000000 -0400
+@@ -1799,6 +1799,27 @@ public class PolicyFile extends java.sec
+ 
+         CodeSource canonCs = cs;
+         URL u = cs.getLocation();
++        
++        // If this is a jar protocol url, collapse it to a 
++        // file protocol to process it as per the javadocs
++        if (u != null && u.getProtocol().equals("jar")) {
++            try {
++                String fileURL = "";
++            
++                // remove the initial jar:
++                fileURL = u.getPath();
++            
++                // remove the part after the !
++                fileURL = fileURL.substring(0, fileURL.indexOf('!'));
++                
++                u = new URL(fileURL);
++
++            } catch (Exception e) {
++                // Fail silently. In this case, url stays what it was above
++            }
++            
++        }
++        
+         if (u != null && u.getProtocol().equals("file")) {
+             boolean isLocalFile = false;
+             String host = u.getHost();