Skip to content

Commit 03196b1

Browse files
committed
comment and fix test
1 parent 5028b07 commit 03196b1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ private FileAccessTree(
140140

141141
// everything has access to the temp dir, config dir and the jdk
142142
addPathAndMaybeLink.accept(pathLookup.tempDir(), Mode.READ_WRITE);
143+
// TODO: this grants read access to the config dir for all modules until explicit read entitlements can be added
143144
addPathAndMaybeLink.accept(pathLookup.configDir(), Mode.READ);
144145

145146
// TODO: watcher uses javax.activation which looks for known mime types configuration, should this be global or explicit in watcher?

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void testPathAndFileWithSamePrefix() {
136136
}
137137

138138
public void testReadWithRelativePath() {
139-
for (var dir : List.of("config", "home")) {
139+
for (var dir : List.of("home")) {
140140
var tree = accessTree(entitlement(Map.of("relative_path", "foo", "mode", "read", "relative_to", dir)), List.of());
141141
assertThat(tree.canRead(path("foo")), is(false));
142142

@@ -153,7 +153,7 @@ public void testReadWithRelativePath() {
153153
}
154154

155155
public void testWriteWithRelativePath() {
156-
for (var dir : List.of("config", "home")) {
156+
for (var dir : List.of("home")) {
157157
var tree = accessTree(entitlement(Map.of("relative_path", "foo", "mode", "read_write", "relative_to", dir)), List.of());
158158
assertThat(tree.canWrite(path("/" + dir + "/foo")), is(true));
159159
assertThat(tree.canWrite(path("/" + dir + "/foo/subdir")), is(true));

0 commit comments

Comments
 (0)