/hg/icedtea-web: All manifest attributes can be disabled

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Mon Apr 14 14:39:16 UTC 2014


changeset 26b5ec24ec08 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=26b5ec24ec08
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Apr 14 16:39:04 2014 +0200

	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.


diffstat:

 ChangeLog                                                        |  11 ++++++
 netx/net/sourceforge/jnlp/config/Defaults.java                   |   6 +++
 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java    |   5 ++
 netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java |  18 +++++++--
 4 files changed, 36 insertions(+), 4 deletions(-)

diffs (84 lines):

diff -r 94dc6b7515b5 -r 26b5ec24ec08 ChangeLog
--- 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 at 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 at redhat.com>
 
 	Use Swing generics, cleanup with diamond operator
diff -r 94dc6b7515b5 -r 26b5ec24ec08 netx/net/sourceforge/jnlp/config/Defaults.java
--- 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)
                 }
         };
 
diff -r 94dc6b7515b5 -r 26b5ec24ec08 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
--- 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.
diff -r 94dc6b7515b5 -r 26b5ec24ec08 netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java
--- 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);
     }
 
     /**


More information about the distro-pkg-dev mailing list