Running 0.6.0 MINA SSHD

Executing SshClient with command parameters results in an
IllegalArgumentException

For example calling SshClient with the following parameters
-l chris 10.0.0.58 ls

After entering the ssh password the exception is thrown.

Bug is on line #402 in SshClient.java

channel = session.createChannel(ClientChannel.CHANNEL_EXEC);

CreateChannel cannot be called without a command string parameter.

Adding this to the code works.

                StringBuffer sb = new StringBuffer();
                for (String cmd : command) {
                    sb.append(cmd).append(" ");
                }
                channel = session.createChannel(ClientChannel.CHANNEL_EXEC,
sb.toString());

However the intention of the application seems to want to call another
method of passing the command line. I have tried to pass the command via the
channel.setIn method without success.




Reply via email to