changeset 48:6dd50caf8e76

fix infinite recursion in determining sandbox permissions 2010-11-24 Omair Majid <omajid@redhat.com> * netx/net/sourceforge/jnlp/SecurityDesc.java: Add grantAwtPermissions. (SecurityDesc): Set grantAwtPermissions. (getSandboxPermissions): Use grantAwtPermissions to determine whether to grant permissions.
author Omair Majid <omajid@redhat.com>
date Wed, 24 Nov 2010 10:53:38 -0500
parents 5782c25b26dc
children 476a91d02140
files ChangeLog netx/net/sourceforge/jnlp/SecurityDesc.java
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 24 14:15:17 2010 +0100
+++ b/ChangeLog	Wed Nov 24 10:53:38 2010 -0500
@@ -1,3 +1,10 @@
+2010-11-24  Omair Majid  <omajid@redhat.com>
+
+	* netx/net/sourceforge/jnlp/SecurityDesc.java: Add grantAwtPermissions.
+	(SecurityDesc): Set grantAwtPermissions.
+	(getSandboxPermissions): Use grantAwtPermissions to determine whether to
+	grant permissions.
+
 2010-11-24  Matthias Klose  <doko@ubuntu.com>
 
 	* Makefile.am (javaws.desktop): Search javaws.desktop.in in $(srcdir).
--- a/netx/net/sourceforge/jnlp/SecurityDesc.java	Wed Nov 24 14:15:17 2010 +0100
+++ b/netx/net/sourceforge/jnlp/SecurityDesc.java	Wed Nov 24 10:53:38 2010 -0500
@@ -53,6 +53,9 @@
     /** the download host */
     private String downloadHost;
 
+    /** whether sandbox applications should get the show window without banner permission */
+    private final boolean grantAwtPermissions;
+
     /** the JNLP file */
     private JNLPFile file;
 
@@ -146,6 +149,9 @@
         this.file = file;
         this.type = type;
         this.downloadHost = downloadHost;
+
+        String key = DeploymentConfiguration.KEY_SECURITY_ALLOW_HIDE_WINDOW_WARNING;
+        grantAwtPermissions = Boolean.valueOf(JNLPRuntime.getConfiguration().getProperty(key));
     }
 
     /**
@@ -188,8 +194,7 @@
         for (int i=0; i < sandboxPermissions.length; i++)
             permissions.add(sandboxPermissions[i]);
 
-        String key = DeploymentConfiguration.KEY_SECURITY_ALLOW_HIDE_WINDOW_WARNING;
-        if (Boolean.valueOf(JNLPRuntime.getConfiguration().getProperty(key)) == Boolean.TRUE) {
+        if (grantAwtPermissions) {
             permissions.add(new AWTPermission("showWindowWithoutWarningBanner"));
         }