[libbluray-devel] Fix SecurityException in AWTAutoShutdown

hpi1 git at videolan.org
Thu Nov 5 16:29:29 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Nov  5 12:24:41 2015 +0200| [dcfd51e9917b6fec7fb2263c38b8cfc44d6d6720] | committer: hpi1

Fix SecurityException in AWTAutoShutdown

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

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

diff --git a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
index 35b56dd..8a337ee 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
@@ -76,6 +76,14 @@ final class BDJSecurityManager extends SecurityManager {
                 }
                 deny(perm);
             }
+
+            // work around bug in openjdk 7 / 8
+            // sun.awt.AWTAutoShutdown.notifyThreadBusy is missing doPrivileged()
+            // (fixed in jdk9 / http://hg.openjdk.java.net/jdk9/client/jdk/rev/5b613a3c04be )
+            if (classDepth("sun.awt.AWTAutoShutdown") > 0) {
+                return;
+            }
+
             if (perm.implies(new RuntimePermission("modifyThreadGroup"))) {
                 /* do check here (no need to log failures) */
                 super.checkPermission(perm);



More information about the libbluray-devel mailing list