|
32 | 32 | import java.security.cert.Certificate; |
33 | 33 | import java.util.function.Supplier; |
34 | 34 |
|
35 | | -import jdk.graal.compiler.options.Option; |
36 | | -import jdk.graal.compiler.options.OptionType; |
37 | 35 | import org.graalvm.nativeimage.ImageSingletons; |
38 | 36 | import org.graalvm.nativeimage.Platform; |
39 | 37 | import org.graalvm.nativeimage.Platforms; |
|
42 | 40 | import com.oracle.svm.core.option.HostedOptionKey; |
43 | 41 | import com.oracle.svm.core.util.LazyFinalReference; |
44 | 42 |
|
| 43 | +import jdk.graal.compiler.options.Option; |
| 44 | +import jdk.graal.compiler.options.OptionType; |
45 | 45 | import sun.security.util.SecurityConstants; |
46 | 46 |
|
47 | 47 | /** |
@@ -69,10 +69,21 @@ public static class Options { |
69 | 69 | } |
70 | 70 |
|
71 | 71 | private final LazyFinalReference<ProtectionDomain> allPermDomain = new LazyFinalReference<>(this::createAllPermDomain); |
| 72 | + private final LazyFinalReference<ProtectionDomain> bootAllPermDomain = new LazyFinalReference<>(ProtectionDomainSupport::createBootAllPermDomain); |
72 | 73 |
|
73 | 74 | /** Remains null as long as the reachability handler has not triggered. */ |
74 | 75 | Supplier<URL> executableURLSupplier; |
75 | 76 |
|
| 77 | + public static ProtectionDomain bootAllPermDomain() { |
| 78 | + return ImageSingletons.lookup(ProtectionDomainSupport.class).bootAllPermDomain.get(); |
| 79 | + } |
| 80 | + |
| 81 | + private static ProtectionDomain createBootAllPermDomain() { |
| 82 | + java.security.Permissions perms = new java.security.Permissions(); |
| 83 | + perms.add(SecurityConstants.ALL_PERMISSION); |
| 84 | + return new java.security.ProtectionDomain(null, perms); |
| 85 | + } |
| 86 | + |
76 | 87 | public static ProtectionDomain allPermDomain() { |
77 | 88 | return ImageSingletons.lookup(ProtectionDomainSupport.class).allPermDomain.get(); |
78 | 89 | } |
|
0 commit comments