From 12feaa7d3b1544098f684d851e3caff1ec88cbc8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 30 Jan 2015 21:09:17 +0100 Subject: Refine Native Library Code: Bulk Permissions, Cleanup DynamicLinker impl. - and fix Android AArch64 BionicDynamicLinker (Bug 1122) - Bulk Permissions ProcAddressTable.reset(..) performs address lookup in one block. Now claiming all permissions upfront once, and releasing them afterwards. - Cleanup DynamicLinker impl. Proper top-down impl. of DynamicLinkerImpl, handling all security code and validations. - Fix Android AArch64 BionicDynamicLinker (Bug 1122) Dalvik uses diff RTLD_* defines for AArch64! --- src/java/com/jogamp/common/os/DynamicLinker.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/java/com/jogamp/common/os/DynamicLinker.java') diff --git a/src/java/com/jogamp/common/os/DynamicLinker.java b/src/java/com/jogamp/common/os/DynamicLinker.java index 3b1ec3f..4019c77 100644 --- a/src/java/com/jogamp/common/os/DynamicLinker.java +++ b/src/java/com/jogamp/common/os/DynamicLinker.java @@ -33,6 +33,16 @@ public interface DynamicLinker { public static final boolean DEBUG = NativeLibrary.DEBUG; public static final boolean DEBUG_LOOKUP = NativeLibrary.DEBUG_LOOKUP; + /** + * @throws SecurityException if user is not granted global access + */ + public void claimAllLinkPermission() throws SecurityException; + + /** + * @throws SecurityException if user is not granted global access + */ + public void releaseAllLinkPermission() throws SecurityException; + /** * If a {@link SecurityManager} is installed, user needs link permissions * for the named library. @@ -80,8 +90,9 @@ public interface DynamicLinker { * @param symbolName global symbol name to lookup up system wide. * @return the library handle, maybe 0 if not found. * @throws IllegalArgumentException in case case libraryHandle is unknown. + * @throws SecurityException if user is not granted access for the given library handle */ - public long lookupSymbol(long libraryHandle, String symbolName) throws IllegalArgumentException; + public long lookupSymbol(long libraryHandle, String symbolName) throws SecurityException, IllegalArgumentException; /** * Security checks are implicit by previous call of @@ -89,9 +100,11 @@ public interface DynamicLinker { * retrieving the librarHandle. * * @param libraryHandle a library handle previously retrieved via {@link #openLibraryLocal(String, boolean)} or {@link #openLibraryGlobal(String, boolean)}. + * @param debug set to true to enable debugging * @throws IllegalArgumentException in case case libraryHandle is unknown. + * @throws SecurityException if user is not granted access for the given library handle */ - public void closeLibrary(long libraryHandle) throws IllegalArgumentException; + public void closeLibrary(long libraryHandle, boolean debug) throws SecurityException, IllegalArgumentException; /** * Returns a string containing the last error. -- cgit v1.2.3