This is an automated email from the ASF dual-hosted git repository. slfan1989 pushed a commit to branch branch-3.4.0 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.4.0 by this push: new cadf881e29f9 HADOOP-18894: upgrade sshd-core due to CVEs (#6060) Contributed by PJ Fanning. cadf881e29f9 is described below commit cadf881e29f94f3cda9c8b7043aca5a565671fb0 Author: PJ Fanning <pjfann...@users.noreply.github.com> AuthorDate: Sun Jan 21 01:13:25 2024 +0100 HADOOP-18894: upgrade sshd-core due to CVEs (#6060) Contributed by PJ Fanning. Reviewed-by: He Xiaoqiao <hexiaoq...@apache.org> Reviewed-by: Steve Loughran <ste...@cloudera.com> Signed-off-by: Shilun Fan <slfan1...@apache.org> --- LICENSE-binary | 3 +++ hadoop-common-project/hadoop-common/pom.xml | 5 +++++ .../apache/hadoop/fs/contract/sftp/SFTPContract.java | 7 +++---- .../org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java | 18 +++++++----------- hadoop-project/pom.xml | 8 +++++++- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/LICENSE-binary b/LICENSE-binary index 1ebc44b0580a..3720a7809563 100644 --- a/LICENSE-binary +++ b/LICENSE-binary @@ -335,6 +335,9 @@ org.apache.kerby:kerby-pkix:2.0.3 org.apache.kerby:kerby-util:2.0.3 org.apache.kerby:kerby-xdr:2.0.3 org.apache.kerby:token-provider:2.0.3 +org.apache.sshd:sshd-common:2.11.0 +org.apache.sshd:sshd-core:2.11.0 +org.apache.sshd:sshd-sftp:2.11.0 org.apache.solr:solr-solrj:8.11.2 org.apache.yetus:audience-annotations:0.5.0 org.apache.zookeeper:zookeeper:3.8.3 diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml index 9f4db88684a8..a18fdbf37f8f 100644 --- a/hadoop-common-project/hadoop-common/pom.xml +++ b/hadoop-common-project/hadoop-common/pom.xml @@ -316,6 +316,11 @@ <artifactId>sshd-core</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.sshd</groupId> + <artifactId>sshd-sftp</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.apache.ftpserver</groupId> <artifactId>ftpserver-core</artifactId> diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java index f72a2aec8624..631c89586514 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java @@ -31,12 +31,11 @@ import org.apache.hadoop.fs.FileSystemTestHelper; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.sftp.SFTPFileSystem; -import org.apache.sshd.common.NamedFactory; import org.apache.sshd.server.SshServer; -import org.apache.sshd.server.auth.UserAuth; +import org.apache.sshd.server.auth.UserAuthFactory; import org.apache.sshd.server.auth.password.UserAuthPasswordFactory; import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; -import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory; +import org.apache.sshd.sftp.server.SftpSubsystemFactory; public class SFTPContract extends AbstractFSContract { @@ -61,7 +60,7 @@ public class SFTPContract extends AbstractFSContract { sshd.setPort(0); sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider()); - List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<>(); + List<UserAuthFactory> userAuthFactories = new ArrayList<>(); userAuthFactories.add(new UserAuthPasswordFactory()); sshd.setUserAuthFactories(userAuthFactories); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java index e8ba5f211eb8..e425c2dea284 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java @@ -22,7 +22,7 @@ import java.net.URI; import java.nio.file.Files; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; import org.apache.hadoop.conf.Configuration; @@ -35,18 +35,13 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.test.GenericTestUtils; import static org.apache.hadoop.test.PlatformAssumptions.assumeNotWindows; -import org.apache.sshd.common.NamedFactory; -import org.apache.sshd.server.Command; import org.apache.sshd.server.SshServer; -import org.apache.sshd.server.auth.UserAuth; +import org.apache.sshd.server.auth.UserAuthFactory; import org.apache.sshd.server.auth.password.PasswordAuthenticator; import org.apache.sshd.server.auth.password.UserAuthPasswordFactory; import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; import org.apache.sshd.server.session.ServerSession; -import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory; - -import org.junit.After; -import org.junit.AfterClass; +import org.apache.sshd.sftp.server.SftpSubsystemFactory; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertArrayEquals; @@ -54,6 +49,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import org.junit.After; +import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; @@ -82,8 +79,7 @@ public class TestSFTPFileSystem { sshd.setPort(0); sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider()); - List<NamedFactory<UserAuth>> userAuthFactories = - new ArrayList<NamedFactory<UserAuth>>(); + List<UserAuthFactory> userAuthFactories = new ArrayList<>(); userAuthFactories.add(new UserAuthPasswordFactory()); sshd.setUserAuthFactories(userAuthFactories); @@ -100,7 +96,7 @@ public class TestSFTPFileSystem { }); sshd.setSubsystemFactories( - Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory())); + Collections.singletonList(new SftpSubsystemFactory())); sshd.start(); port = sshd.getPort(); diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index f999f37e3406..2c0cc3edcb6c 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -202,6 +202,7 @@ <swagger-annotations-version>1.5.4</swagger-annotations-version> <snakeyaml.version>2.0</snakeyaml.version> + <sshd.version>2.11.0</sshd.version> <hbase.one.version>1.7.1</hbase.one.version> <hbase.two.version>2.2.4</hbase.two.version> <junit.version>4.13.2</junit.version> @@ -1133,7 +1134,12 @@ <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-core</artifactId> - <version>1.6.0</version> + <version>${sshd.version}</version> + </dependency> + <dependency> + <groupId>org.apache.sshd</groupId> + <artifactId>sshd-sftp</artifactId> + <version>${sshd.version}</version> </dependency> <dependency> <groupId>org.apache.ftpserver</groupId> --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org