You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Volth (JIRA)" <ji...@apache.org> on 2015/11/05 03:01:27 UTC
[jira] [Updated] (SSHD-579) The last portion of stdout is not
received
[ https://issues.apache.org/jira/browse/SSHD-579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Volth updated SSHD-579:
-----------------------
Description:
Simple client code:
{code:java}
val client = sshd.client.ClientBuilder.builder.build()
client.start()
val session = client.connect("root", host, 22).verify().getSession()
session.addPasswordIdentity(pw)
session.auth().verify()
val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 8.8.8.8\"") // 'bash -c' not needed; it increases % of reproducibility
channel.setOut(new sshd.common.util.io.NoCloseOutputStream(System.out))
channel.setErr(new sshd.common.util.io.NoCloseOutputStream(System.err))
channel.setUsePty(true)
channel.open().verify()
channel.waitFor(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED :: Nil, 0)
println("channel.getExitStatus="+channel.getExitStatus)
{code}
When there is openssh-6.9 on the server (Ubuntu 15.10 default) and setUsePty is set to true, the last message with stdout data (SSH_MSG_CHANNEL_DATA) is often lost:
http://i.imgur.com/LNdNSRq.png
With setUsePty(false) or with openssh-6.7 on the server everything is fine.
When the last SSH_MSG_CHANNEL_DATA is not lost, it comes after SSH_MSG_CHANNEL_REQUEST with "exit-status".
With the OpenSSH client ("ssh -vvv root@server /bin/bash -c '/bin/ping -c3 8.8.8.8'" also shows this weird ordering) all the messages are always received.
I trued Mins SSHD 1.0.0 and the latest revision from github's master branch.
was:
Simple client code:
{code:scala}
val client = sshd.client.ClientBuilder.builder.build()
client.start()
val session = client.connect("root", host, 22).verify().getSession()
session.addPasswordIdentity(pw)
session.auth().verify()
val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 8.8.8.8\"") // 'bash -c' not needed; it increases % of reproducibility
channel.setOut(new sshd.common.util.io.NoCloseOutputStream(System.out))
channel.setErr(new sshd.common.util.io.NoCloseOutputStream(System.err))
channel.setUsePty(true)
channel.open().verify()
channel.waitFor(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED :: Nil, 0)
println("channel.getExitStatus="+channel.getExitStatus)
{code}
When there is openssh-6.9 on the server (Ubuntu 15.10 default) and setUsePty is set to true, the last message with stdout data (SSH_MSG_CHANNEL_DATA) is often lost:
http://i.imgur.com/LNdNSRq.png
With setUsePty(false) or with openssh-6.7 on the server everything is fine.
When the last SSH_MSG_CHANNEL_DATA is not lost, it comes after SSH_MSG_CHANNEL_REQUEST with "exit-status".
With the OpenSSH client ("ssh -vvv root@server /bin/bash -c '/bin/ping -c3 8.8.8.8'" also shows this weird ordering) all the messages are always received.
I trued Mins SSHD 1.0.0 and the latest revision from github's master branch.
> The last portion of stdout is not received
> ------------------------------------------
>
> Key: SSHD-579
> URL: https://issues.apache.org/jira/browse/SSHD-579
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Volth
>
> Simple client code:
> {code:java}
> val client = sshd.client.ClientBuilder.builder.build()
> client.start()
> val session = client.connect("root", host, 22).verify().getSession()
> session.addPasswordIdentity(pw)
> session.auth().verify()
> val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 8.8.8.8\"") // 'bash -c' not needed; it increases % of reproducibility
> channel.setOut(new sshd.common.util.io.NoCloseOutputStream(System.out))
> channel.setErr(new sshd.common.util.io.NoCloseOutputStream(System.err))
> channel.setUsePty(true)
> channel.open().verify()
> channel.waitFor(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED :: Nil, 0)
> println("channel.getExitStatus="+channel.getExitStatus)
> {code}
> When there is openssh-6.9 on the server (Ubuntu 15.10 default) and setUsePty is set to true, the last message with stdout data (SSH_MSG_CHANNEL_DATA) is often lost:
> http://i.imgur.com/LNdNSRq.png
> With setUsePty(false) or with openssh-6.7 on the server everything is fine.
> When the last SSH_MSG_CHANNEL_DATA is not lost, it comes after SSH_MSG_CHANNEL_REQUEST with "exit-status".
> With the OpenSSH client ("ssh -vvv root@server /bin/bash -c '/bin/ping -c3 8.8.8.8'" also shows this weird ordering) all the messages are always received.
> I trued Mins SSHD 1.0.0 and the latest revision from github's master branch.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)