8154405: AccessControlException by URLPermission check

Reviewed-by: serb, ssadetsky, mullan
This commit is contained in:
Dmitry Markov 2017-12-13 14:41:27 +00:00
parent fd4c8197ab
commit 90060a97f9

View file

@ -673,11 +673,13 @@ public abstract class Toolkit {
* <p> * <p>
* This method first checks if there is a security manager installed. * This method first checks if there is a security manager installed.
* If so, the method calls the security manager's * If so, the method calls the security manager's
* {@code checkPermission} method with the * {@code checkPermission} method with the corresponding
* url.openConnection().getPermission() permission to ensure * permission to ensure that the access to the image is allowed.
* that the access to the image is allowed. For compatibility * If the connection to the specified URL requires
* with pre-1.2 security managers, if the access is denied with * either {@code URLPermission} or {@code SocketPermission},
* {@code FilePermission} or {@code SocketPermission}, * then {@code URLPermission} is used for security checks.
* For compatibility with pre-1.2 security managers, if the access
* is denied with {@code FilePermission} or {@code SocketPermission},
* the method throws the {@code SecurityException} * the method throws the {@code SecurityException}
* if the corresponding 1.1-style SecurityManager.checkXXX method * if the corresponding 1.1-style SecurityManager.checkXXX method
* also denies permission. * also denies permission.
@ -717,11 +719,13 @@ public abstract class Toolkit {
* <p> * <p>
* This method first checks if there is a security manager installed. * This method first checks if there is a security manager installed.
* If so, the method calls the security manager's * If so, the method calls the security manager's
* {@code checkPermission} method with the * {@code checkPermission} method with the corresponding
* url.openConnection().getPermission() permission to ensure * permission to ensure that the image creation is allowed.
* that the image creation is allowed. For compatibility * If the connection to the specified URL requires
* with pre-1.2 security managers, if the access is denied with * either {@code URLPermission} or {@code SocketPermission},
* {@code FilePermission} or {@code SocketPermission}, * then {@code URLPermission} is used for security checks.
* For compatibility with pre-1.2 security managers, if the access
* is denied with {@code FilePermission} or {@code SocketPermission},
* the method throws {@code SecurityException} * the method throws {@code SecurityException}
* if the corresponding 1.1-style SecurityManager.checkXXX method * if the corresponding 1.1-style SecurityManager.checkXXX method
* also denies permission. * also denies permission.