[libbluray-devel] JSM: fix getCanonPath(..."/*")

hpi1 git at videolan.org
Thu Apr 2 16:41:01 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Apr  2 17:36:47 2015 +0300| [47388e95c26866a3599d00d160952a5db49924b4] | committer: hpi1

JSM: fix getCanonPath(..."/*")

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

 src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
index 8a692d0..d75da32 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
@@ -243,6 +243,8 @@ final class BDJSecurityManager extends SecurityManager {
 
     private String getCanonPath(String origPath)
     {
+        String suffix = "";
+
         if (!java.io.BDFileSystem.isAbsolutePath(origPath)) {
             String home = BDJXletContext.getCurrentXletHome();
             if (home == null) {
@@ -252,6 +254,11 @@ final class BDJSecurityManager extends SecurityManager {
             origPath = home + origPath;
         }
 
+        if (origPath.endsWith(File.separator + "*")) {
+            suffix = File.separator + "*";
+            origPath = origPath.substring(0, origPath.length() - 2);
+        }
+
         final String path = origPath;
         String cpath = (String)AccessController.doPrivileged(new PrivilegedAction() {
             public Object run() {
@@ -266,7 +273,7 @@ final class BDJSecurityManager extends SecurityManager {
         if (cpath == null) {
             throw new SecurityException("cant canonicalize " + path);
         }
-        return cpath;
+        return cpath + suffix;
     }
 
     /*



More information about the libbluray-devel mailing list