changeset 41384:34b9174098ad

8162102: access denied to System Property awt.robot.gtk Reviewed-by: ssadetsky, serb
author arapte
date Thu, 15 Sep 2016 01:36:56 +0530
parents dd6dd24db080
children cb7b11285ba5
files jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Wed Sep 14 21:50:44 2016 +0530
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Thu Sep 15 01:36:56 2016 +0530
@@ -26,6 +26,8 @@
 
 import java.awt.*;
 import java.awt.peer.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
@@ -38,7 +40,8 @@
     static final boolean tryGtk;
     static {
         loadNativeLibraries();
-        tryGtk = Boolean.getBoolean("awt.robot.gtk");
+        tryGtk = AccessController.doPrivileged((PrivilegedAction<Boolean>)()
+                -> Boolean.getBoolean("awt.robot.gtk"));
     }
 
     private static boolean isGtkSupported =  false;