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

Support Break Extension (RFC 4335)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.9.0
    • None

    Description

      I can't find a way to force a unix ssh client to send an interrupt signal, but it seems easy to force the break.
      Unfortunately, the break message isn't implemented.

      It was easy to patch in my needs...

      In ChannelSession:

      protected boolean handleRequest(String type, Buffer buffer) throws IOException {
      if ("env".equals(type))

      { return handleEnv(buffer); }

      if ("pty-req".equals(type))

      { return handlePtyReq(buffer); }

      if ("window-change".equals(type))

      { return handleWindowChange(buffer); }

      if ("signal".equals(type))

      { return handleSignal(buffer); }

      if ("break".equals(type))

      { return handleBreak(buffer); }

      ....

      protected boolean handleBreak(Buffer buffer) throws IOException {
      boolean wantReply = buffer.getBoolean();
      int length = buffer.getInt();
      log.debug("Break received on channel {}: {}", id, length);

      getEnvironment().signal( Signal.INT );

      if (wantReply)

      { buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_SUCCESS, 0); buffer.putInt(recipient); session.writePacket(buffer); }

      return true;
      }

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            glennmcg Glenn McGregor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: