diff options
author | Sven Gothel <[email protected]> | 2013-06-21 04:30:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-21 04:30:49 +0200 |
commit | f55074132e0369cb09a6fc4bda69ab936bd820fa (patch) | |
tree | d7001e61bded08b102fdf7e264d5911800397a2c /src/java/com/jogamp | |
parent | adb3d51d67b10a68ec8af01765a52b1da185637e (diff) |
ProcAddressTable: If using a SecurityManager 'checkAllLinkPermission()' instead of 'checkAllPermissions' if accessing the cached function handles.
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r-- | src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java | 25 |
1 files changed, 19 insertions, 6 deletions
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 + * <p> + * If a {@link SecurityManager} is installed, user needs link permissions + * for <b>all</b> libraries, i.e. for <code>new RuntimePermission("loadLibrary.*");</code>! + * </p> + * @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. + * <p> + * If a {@link SecurityManager} is installed, user needs link permissions + * for <b>all</b> libraries, i.e. for <code>new RuntimePermission("loadLibrary.*");</code>! + * </p> + * * @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. * </p> + * <p> + * If a {@link SecurityManager} is installed, user needs link permissions + * for <b>all</b> libraries, i.e. for <code>new RuntimePermission("loadLibrary.*");</code>! + * </p> * * @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); |