[libbluray-devel] JSM: check reads in checkPermission()

hpi1 git at videolan.org
Fri Mar 27 12:49:07 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Mar 27 13:46:31 2015 +0200| [10e20c0b4c44393ab96613207328f1b23c805190] | committer: hpi1

JSM: check reads in checkPermission()

Some code paths in JRE use it directly

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

 .../bdj/java/org/videolan/BDJSecurityManager.java  |   26 ++++++++------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
index a9a6d35..9e60282 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
@@ -109,6 +109,16 @@ final class BDJSecurityManager extends SecurityManager {
                 checkWrite(perm.getName());
                 return;
             }
+            /* grant read access to BD files */
+            if (perm.getActions().equals("read")) {
+                String file = getCanonPath(perm.getName());
+                if (canRead(file)) {
+                    if (usingUdf) {
+                        BDJLoader.accessFile(file);
+                    }
+                    return;
+                }
+            }
         }
 
         /* Networking */
@@ -192,22 +202,6 @@ final class BDJSecurityManager extends SecurityManager {
         return false;
     }
 
-    public void checkRead(String file) {
-
-        file = getCanonPath(file);
-
-        if (usingUdf) {
-            BDJLoader.accessFile(file);
-        }
-
-        if (canRead(file)) {
-            return;
-        }
-
-        //logger.error("Xlet read " + file + " denied at\n" + Logger.dumpStack());
-        super.checkRead(file);
-    }
-
     /*
      * File write access
      */



More information about the libbluray-devel mailing list