8162102: access denied to System Property awt.robot.gtk
Reviewed-by: ssadetsky, serb
--- 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;