[libbluray-devel] CacheDir: make sure SecurityManager knows cache root

hpi1 git at videolan.org
Thu Jun 15 00:04:04 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Jun 13 20:56:07 2017 +0300| [945882e7185cffe86e34a7b3ded77c0b00c7624f] | committer: hpi1

CacheDir: make sure SecurityManager knows cache root

Fixes creating temporary storage when persistent storage is disabled

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=945882e7185cffe86e34a7b3ded77c0b00c7624f
---

 src/libbluray/bdj/java/org/videolan/CacheDir.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/org/videolan/CacheDir.java b/src/libbluray/bdj/java/org/videolan/CacheDir.java
index 950193d4..2406b664 100644
--- a/src/libbluray/bdj/java/org/videolan/CacheDir.java
+++ b/src/libbluray/bdj/java/org/videolan/CacheDir.java
@@ -62,11 +62,15 @@ class CacheDir {
 
     private static synchronized File getCacheRoot() throws IOException {
 
+        BDJSecurityManager sm = (BDJSecurityManager)System.getSecurityManager();
+
         if (cacheRoot != null) {
+            if (sm != null) {
+                sm.setCacheRoot(cacheRoot.getPath());
+            }
             return cacheRoot;
         }
 
-        BDJSecurityManager sm = (BDJSecurityManager)System.getSecurityManager();
         if (sm != null) {
             InitializeBaseDir();
             File tmpDir = new File(System.getProperty("java.io.tmpdir"));



More information about the libbluray-devel mailing list