[ 
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}
      import org.apache.sshd
      import scala.collection.JavaConversions._

      val client = sshd.client.ClientBuilder.builder.build()
      client.start()

      val session = client.connect("root", host, 22).verify().getSession()
      session.addPasswordIdentity(pw)
      session.auth().verify()

      // 'bash -c' not needed; it increases % of reproducibility
      val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 
8.8.8.8\"") 
      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(List(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED),
 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
There is no bug either with setUsePty(false) or with openssh-6.7 on the server.

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 tried Mina SSHD 1.0.0 and the latest revision from github's master branch.

  was:
Simple client code:
{code:java}
      import org.apache.sshd
      import scala.collection.JavaConversions._

      val client = sshd.client.ClientBuilder.builder.build()
      client.start()

      val session = client.connect("root", host, 22).verify().getSession()
      session.addPasswordIdentity(pw)
      session.auth().verify()

      // 'bash -c' not needed; it increases % of reproducibility
      val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 
8.8.8.8\"") 
      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(List(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED),
 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 tried Mina 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}
>       import org.apache.sshd
>       import scala.collection.JavaConversions._
>       val client = sshd.client.ClientBuilder.builder.build()
>       client.start()
>       val session = client.connect("root", host, 22).verify().getSession()
>       session.addPasswordIdentity(pw)
>       session.auth().verify()
>       // 'bash -c' not needed; it increases % of reproducibility
>       val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 
> 8.8.8.8\"") 
>       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(List(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED),
>  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
> There is no bug either with setUsePty(false) or with openssh-6.7 on the 
> server.
> 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 tried Mina SSHD 1.0.0 and the latest revision from github's master branch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to