changeset 1160:1eb6a720a6be

- Fix address pointer integer overflow on 64-bit systems. - Set cache dir to be local to each user (~/.icedteaplugin/cache). - Apply patch from Tom Fitzsimmons for Bug# 230.
author Deepak Bhole <dbhole@redhat.com>
date Mon, 27 Oct 2008 12:13:21 -0400
parents fda32eba4b37
children be368b1e3c7d
files ChangeLog IcedTeaPlugin.cc plugin/icedtea/sun/applet/PluginAppletSecurityContext.java plugin/icedtea/sun/applet/PluginAppletViewer.java
diffstat 4 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 27 15:52:37 2008 +0100
+++ b/ChangeLog	Mon Oct 27 12:13:21 2008 -0400
@@ -1,3 +1,12 @@
+2008-10-27  Deepak Bhole  <dbhole@redhat.com>
+
+	* IcedTeaPlugin.cc: Fix address pointer integer overflow on 64-bit
+	systems.
+	* plugin/icedtea/sun/applet/PluginAppletSecurityContext.java: Set cache
+	dir to be local to each user (~/.icedteaplugin/cache).
+	* plugin/icedtea/sun/applet/PluginAppletViewer.java: Apply patch from Tom
+	Fitzsimmons for Bug# 230.
+
 2008-10-27  Mark Wielaard  <mark@klomp.org>
 
 	* patches/icedtea-renderer-crossing.patch: New patch.
--- a/IcedTeaPlugin.cc	Mon Oct 27 15:52:37 2008 +0100
+++ b/IcedTeaPlugin.cc	Mon Oct 27 12:13:21 2008 -0400
@@ -448,7 +448,7 @@
 
 #define MESSAGE_ADD_SIZE(size)                  \
   message += " ";                               \
-  message.AppendInt (size);
+  message.AppendInt ((PRUintn) size);
 
 // Pass character value through socket as an integer.
 #define MESSAGE_ADD_TYPE(type)                  \
@@ -3888,7 +3888,7 @@
   message += " ";
   message += "JavaScriptGetWindow";
   message += " ";
-  message.AppendInt (liveconnect_window);
+  message.AppendInt ((PRUintn) liveconnect_window);
   factory->SendMessageToAppletViewer (message);
 }
 
@@ -4606,7 +4606,7 @@
       retstr.AppendInt (value.i);
       break;
     case jlong_type:
-      retstr.AppendInt (value.j);
+      retstr.AppendInt ((PRUintn) value.j);
       break;
     case jfloat_type:
       retstr += IcedTeaPrintfCString ("%f", value.f);
@@ -4735,7 +4735,7 @@
           retstr.AppendInt (args[arg].i);
           break;
         case 'J':
-          retstr.AppendInt (args[arg].j);
+          retstr.AppendInt ((PRUintn) args[arg].j);
           break;
         case 'F':
           retstr += IcedTeaPrintfCString ("%f", args[arg].f);
--- a/plugin/icedtea/sun/applet/PluginAppletSecurityContext.java	Mon Oct 27 15:52:37 2008 +0100
+++ b/plugin/icedtea/sun/applet/PluginAppletSecurityContext.java	Mon Oct 27 12:13:21 2008 -0400
@@ -37,14 +37,12 @@
 
 package sun.applet;
 
-import java.awt.AWTPermission;
-import java.io.FilePermission;
+import java.io.File;
 import java.lang.reflect.Array;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
-import java.net.SocketPermission;
 import java.net.URL;
 import java.security.AccessControlContext;
 import java.security.AccessControlException;
@@ -52,15 +50,12 @@
 import java.security.AllPermission;
 import java.security.BasicPermission;
 import java.security.CodeSource;
-import java.security.PermissionCollection;
 import java.security.Permissions;
-import java.security.Policy;
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.PropertyPermission;
 
 import net.sourceforge.jnlp.runtime.JNLPRuntime;
 
@@ -244,6 +239,11 @@
 	public PluginAppletSecurityContext(int identifier) {
 		this.identifier = identifier;
 		
+		// also, override the basedir, use a different one for the plugin
+		File f = new File(System.getProperty("user.home") + "/.icedteaplugin/");
+		f.mkdir();
+		JNLPRuntime.setBaseDir(f);
+
 		// We need a security manager.. and since there is a good chance that 
 		// an applet will be loaded at some point, we should make it the SM 
 		// that JNLPRuntime will try to install
--- a/plugin/icedtea/sun/applet/PluginAppletViewer.java	Mon Oct 27 15:52:37 2008 +0100
+++ b/plugin/icedtea/sun/applet/PluginAppletViewer.java	Mon Oct 27 12:13:21 2008 -0400
@@ -1266,9 +1266,7 @@
  		val = buf.toString();
  	    }
  	    PluginDebug.debug("PUT " + att + " = '" + val + "'");
- 	    if (! val.equals("")) {
- 		atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
- 	    }
+ 	    atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
              while (true) {
                  if ((c == '>') || (c < 0) ||
                      ((c >= 'a') && (c <= 'z')) ||