Skip to content

Commit 55c0a28

Browse files
authored
Grant manage_threads to java.desktop for Tika (#134454) (#134559)
* Grant manage_threads to java.desktop for Tika * Produce a PolicyScope for excluded system modules. Fortunately, the JDK is still modular even if the tests are run sans modules, so we can use the module API to identify the packages in every system module. * TODO with Jira link
1 parent 62675d1 commit 55c0a28

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/HardcodedEntitlements.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
114114
new FilesEntitlement(serverModuleFileDatas)
115115
)
116116
),
117-
new Scope("java.desktop", List.of(new LoadNativeLibrariesEntitlement())),
117+
new Scope(
118+
"java.desktop",
119+
List.of(
120+
new LoadNativeLibrariesEntitlement(),
121+
new ManageThreadsEntitlement() // For sun.java2d.Disposer. TODO: https://elasticco.atlassian.net/browse/ES-12888
122+
)
123+
),
118124
new Scope(
119125
"java.xml",
120126
List.of(

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class PolicyManager {
5151
*/
5252
static final Logger generalLogger = LogManager.getLogger(PolicyManager.class);
5353

54-
static final Set<String> MODULES_EXCLUDED_FROM_SYSTEM_MODULES = Set.of("java.desktop", "java.xml");
54+
public static final Set<String> MODULES_EXCLUDED_FROM_SYSTEM_MODULES = Set.of("java.desktop", "java.xml");
5555

5656
/**
5757
* Identifies a particular entitlement {@link Scope} within a {@link Policy}.
@@ -91,7 +91,7 @@ public enum ComponentKind {
9191
* If this kind corresponds to a single component, this is that component's name;
9292
* otherwise null.
9393
*/
94-
final String componentName;
94+
public final String componentName;
9595

9696
ComponentKind(String componentName) {
9797
this.componentName = componentName;

0 commit comments

Comments
 (0)