diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 3e41f0824..58af02a0c 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -36,6 +36,7 @@ + 43108 - [PATCH] - Where permissions deny fetching System Properties, use sensible defaults 43093 - [PATCH] - Fix formula evaluator support for Area3D references to other sheets Improvements to HSSFDateUtils.isADateFormat, and have HSSFDateUtil.isCellDateFormatted use this 42999 - [PATCH] - Fix for HSSFPatriarch positioning problems diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 2e07005ef..04ee81639 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -33,6 +33,7 @@ + 43108 - [PATCH] - Where permissions deny fetching System Properties, use sensible defaults 43093 - [PATCH] - Fix formula evaluator support for Area3D references to other sheets Improvements to HSSFDateUtils.isADateFormat, and have HSSFDateUtil.isCellDateFormatted use this 42999 - [PATCH] - Fix for HSSFPatriarch positioning problems diff --git a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java index 42c8ea790..efa83ca33 100644 --- a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java +++ b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java @@ -38,7 +38,14 @@ import java.util.List; public abstract class AbstractEscherHolderRecord extends Record { - private static final boolean DESERIALISE = System.getProperty("poi.deserialize.escher") != null; + private static boolean DESERIALISE; + static { + try { + DESERIALISE = (System.getProperty("poi.deserialize.escher") != null); + } catch (SecurityException e) { + DESERIALISE = false; + } + } private List escherRecords; private byte[] rawData; diff --git a/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java b/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java index a370968b0..41efa6d07 100644 --- a/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java +++ b/src/java/org/apache/poi/hssf/usermodel/StaticFontMetrics.java @@ -52,16 +52,22 @@ class StaticFontMetrics try { fontMetricsProps = new Properties(); - if (System.getProperty("font.metrics.filename") != null) - { - String filename = System.getProperty("font.metrics.filename"); - File file = new File(filename); + + // Check to see if the font metric file was specified + // as a system property + String propFileName = null; + try { + propFileName = System.getProperty("font.metrics.filename"); + } catch(SecurityException e) {} + + if (propFileName != null) { + File file = new File(propFileName); if (!file.exists()) throw new FileNotFoundException("font_metrics.properties not found at path " + file.getAbsolutePath()); metricsIn = new FileInputStream(file); } - else - { + else { + // Use the built-in font metrics file off the classpath metricsIn = FontDetails.class.getResourceAsStream("/font_metrics.properties"); if (metricsIn == null) throw new FileNotFoundException("font_metrics.properties not found in classpath"); diff --git a/src/java/org/apache/poi/util/SystemOutLogger.java b/src/java/org/apache/poi/util/SystemOutLogger.java index c81557714..8b3dc50d9 100644 --- a/src/java/org/apache/poi/util/SystemOutLogger.java +++ b/src/java/org/apache/poi/util/SystemOutLogger.java @@ -65,7 +65,13 @@ public class SystemOutLogger extends POILogger */ public boolean check(final int level) { - int currentLevel = Integer.parseInt(System.getProperty("poi.log.level", WARN + "")); + int currentLevel; + try { + currentLevel = Integer.parseInt(System.getProperty("poi.log.level", WARN + "")); + } catch (SecurityException e) { + currentLevel = POILogger.DEBUG; + } + if (level >= currentLevel) return true; else