summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/jogamp/common/os')
-rw-r--r--src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java7
-rw-r--r--src/java/jogamp/common/os/UnixDynamicLinkerImpl.java7
-rw-r--r--src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java6
3 files changed, 14 insertions, 6 deletions
diff --git a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java
index 4eb381f..95f7e63 100644
--- a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java
@@ -3,6 +3,7 @@
package jogamp.common.os;
import com.jogamp.common.os.DynamicLinker;
+import com.jogamp.common.util.SecurityUtil;
public class MacOSXDynamicLinkerImpl implements DynamicLinker {
@@ -28,7 +29,7 @@ public class MacOSXDynamicLinkerImpl implements DynamicLinker {
// --- Begin CustomJavaCode .cfg declarations
- public long openLibraryLocal(String pathname, boolean debug) {
+ public long openLibraryLocal(String pathname, boolean debug) throws SecurityException {
// Note we use RTLD_LOCAL visibility to _NOT_ allow this functionality to
// be used to pre-resolve dependent libraries of JNI code without
// requiring that all references to symbols in those libraries be
@@ -36,10 +37,11 @@ public class MacOSXDynamicLinkerImpl implements DynamicLinker {
// other words, one can actually link against the library instead of
// having to dlsym all entry points. System.loadLibrary() uses
// RTLD_LOCAL visibility so can't be used for this purpose.
+ SecurityUtil.checkLinkPermission(pathname);
return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL);
}
- public long openLibraryGlobal(String pathname, boolean debug) {
+ public long openLibraryGlobal(String pathname, boolean debug) throws SecurityException {
// Note we use RTLD_GLOBAL visibility to allow this functionality to
// be used to pre-resolve dependent libraries of JNI code without
// requiring that all references to symbols in those libraries be
@@ -47,6 +49,7 @@ public class MacOSXDynamicLinkerImpl implements DynamicLinker {
// other words, one can actually link against the library instead of
// having to dlsym all entry points. System.loadLibrary() uses
// RTLD_LOCAL visibility so can't be used for this purpose.
+ SecurityUtil.checkLinkPermission(pathname);
return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);
}
diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
index 29998bd..2258dfa 100644
--- a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
@@ -3,6 +3,7 @@
package jogamp.common.os;
import com.jogamp.common.os.DynamicLinker;
+import com.jogamp.common.util.SecurityUtil;
public class UnixDynamicLinkerImpl implements DynamicLinker {
@@ -27,7 +28,7 @@ public class UnixDynamicLinkerImpl implements DynamicLinker {
// --- Begin CustomJavaCode .cfg declarations
- public long openLibraryLocal(String pathname, boolean debug) {
+ public long openLibraryLocal(String pathname, boolean debug) throws SecurityException {
// Note we use RTLD_GLOBAL visibility to _NOT_ allow this functionality to
// be used to pre-resolve dependent libraries of JNI code without
// requiring that all references to symbols in those libraries be
@@ -35,10 +36,11 @@ public class UnixDynamicLinkerImpl implements DynamicLinker {
// other words, one can actually link against the library instead of
// having to dlsym all entry points. System.loadLibrary() uses
// RTLD_LOCAL visibility so can't be used for this purpose.
+ SecurityUtil.checkLinkPermission(pathname);
return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL);
}
- public long openLibraryGlobal(String pathname, boolean debug) {
+ public long openLibraryGlobal(String pathname, boolean debug) throws SecurityException {
// Note we use RTLD_GLOBAL visibility to allow this functionality to
// be used to pre-resolve dependent libraries of JNI code without
// requiring that all references to symbols in those libraries be
@@ -46,6 +48,7 @@ public class UnixDynamicLinkerImpl implements DynamicLinker {
// other words, one can actually link against the library instead of
// having to dlsym all entry points. System.loadLibrary() uses
// RTLD_LOCAL visibility so can't be used for this purpose.
+ SecurityUtil.checkLinkPermission(pathname);
return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);
}
diff --git a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java
index e7f5b52..eb02584 100644
--- a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java
@@ -3,6 +3,7 @@
package jogamp.common.os;
import com.jogamp.common.os.DynamicLinker;
+import com.jogamp.common.util.SecurityUtil;
public class WindowsDynamicLinkerImpl implements DynamicLinker {
@@ -20,13 +21,14 @@ public class WindowsDynamicLinkerImpl implements DynamicLinker {
// --- Begin CustomJavaCode .cfg declarations
- public long openLibraryLocal(String libraryName, boolean debug) {
+ public long openLibraryLocal(String libraryName, boolean debug) throws SecurityException {
// How does that work under Windows ?
// Don't know .. so it's an alias for the time being
return openLibraryGlobal(libraryName, debug);
}
- public long openLibraryGlobal(String libraryName, boolean debug) {
+ public long openLibraryGlobal(String libraryName, boolean debug) throws SecurityException {
+ SecurityUtil.checkLinkPermission(libraryName);
long handle = LoadLibraryW(libraryName);
if(0==handle && debug) {
int err = GetLastError();