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 @@ -113,7 +113,7 @@ static void memorySegmentReinterpretWithSizeAndCleanup() {
@EntitlementTest(expectedAccess = PLUGINS)
static void symbolLookupWithPath() {
try {
SymbolLookup.libraryLookup(Path.of("/foo/bar/libFoo.so"), Arena.ofAuto());
SymbolLookup.libraryLookup(FileCheckActions.readDir().resolve("libFoo.so"), Arena.ofAuto());
} catch (IllegalArgumentException e) {
// IllegalArgumentException is thrown if path does not point to a valid library (and it does not)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,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 @@ -846,7 +846,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 Expand Up @@ -930,7 +930,7 @@ public void checkSelectorProviderInheritedChannel(Class<?> callerClass, Selector

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

Expand Down