karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5569) Cannot pass commands to client script when sftpEnabled=false
Date Wed, 17 Jan 2018 06:53:00 GMT

    [ https://issues.apache.org/jira/browse/KARAF-5569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16328352#comment-16328352
] 

ASF GitHub Bot commented on KARAF-5569:
---------------------------------------

jbonofre closed pull request #437: [KARAF-5569] Add CommandFactory to ssh server when sftp
is disabled
URL: https://github.com/apache/karaf/pull/437
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/Activator.java b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/Activator.java
index 1deb9fe009..bdd0aafe8a 100644
--- a/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/Activator.java
+++ b/shell/ssh/src/main/java/org/apache/karaf/shell/ssh/Activator.java
@@ -175,6 +175,8 @@ protected SshServer createSshServer(SessionFactory sessionFactory) {
             server.setCommandFactory(new ScpCommandFactory.Builder().withDelegate(cmd ->
new ShellCommand(sessionFactory, cmd)).build());
             server.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory()));
             server.setFileSystemFactory(new VirtualFileSystemFactory(Paths.get(System.getProperty("karaf.base"))));
+        } else {
+            server.setCommandFactory(cmd -> new ShellCommand(sessionFactory, cmd));
         }
         server.setKeyPairProvider(keyPairProvider);
         server.setPasswordAuthenticator(authenticator);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Cannot pass commands to client script when sftpEnabled=false
> ------------------------------------------------------------
>
>                 Key: KARAF-5569
>                 URL: https://issues.apache.org/jira/browse/KARAF-5569
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.1.4, 4.2.0
>            Reporter: Christopher Lockard
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 4.2.0, 4.1.5
>
>
> When sftpEnabed option is set to false in org.apache.karaf.shell.cfg the client script
hangs if it was passed in a command to run. For example the following will hang:
> {code:java}
> bin/client list{code}
> The issue seems to be that when sftp is disabled the command factory is never set on
the ssh server in shell/ssh/src/main/java/org/apache/karaf/shell/ssh/Activator.java resulting
in a failure here https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java#L519



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message