Skip to content

Commit 21b1748

Browse files
committed
give read access to code
1 parent 199e344 commit 21b1748

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ private static List<Scope> createServerEntitlements(Path pidFile) {
115115
)
116116
),
117117
new Scope("java.desktop", List.of(new LoadNativeLibrariesEntitlement())),
118-
new Scope("java.xml", List.of(new ReadJdkImageEntitlement())),
118+
new Scope("java.xml", List.of(
119+
new ReadJdkImageEntitlement(),
120+
// java.xml does some reflective stuff that reads calling jars, so allow reading the codebases
121+
// of any code in the system so that they can all use java.xml
122+
new FilesEntitlement(List.of(FilesEntitlement.FileData.ofBaseDirPath(LIB, READ))),
123+
new FilesEntitlement(List.of(FilesEntitlement.FileData.ofBaseDirPath(MODULES, READ))),
124+
new FilesEntitlement(List.of(FilesEntitlement.FileData.ofBaseDirPath(PLUGINS, READ))))),
119125
new Scope("org.apache.httpcomponents.httpclient", List.of(new OutboundNetworkEntitlement())),
120126
new Scope(
121127
"org.apache.lucene.core",

0 commit comments

Comments
 (0)