Skip to content

Commit 65c0f04

Browse files
committed
fix signature
1 parent 51f1447 commit 65c0f04

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

libs/entitlement/bridge/src/main/java/org/elasticsearch/entitlement/bridge/EntitlementChecker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import java.nio.channels.SocketChannel;
5151
import java.nio.channels.spi.SelectorProvider;
5252
import java.nio.charset.Charset;
53+
import java.nio.file.LinkOption;
5354
import java.nio.file.OpenOption;
5455
import java.nio.file.Path;
5556
import java.nio.file.attribute.UserPrincipal;
@@ -514,7 +515,7 @@ public interface EntitlementChecker {
514515
void check$java_util_Scanner$(Class<?> callerClass, File source, Charset charset);
515516

516517
// nio
517-
void check$java_nio_file_Files$$getOwner(Class<?> callerClass, Path path);
518+
void check$java_nio_file_Files$$getOwner(Class<?> callerClass, Path path, LinkOption... options);
518519

519520
void check$java_nio_file_Files$$probeContentType(Class<?> callerClass, Path path);
520521

libs/entitlement/qa/src/javaRestTest/java/org/elasticsearch/entitlement/qa/EntitlementsTestRule.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ class EntitlementsTestRule implements TestRule {
3434
// entitlements that test methods may use, see EntitledActions
3535
private static final PolicyBuilder ENTITLED_POLICY = (builder, tempDir) -> {
3636
builder.value(Map.of("write_system_properties", Map.of("properties", List.of("org.elasticsearch.entitlement.qa.selfTest"))));
37-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_dir"), "mode", "read")));
38-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_write_dir"), "mode", "read_write")));
39-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_file"), "mode", "read")));
40-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_write_file"), "mode", "read_write")));
37+
builder.value(
38+
Map.of(
39+
"files",
40+
List.of(
41+
Map.of("path", tempDir.resolve("read_dir"), "mode", "read"),
42+
Map.of("path", tempDir.resolve("read_write_dir"), "mode", "read_write"),
43+
Map.of("path", tempDir.resolve("read_file"), "mode", "read"),
44+
Map.of("path", tempDir.resolve("read_write_file"), "mode", "read_write")
45+
)
46+
)
47+
);
4148
};
4249

4350
interface PolicyBuilder {

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/api/ElasticsearchEntitlementChecker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import java.nio.channels.SocketChannel;
5656
import java.nio.channels.spi.SelectorProvider;
5757
import java.nio.charset.Charset;
58+
import java.nio.file.LinkOption;
5859
import java.nio.file.OpenOption;
5960
import java.nio.file.Path;
6061
import java.nio.file.attribute.UserPrincipal;
@@ -977,7 +978,7 @@ public void checkSelectorProviderInheritedChannel(Class<?> callerClass, Selector
977978
// nio
978979

979980
@Override
980-
public void check$java_nio_file_Files$$getOwner(Class<?> callerClass, Path path) {
981+
public void check$java_nio_file_Files$$getOwner(Class<?> callerClass, Path path, LinkOption... options) {
981982
policyManager.checkFileRead(callerClass, path);
982983
}
983984

0 commit comments

Comments
 (0)