[libbluray-devel] JSM: allow reading on-disc and cache files.

hpi1 git at videolan.org
Mon Mar 23 13:09:24 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Mar 23 13:04:20 2015 +0200| [fc11ac1b781158fa4f2c6d7ca314af2c4085ac99] | committer: hpi1

JSM: allow reading on-disc and cache files.

Default Java security policy does not seem to deny reading these files.

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

 .../bdj/java/org/videolan/BDJSecurityManager.java    |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
index c330269..f56d84e 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
@@ -175,14 +175,30 @@ final class BDJSecurityManager extends SecurityManager {
         throw new SecurityException("exit denied");
     }
 
+    /*
+     * file read access
+     */
+
     public void checkRead(String file) {
 
         file = getCanonPath(file);
 
-        //super.checkRead(file);
         if (usingUdf) {
             BDJLoader.accessFile(file);
         }
+
+        if (cacheRoot != null && file.startsWith(cacheRoot)) {
+            return;
+        }
+        else if (discRoot != null && file.startsWith(discRoot)) {
+            return;
+        }
+        else if (canReadWrite(file)) {
+            return;
+        }
+
+        //logger.error("Xlet read " + file + " denied at\n" + Logger.dumpStack());
+        super.checkRead(file);
     }
 
     /*



More information about the libbluray-devel mailing list