Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
class LoadNativeLibrariesCheckActions {
static void runtimeLoad() {
try {
Runtime.getRuntime().load("libSomeLibFile.so");
Runtime.getRuntime().load(FileCheckActions.readDir().resolve("libSomeLibFile.so").toString());
} catch (UnsatisfiedLinkError ignored) {
// The library does not exist, so we expect to fail loading it
}
}

static void systemLoad() {
try {
System.load("libSomeLibFile.so");
System.load(FileCheckActions.readDir().resolve("libSomeLibFile.so").toString());
} catch (UnsatisfiedLinkError ignored) {
// The library does not exist, so we expect to fail loading it
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ public void checkSelectorProviderInheritedChannel(Class<?> callerClass, Selector

@Override
public void check$java_lang_Runtime$load(Class<?> callerClass, Runtime that, String filename) {
// TODO: check filesystem entitlement READ
policyManager.checkFileRead(callerClass, Path.of(filename));
policyManager.checkLoadingNativeLibraries(callerClass);
}

Expand All @@ -839,7 +839,7 @@ public void checkSelectorProviderInheritedChannel(Class<?> callerClass, Selector

@Override
public void check$java_lang_System$$load(Class<?> callerClass, String filename) {
// TODO: check filesystem entitlement READ
policyManager.checkFileRead(callerClass, Path.of(filename));
policyManager.checkLoadingNativeLibraries(callerClass);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Java19ElasticsearchEntitlementChecker(PolicyManager policyManager) {

@Override
public void check$java_lang_foreign_SymbolLookup$$libraryLookup(Class<?> callerClass, Path path, MemorySession session) {
// TODO: check filesystem entitlement READ
policyManager.checkFileRead(callerClass, path);
policyManager.checkLoadingNativeLibraries(callerClass);
}
}