You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by lg...@apache.org on 2020/08/01 08:10:48 UTC
[mina-sshd] 06/06: Added server subsystem CLI option value parsing
to allow specifying internal SFTP subsystem
This is an automated email from the ASF dual-hosted git repository.
lgoldstein pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-sshd.git
commit 63619933b01445a4fe5b35ffafb6c04107ec6834
Author: Lyor Goldstein <lg...@apache.org>
AuthorDate: Sat Aug 1 11:05:35 2020 +0300
Added server subsystem CLI option value parsing to allow specifying internal SFTP subsystem
---
.../java/org/apache/sshd/cli/server/SshServerCliSupport.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sshd-cli/src/main/java/org/apache/sshd/cli/server/SshServerCliSupport.java b/sshd-cli/src/main/java/org/apache/sshd/cli/server/SshServerCliSupport.java
index 677854f..c173cb7 100644
--- a/sshd-cli/src/main/java/org/apache/sshd/cli/server/SshServerCliSupport.java
+++ b/sshd-cli/src/main/java/org/apache/sshd/cli/server/SshServerCliSupport.java
@@ -63,6 +63,7 @@ import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
import org.apache.sshd.server.shell.InteractiveProcessShellFactory;
import org.apache.sshd.server.shell.ShellFactory;
import org.apache.sshd.server.subsystem.SubsystemFactory;
+import org.apache.sshd.sftp.common.SftpConstants;
import org.apache.sshd.sftp.server.SftpEventListener;
import org.apache.sshd.sftp.server.SftpSubsystemFactory;
@@ -196,6 +197,13 @@ public abstract class SshServerCliSupport extends CliSupport {
return Collections.emptyList();
}
+ if (SftpConstants.SFTP_SUBSYSTEM_NAME.equalsIgnoreCase(nameList)) {
+ SubsystemFactory factory = registerSubsystemFactoryListeners(
+ server, level, stdout, stderr, options, new SftpSubsystemFactory());
+ stdout.println("Using built-in SFTP subsystem");
+ return Collections.singletonList(factory);
+ }
+
boolean havePreferences = GenericUtils.isNotEmpty(nameList);
Collection<String> preferredNames = (!havePreferences)
? Collections.emptySet()
@@ -245,7 +253,7 @@ public abstract class SshServerCliSupport extends CliSupport {
* <LI>Otherwise, assumes this is a fully qualified class path of a {@link ShellFactory} implementation and attempts
* to load and instantiate it using a public no-args constructor</LI>
* </UL>
- *
+ *
* @param stderr The STDERR stream for errors
* @param options The available options - assuming defaults if {@code null}
* @return The resolved {@link ShellFactory}