You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Pierre (JIRA)" <ji...@apache.org> on 2012/04/30 06:45:35 UTC

[jira] [Updated] (SSHD-145) InvertedShellWrapper may not send process output back if process exits too fast

     [ https://issues.apache.org/jira/browse/SSHD-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre updated SSHD-145:
------------------------

    Attachment: patch-with-test.patch

Added {{path-with-test.patch}}, which is Denis's patch plus a simple JUnit test.
                
> InvertedShellWrapper may not send process output back if process exits too fast
> -------------------------------------------------------------------------------
>
>                 Key: SSHD-145
>                 URL: https://issues.apache.org/jira/browse/SSHD-145
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>         Environment: Usually does not reproduce on windows, often on linux (Ubuntu 11.04)
>            Reporter: Denis Tulskiy
>            Priority: Minor
>         Attachments: patch-with-test.patch
>
>
> In InvertedShellWrapper, pumpStreams() method first checks if the process is alive, and only then pumps streams. It could happen that after the process has already exited, some information is left out in out or err streams. Moving the check for shell.isAlive() after all pumpStream() calls seems to resolve the issue.
> I've uploaded a patch for your convenience here https://gist.github.com/1206056
> steps to reproduce:
> 1. create a default server
> 2. set command factory as described at http://mina.apache.org/sshd/tips.html
> 3. run `ssh localhost -p 8000 echo test`
> expected result:
> command output is `test`
> actual result:
> usually nothing is printed even though the command is executed

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira