Skip to content

Commit cce25fd

Browse files
committed
don't do that
1 parent 5fbb8ad commit cce25fd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,11 @@ private static Set<Module> findSystemModules() {
126126
.stream()
127127
.map(ModuleReference::descriptor)
128128
.collect(Collectors.toUnmodifiableSet());
129-
return Stream.concat(
130-
// entitlements is a "system" module, we can do anything from it
131-
Stream.of(PolicyManager.class.getModule()),
132-
// anything in the boot layer is also part of the system
133-
ModuleLayer.boot().modules().stream().filter(m -> systemModulesDescriptors.contains(m.getDescriptor()))
134-
).collect(Collectors.toUnmodifiableSet());
129+
return ModuleLayer.boot()
130+
.modules()
131+
.stream()
132+
.filter(m -> systemModulesDescriptors.contains(m.getDescriptor()))
133+
.collect(Collectors.toUnmodifiableSet());
135134
}
136135

137136
/**

libs/entitlement/src/test/java/org/elasticsearch/entitlement/runtime/policy/FileAccessTreeTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static org.elasticsearch.core.PathUtils.getDefaultFileSystem;
2424
import static org.hamcrest.Matchers.is;
2525

26+
@ESTestCase.WithoutSecurityManager
2627
public class FileAccessTreeTests extends ESTestCase {
2728

2829
static Path root;

0 commit comments

Comments
 (0)