From 94d10d5d7e572975be0a7405a2b1b553e562e6fa Mon Sep 17 00:00:00 2001 From: Omair Majid <omajid@redhat.com> Date: Wed, 24 Nov 2010 10:53:38 -0500 Subject: 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. --- netx/net/sourceforge/jnlp/SecurityDesc.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'netx/net/sourceforge/jnlp') diff --git a/netx/net/sourceforge/jnlp/SecurityDesc.java b/netx/net/sourceforge/jnlp/SecurityDesc.java index e7a9706..c5ddec4 100644 --- a/netx/net/sourceforge/jnlp/SecurityDesc.java +++ b/netx/net/sourceforge/jnlp/SecurityDesc.java @@ -53,6 +53,9 @@ public class SecurityDesc { /** 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 @@ public class SecurityDesc { 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 @@ public class SecurityDesc { 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")); } -- cgit v1.2.3