Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-125

InvertedShellWrapper won't pump end of stream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 0.5.0
    • None
    • None

    Description

      The "pumpStreams" method ( http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java#l89 ) of InvertedShellWrapper has a loop that won't collect the last output of a process.

      The faulty event sequence looks like this:
      1. process alive? -> yes
      2. Anything to pump? -> no
      3. Thread.sleep(1)
      4. process alive? -> no
      5. call exit handler and end pump thread
      This will obviously discard any output of the process during step 3 and 4.

      The solution would be to pump all pending output before the exit handler gets called (while (pumpStream(shellOut, out, buffer) || pumpStream(shellErr, err, buffer)) {}).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              treffer René Treffer
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: