Skip to content

Commit b1737b5

Browse files
committed
let all unnamed modules do anything
1 parent 08bc6b0 commit b1737b5

File tree

1 file changed

+3
-3
lines changed
  • libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,6 @@ public void checkFileRead(Class<?> callerClass, Path path) {
332332
if (isTriviallyAllowed(requestingClass)) {
333333
return;
334334
}
335-
if (requestingClass.getName().equals("co.elastic.apm.agent.premain.ShadedClassLoader")) {
336-
return;
337-
}
338335
ModuleEntitlements entitlements = getEntitlements(requestingClass);
339336
if (entitlements.fileAccess().canRead(path) == false) {
340337
notEntitled(
@@ -610,6 +607,9 @@ Optional<Class<?>> findRequestingClass(Stream<Class<?>> classes) {
610607
* @return true if permission is granted regardless of the entitlement
611608
*/
612609
private static boolean isTriviallyAllowed(Class<?> requestingClass) {
610+
if (requestingClass.getModule().getName() == null) {
611+
return true;
612+
}
613613
if (logger.isTraceEnabled()) {
614614
logger.trace("Stack trace for upcoming trivially-allowed check", new Exception());
615615
}

0 commit comments

Comments
 (0)