aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/cache/TempFileCache.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-03-13 19:56:54 +0100
committerSven Gothel <[email protected]>2012-03-13 19:56:54 +0100
commitf4ac27e177f6deb444280d3b375e7d343e38bd08 (patch)
tree5dc8835bd3fb47475219d71e278d622ef5742420 /src/java/com/jogamp/common/util/cache/TempFileCache.java
parentbab77b637e7cdd327de5f66989fcbfc0298b9b88 (diff)
SecurityUtil: Generalize cert validation and AccessControlContext query; PropertyAccess: Fix security code, grant access to common 'trusted' properties
- SecurityUtil - Generalize cert validation for JAR and property access - Grant access to common AccessControlContext for 'same' cert - PropertyAccess: - Fix security code: Passing the current AccessControlContext from the caller didn't include priviledges. - Grant access to common 'trusted' properties, which removes the need of passing the AccessControlContext for general properties like 'jnlp.', 'jogamp.' .. - Enable registering 'trusted' properties, when caller's cert is 'same'
Diffstat (limited to 'src/java/com/jogamp/common/util/cache/TempFileCache.java')
-rw-r--r--src/java/com/jogamp/common/util/cache/TempFileCache.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/java/com/jogamp/common/util/cache/TempFileCache.java b/src/java/com/jogamp/common/util/cache/TempFileCache.java
index c3b24aa..51c698e 100644
--- a/src/java/com/jogamp/common/util/cache/TempFileCache.java
+++ b/src/java/com/jogamp/common/util/cache/TempFileCache.java
@@ -33,8 +33,10 @@ import java.io.FilenameFilter;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
+import java.security.AccessControlContext;
import com.jogamp.common.util.IOUtil;
+import com.jogamp.common.util.SecurityUtil;
import jogamp.common.Debug;
@@ -70,14 +72,16 @@ public class TempFileCache {
private File individualTmpDir;
static {
+ final AccessControlContext acc = SecurityUtil.getCommonAccessControlContext(TempFileCache.class);
+
// Global Lock !
- synchronized (System.out) {
+ synchronized (System.out) {
// Create / initialize the temp root directory, starting the Reaper
// thread to reclaim old installations if necessary. If we get an
// exception, set an error code.
File _tmpBaseDir = null;
- try {
- _tmpBaseDir = IOUtil.getTempDir(tmpDirPrefix); // Retrieve the tmpbase directory.
+ try {
+ _tmpBaseDir = IOUtil.getTempDir(tmpDirPrefix, acc); // Retrieve the tmpbase directory.
} catch (Exception ex) {
System.err.println("Warning: Catched Exception while retrieving temp base directory:");
ex.printStackTrace();