From f55074132e0369cb09a6fc4bda69ab936bd820fa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 21 Jun 2013 04:30:49 +0200 Subject: ProcAddressTable: If using a SecurityManager 'checkAllLinkPermission()' instead of 'checkAllPermissions' if accessing the cached function handles. --- .../jogamp/gluegen/runtime/ProcAddressTable.java | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/java/com/jogamp/gluegen') diff --git a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java index a4ead86..181637d 100644 --- a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java +++ b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java @@ -110,10 +110,14 @@ public abstract class ProcAddressTable { /** * Resets the complete table. - * @throws SecurityException if caller has not all-permissions in case a SecurityManager is installed + *

+ * If a {@link SecurityManager} is installed, user needs link permissions + * for all libraries, i.e. for new RuntimePermission("loadLibrary.*");! + *

+ * @throws SecurityException if user is not granted access for all libraries. */ public void reset(DynamicLookupHelper lookup) throws SecurityException, RuntimeException { - SecurityUtil.checkAllPermissions(); + SecurityUtil.checkAllLinkPermission(); if(null==lookup) { throw new RuntimeException("Passed null DynamicLookupHelper"); @@ -147,11 +151,16 @@ public abstract class ProcAddressTable { /** * Initializes the mapping for a single function. + *

+ * If a {@link SecurityManager} is installed, user needs link permissions + * for all libraries, i.e. for new RuntimePermission("loadLibrary.*");! + *

+ * * @throws IllegalArgumentException if this function is not in this table. - * @throws SecurityException if caller has not all-permissions in case a SecurityManager is installed + * @throws SecurityException if user is not granted access for all libraries. */ public void initEntry(String name, DynamicLookupHelper lookup) throws SecurityException, IllegalArgumentException { - SecurityUtil.checkAllPermissions(); + SecurityUtil.checkAllLinkPermission(); Field field = fieldForFunction(name); setEntry(field, name, lookup); } @@ -266,12 +275,16 @@ public abstract class ProcAddressTable { * manually compute the "{@link #PROCADDRESS_VAR_PREFIX} + <functionName>" * member variable name and look it up via reflection. *

+ *

+ * If a {@link SecurityManager} is installed, user needs link permissions + * for all libraries, i.e. for new RuntimePermission("loadLibrary.*");! + *

* * @throws IllegalArgumentException if this function is not in this table. - * @throws SecurityException if caller has not all-permissions in case a SecurityManager is installed + * @throws SecurityException if user is not granted access for all libraries. */ public long getAddressFor(String functionName) throws SecurityException, IllegalArgumentException { - SecurityUtil.checkAllPermissions(); + SecurityUtil.checkAllLinkPermission(); Field addressField = fieldForFunction(functionName); try { return addressField.getLong(this); -- cgit v1.2.3