diff options
author | Omair Majid <[email protected]> | 2011-01-04 15:12:40 -0500 |
---|---|---|
committer | Omair Majid <[email protected]> | 2011-01-04 15:12:40 -0500 |
commit | 6144e5cba6ef2e89096e6a74b74dd0d5ebf996b1 (patch) | |
tree | a0c4f7a837ca8c64e1e89c0b95d09956a8caf025 /netx/net/sourceforge/jnlp/runtime | |
parent | 0cc285288f1f96cafd7dc069ed040337c4a25f58 (diff) |
allow custom permissions instead of all permissions for trusted code
2011-01-04 Omair Majid <[email protected]>
* netx/net/sourceforge/jnlp/SecurityDesc.java: Add
customTrustedPolicy.
(SecurityDesc): Initialize customTrustedPolicy.
(getCustomTrustedPolicy): New method. Get custom policy file from
configuration and use it to initialize a custom configuration.
(getPermissions): If trusted application and customTrustedPolicy is
not null, delegate to otherwise return AllPermissions.
* netx/net/sourceforge/jnlp/config/Defaults.java
(getDefaults): Use constant for property.
* netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java:
Add new constant KEY_SECURITY_TRUSTED_POLICY.
* netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java
(installEnvironment): Pass cs as a parameter to
SecurityDesc.getPermissions.
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
(getPermissions): Likewise.
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime')
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java | 2 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java index de7bfb4..19dede5 100644 --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java @@ -225,7 +225,7 @@ public class ApplicationInstance { JNLPClassLoader loader = (JNLPClassLoader) this.loader; SecurityDesc s = loader.getSecurity(); - ProtectionDomain pd = new ProtectionDomain(cs, s.getPermissions(), null, null); + ProtectionDomain pd = new ProtectionDomain(cs, s.getPermissions(cs), null, null); // Add to hashmap AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] { pd }); diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index 486ddff..ebea041 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -578,7 +578,7 @@ public class JNLPClassLoader extends URLClassLoader { (getCodeSourceSecurity(cs.getLocation()).getSecurityType().equals(SecurityDesc.ALL_PERMISSIONS) || getCodeSourceSecurity(cs.getLocation()).getSecurityType().equals(SecurityDesc.J2EE_PERMISSIONS))) { - permissions = getCodeSourceSecurity(cs.getLocation()).getPermissions(); + permissions = getCodeSourceSecurity(cs.getLocation()).getPermissions(cs); } Enumeration<Permission> e = permissions.elements(); |