mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8260520: Avoid getting permissions in JarFileFactory when no SecurityManager installed
Reviewed-by: alanb, dfuchs, michaelm, mullan
This commit is contained in:
parent
ecde52ece6
commit
8fe1323dcb
2 changed files with 10 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -123,10 +123,10 @@ class JarFileFactory implements URLJarFile.URLJarFileCloseController {
|
|||
|
||||
/* if the JAR file is cached, the permission will always be there */
|
||||
if (result != null) {
|
||||
Permission perm = getPermission(result);
|
||||
if (perm != null) {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
Permission perm = getPermission(result);
|
||||
if (perm != null) {
|
||||
try {
|
||||
sm.checkPermission(perm);
|
||||
} catch (SecurityException se) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue