Skip to content

Commit 4bbb937

Browse files
Merge branch '9.0' into backport/9.0/pr-121335
2 parents 75ca7d7 + 92b5abf commit 4bbb937

File tree

32 files changed

+550
-283
lines changed

32 files changed

+550
-283
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/RestrictedBuildApiService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
9393
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:smoke-test-security-with-mustache");
9494
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:xpack-prefix-rest-compat");
9595
map.put(LegacyRestTestBasePlugin.class, ":modules:ingest-geoip:qa:file-based-update");
96-
map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-ec2:qa:amazon-ec2");
9796
map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-gce:qa:gce");
9897
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:multi-cluster-search-security:legacy-with-basic-license");
9998
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:multi-cluster-search-security:legacy-with-full-license");

build-tools-internal/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jna = 5.12.1
1717
netty = 4.1.115.Final
1818
commons_lang3 = 3.9
1919
google_oauth_client = 1.34.1
20-
awsv1sdk = 1.12.270
20+
awsv1sdk = 1.12.746
2121
awsv2sdk = 2.28.13
2222
reactive_streams = 1.0.4
2323

docs/changelog/122431.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122431
2+
summary: Upgrade AWS SDK to v1.12.746
3+
area: Snapshot/Restore
4+
type: upgrade
5+
issues: []

docs/changelog/122640.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122640
2+
summary: Fix redact processor arraycopy bug
3+
area: Ingest Node
4+
type: bug
5+
issues: []

gradle/verification-metadata.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,29 @@
8989
<sha256 value="ccc7efe5cd3ce22d6046cafd4d2f8bff5adcb43e0d27da482178fac5daadef81" origin="Generated by Gradle"/>
9090
</artifact>
9191
</component>
92-
<component group="com.amazonaws" name="aws-java-sdk-core" version="1.12.270">
93-
<artifact name="aws-java-sdk-core-1.12.270.jar">
94-
<sha256 value="4e41d9f54606151674fc550e5e6291b0ddf917d55a2a3465a45a4e6ac98c9f8f" origin="Generated by Gradle"/>
92+
<component group="com.amazonaws" name="aws-java-sdk-core" version="1.12.746">
93+
<artifact name="aws-java-sdk-core-1.12.746.jar">
94+
<sha256 value="798fd30dafcf6816e760ad8aef8b3f09c43351ed2e166993bddc4527dbafb0be" origin="Generated by Gradle"/>
9595
</artifact>
9696
</component>
97-
<component group="com.amazonaws" name="aws-java-sdk-ec2" version="1.12.270">
98-
<artifact name="aws-java-sdk-ec2-1.12.270.jar">
99-
<sha256 value="faadf443751822e205338e80d2cea5eabd6373c1c3cef6348c24809ca82a9dd0" origin="Generated by Gradle"/>
97+
<component group="com.amazonaws" name="aws-java-sdk-ec2" version="1.12.746">
98+
<artifact name="aws-java-sdk-ec2-1.12.746.jar">
99+
<sha256 value="cec22d57e05ed75417b1342e9dd468c6fe7f2fab97c626c065d6495e44d732ad" origin="Generated by Gradle"/>
100100
</artifact>
101101
</component>
102-
<component group="com.amazonaws" name="aws-java-sdk-s3" version="1.12.270">
103-
<artifact name="aws-java-sdk-s3-1.12.270.jar">
104-
<sha256 value="41bbea44bac7cfce3898e2e598a17526984337e265f6b16814839c17168a570e" origin="Generated by Gradle"/>
102+
<component group="com.amazonaws" name="aws-java-sdk-s3" version="1.12.746">
103+
<artifact name="aws-java-sdk-s3-1.12.746.jar">
104+
<sha256 value="dcd839802c71ffc4d3e6bebc8769a2149bc423baf95f3e6c8214f9c91536bc38" origin="Generated by Gradle"/>
105105
</artifact>
106106
</component>
107-
<component group="com.amazonaws" name="aws-java-sdk-sts" version="1.12.270">
108-
<artifact name="aws-java-sdk-sts-1.12.270.jar">
109-
<sha256 value="8cf2d3705381b81808c2e75a5e25a7097385b121ef15c001b18fde3d79657571" origin="Generated by Gradle"/>
107+
<component group="com.amazonaws" name="aws-java-sdk-sts" version="1.12.746">
108+
<artifact name="aws-java-sdk-sts-1.12.746.jar">
109+
<sha256 value="2916c28f9a6b6ade40c7e2ffdea3788b198a98b2b16830e02a24ec49fc0fb06f" origin="Generated by Gradle"/>
110110
</artifact>
111111
</component>
112-
<component group="com.amazonaws" name="jmespath-java" version="1.12.270">
113-
<artifact name="jmespath-java-1.12.270.jar">
114-
<sha256 value="515d1afb0cd0176630c0707acabd4a3e48424ea938b89359774f61a24b6450f1" origin="Generated by Gradle"/>
112+
<component group="com.amazonaws" name="jmespath-java" version="1.12.746">
113+
<artifact name="jmespath-java-1.12.746.jar">
114+
<sha256 value="d4239a7a1bfacbb9cd1f0e48a46ac95960ab7942c6fbb41ea825161efea72351" origin="Generated by Gradle"/>
115115
</artifact>
116116
</component>
117117
<component group="com.avast.gradle" name="gradle-docker-compose-plugin" version="0.17.5">

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

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
package org.elasticsearch.entitlement.bridge;
1111

1212
import java.io.File;
13+
import java.io.FileFilter;
14+
import java.io.FilenameFilter;
1315
import java.io.InputStream;
1416
import java.io.PrintStream;
1517
import java.io.PrintWriter;
@@ -58,6 +60,8 @@
5860
import java.nio.file.LinkOption;
5961
import java.nio.file.OpenOption;
6062
import java.nio.file.Path;
63+
import java.nio.file.WatchEvent;
64+
import java.nio.file.WatchService;
6165
import java.nio.file.attribute.FileAttribute;
6266
import java.nio.file.attribute.UserPrincipal;
6367
import java.nio.file.spi.FileSystemProvider;
@@ -510,6 +514,12 @@ public interface EntitlementChecker {
510514
//
511515

512516
// old io (ie File)
517+
void check$java_io_File$canExecute(Class<?> callerClass, File file);
518+
519+
void check$java_io_File$canRead(Class<?> callerClass, File file);
520+
521+
void check$java_io_File$canWrite(Class<?> callerClass, File file);
522+
513523
void check$java_io_File$createNewFile(Class<?> callerClass, File file);
514524

515525
void check$java_io_File$$createTempFile(Class<?> callerClass, String prefix, String suffix, File directory);
@@ -518,6 +528,28 @@ public interface EntitlementChecker {
518528

519529
void check$java_io_File$deleteOnExit(Class<?> callerClass, File file);
520530

531+
void check$java_io_File$exists(Class<?> callerClass, File file);
532+
533+
void check$java_io_File$isDirectory(Class<?> callerClass, File file);
534+
535+
void check$java_io_File$isFile(Class<?> callerClass, File file);
536+
537+
void check$java_io_File$isHidden(Class<?> callerClass, File file);
538+
539+
void check$java_io_File$lastModified(Class<?> callerClass, File file);
540+
541+
void check$java_io_File$length(Class<?> callerClass, File file);
542+
543+
void check$java_io_File$list(Class<?> callerClass, File file);
544+
545+
void check$java_io_File$list(Class<?> callerClass, File file, FilenameFilter filter);
546+
547+
void check$java_io_File$listFiles(Class<?> callerClass, File file);
548+
549+
void check$java_io_File$listFiles(Class<?> callerClass, File file, FileFilter filter);
550+
551+
void check$java_io_File$listFiles(Class<?> callerClass, File file, FilenameFilter filter);
552+
521553
void check$java_io_File$mkdir(Class<?> callerClass, File file);
522554

523555
void check$java_io_File$mkdirs(Class<?> callerClass, File file);
@@ -654,6 +686,19 @@ void checkNewByteChannel(
654686

655687
void checkType(Class<?> callerClass, FileStore that);
656688

689+
// path
690+
void checkPathToRealPath(Class<?> callerClass, Path that, LinkOption... options);
691+
692+
void checkPathRegister(Class<?> callerClass, Path that, WatchService watcher, WatchEvent.Kind<?>... events);
693+
694+
void checkPathRegister(
695+
Class<?> callerClass,
696+
Path that,
697+
WatchService watcher,
698+
WatchEvent.Kind<?>[] events,
699+
WatchEvent.Modifier... modifiers
700+
);
701+
657702
////////////////////
658703
//
659704
// Thread management
@@ -674,5 +719,4 @@ void checkNewByteChannel(
674719
void check$java_lang_Thread$setUncaughtExceptionHandler(Class<?> callerClass, Thread thread, Thread.UncaughtExceptionHandler ueh);
675720

676721
void check$java_lang_ThreadGroup$setMaxPriority(Class<?> callerClass, ThreadGroup threadGroup, int pri);
677-
678722
}

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/FileCheckActions.java

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ static Path readWriteFile() {
4646
return testRootDir.resolve("read_write_file");
4747
}
4848

49+
@EntitlementTest(expectedAccess = PLUGINS)
50+
static void fileCanExecute() throws IOException {
51+
readFile().toFile().canExecute();
52+
}
53+
54+
@EntitlementTest(expectedAccess = PLUGINS)
55+
static void fileCanRead() throws IOException {
56+
readFile().toFile().canRead();
57+
}
58+
59+
@EntitlementTest(expectedAccess = PLUGINS)
60+
static void fileCanWrite() throws IOException {
61+
readFile().toFile().canWrite();
62+
}
63+
4964
@EntitlementTest(expectedAccess = PLUGINS)
5065
static void fileCreateNewFile() throws IOException {
5166
readWriteDir().resolve("new_file").toFile().createNewFile();
@@ -70,6 +85,61 @@ static void fileDeleteOnExit() throws IOException {
7085
toDelete.toFile().deleteOnExit();
7186
}
7287

88+
@EntitlementTest(expectedAccess = PLUGINS)
89+
static void fileExists() throws IOException {
90+
readFile().toFile().exists();
91+
}
92+
93+
@EntitlementTest(expectedAccess = PLUGINS)
94+
static void fileIsDirectory() throws IOException {
95+
readFile().toFile().isDirectory();
96+
}
97+
98+
@EntitlementTest(expectedAccess = PLUGINS)
99+
static void fileIsFile() throws IOException {
100+
readFile().toFile().isFile();
101+
}
102+
103+
@EntitlementTest(expectedAccess = PLUGINS)
104+
static void fileIsHidden() throws IOException {
105+
readFile().toFile().isHidden();
106+
}
107+
108+
@EntitlementTest(expectedAccess = PLUGINS)
109+
static void fileLastModified() throws IOException {
110+
readFile().toFile().lastModified();
111+
}
112+
113+
@EntitlementTest(expectedAccess = PLUGINS)
114+
static void fileLength() throws IOException {
115+
readFile().toFile().length();
116+
}
117+
118+
@EntitlementTest(expectedAccess = PLUGINS)
119+
static void fileList() throws IOException {
120+
readDir().toFile().list();
121+
}
122+
123+
@EntitlementTest(expectedAccess = PLUGINS)
124+
static void fileListWithFilter() throws IOException {
125+
readDir().toFile().list((dir, name) -> true);
126+
}
127+
128+
@EntitlementTest(expectedAccess = PLUGINS)
129+
static void fileListFiles() throws IOException {
130+
readDir().toFile().listFiles();
131+
}
132+
133+
@EntitlementTest(expectedAccess = PLUGINS)
134+
static void fileListFilesWithFileFilter() throws IOException {
135+
readDir().toFile().listFiles(pathname -> true);
136+
}
137+
138+
@EntitlementTest(expectedAccess = PLUGINS)
139+
static void fileListFilesWithFilenameFilter() throws IOException {
140+
readDir().toFile().listFiles((dir, name) -> true);
141+
}
142+
73143
@EntitlementTest(expectedAccess = PLUGINS)
74144
static void fileMkdir() throws IOException {
75145
Path mkdir = readWriteDir().resolve("mkdir");

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/LoadNativeLibrariesCheckActions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
class LoadNativeLibrariesCheckActions {
1313
static void runtimeLoad() {
1414
try {
15-
Runtime.getRuntime().load("libSomeLibFile.so");
15+
Runtime.getRuntime().load(FileCheckActions.readDir().resolve("libSomeLibFile.so").toString());
1616
} catch (UnsatisfiedLinkError ignored) {
1717
// The library does not exist, so we expect to fail loading it
1818
}
1919
}
2020

2121
static void systemLoad() {
2222
try {
23-
System.load("libSomeLibFile.so");
23+
System.load(FileCheckActions.readDir().resolve("libSomeLibFile.so").toString());
2424
} catch (UnsatisfiedLinkError ignored) {
2525
// The library does not exist, so we expect to fail loading it
2626
}

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/NativeActions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void memorySegmentReinterpretWithSizeAndCleanup() {
113113
@EntitlementTest(expectedAccess = PLUGINS)
114114
static void symbolLookupWithPath() {
115115
try {
116-
SymbolLookup.libraryLookup(Path.of("/foo/bar/libFoo.so"), Arena.ofAuto());
116+
SymbolLookup.libraryLookup(FileCheckActions.readDir().resolve("libFoo.so"), Arena.ofAuto());
117117
} catch (IllegalArgumentException e) {
118118
// IllegalArgumentException is thrown if path does not point to a valid library (and it does not)
119119
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.entitlement.qa.test;
11+
12+
import java.io.IOException;
13+
import java.nio.file.FileSystems;
14+
import java.nio.file.LinkOption;
15+
import java.nio.file.WatchEvent;
16+
17+
import static org.elasticsearch.entitlement.qa.test.EntitlementTest.ExpectedAccess.PLUGINS;
18+
19+
class PathActions {
20+
21+
@EntitlementTest(expectedAccess = PLUGINS)
22+
static void checkToRealPath() throws IOException {
23+
FileCheckActions.readFile().toRealPath();
24+
}
25+
26+
@EntitlementTest(expectedAccess = PLUGINS)
27+
static void checkToRealPathNoFollow() throws IOException {
28+
FileCheckActions.readFile().toRealPath(LinkOption.NOFOLLOW_LINKS);
29+
}
30+
31+
@SuppressWarnings("rawtypes")
32+
@EntitlementTest(expectedAccess = PLUGINS)
33+
static void checkRegister() throws IOException {
34+
try (var watchService = FileSystems.getDefault().newWatchService()) {
35+
FileCheckActions.readFile().register(watchService, new WatchEvent.Kind[0]);
36+
} catch (IllegalArgumentException e) {
37+
// intentionally no events registered
38+
}
39+
}
40+
41+
@SuppressWarnings("rawtypes")
42+
@EntitlementTest(expectedAccess = PLUGINS)
43+
static void checkRegisterWithModifiers() throws IOException {
44+
try (var watchService = FileSystems.getDefault().newWatchService()) {
45+
FileCheckActions.readFile().register(watchService, new WatchEvent.Kind[0], new WatchEvent.Modifier[0]);
46+
} catch (IllegalArgumentException e) {
47+
// intentionally no events registered
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)