Mercurial > hg > release > icedtea-web-1.6
changeset 984:26b5ec24ec08
All manifest attributes can be disabled
* netx/net/sourceforge/jnlp/config/Defaults.java: added new KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK configuration.
* netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Added KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK key
* netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: (isCheckEnabled) new method to check value of KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK (checkAll) is testing isCheckEnabled before checking individual attributes.
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Mon, 14 Apr 2014 16:39:04 +0200 |
parents | 94dc6b7515b5 |
children | e5175632c41a |
files | ChangeLog netx/net/sourceforge/jnlp/config/Defaults.java netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java |
diffstat | 4 files changed, 36 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Apr 14 09:21:41 2014 -0400 +++ b/ChangeLog Mon Apr 14 16:39:04 2014 +0200 @@ -1,3 +1,14 @@ +2014-04-14 Jiri Vanek <jvanek@redhat.com> + + All manifest attributes can be disabled + * netx/net/sourceforge/jnlp/config/Defaults.java: added new + KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK configuration. + * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: + Added KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK key + * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: + (isCheckEnabled) new method to check value of KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK + (checkAll) is testing isCheckEnabled before checking individual attributes. + 2014-04-14 Andrew Azores <aazores@redhat.com> Use Swing generics, cleanup with diamond operator
--- a/netx/net/sourceforge/jnlp/config/Defaults.java Mon Apr 14 09:21:41 2014 -0400 +++ b/netx/net/sourceforge/jnlp/config/Defaults.java Mon Apr 14 16:39:04 2014 +0200 @@ -428,6 +428,12 @@ DeploymentConfiguration.KEY_JRE_DIR, null, null + }, + //enable manifest-attributes checks + { + DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, + BasicValueValidators.getBooleanValidator(), + String.valueOf(true) } };
--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Mon Apr 14 09:21:41 2014 -0400 +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Mon Apr 14 16:39:04 2014 +0200 @@ -173,6 +173,11 @@ public static final String KEY_ENABLE_LOGGING_TOFILE = "deployment.log.file"; public static final String KEY_ENABLE_LOGGING_TOSTREAMS = "deployment.log.stdstreams"; public static final String KEY_ENABLE_LOGGING_TOSYSTEMLOG = "deployment.log.system"; + + /* + * manifest check + */ + public static final String KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK = "deployment.manifest.attributes.check"; /** * Console initial status.
--- a/netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java Mon Apr 14 09:21:41 2014 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java Mon Apr 14 16:39:04 2014 +0200 @@ -49,6 +49,7 @@ import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; +import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SigningState; import net.sourceforge.jnlp.security.SecurityDialogs; @@ -74,10 +75,19 @@ } void checkAll() throws LaunchException { - checkTrustedOnlyAttribute(); - checkCodebaseAttribute(); - checkPermissionsAttribute(); - checkApplicationLibraryAllowableCodebaseAttribute(); + if (isCheckEnabled()) { + checkTrustedOnlyAttribute(); + checkCodebaseAttribute(); + checkPermissionsAttribute(); + checkApplicationLibraryAllowableCodebaseAttribute(); + } else { + OutputController.getLogger().log("Checking for attributes in manifest is disabled."); + } + } + + public static boolean isCheckEnabled() { + String value = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK); + return Boolean.parseBoolean(value); } /**