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

AuthorizedKeyEntry parses `loginOptions` in a wrong way

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.7.0
    • 2.0.0
    • None
    • Ubuntu 16.04
      openjdk version "1.8.0_151"

    Description

      For `.ssh/authorized_keys` to have forced commands, sometimes AuthorizedKeyEntry parses it in the wrong way.

      For

      command="./an-executable-script-without-arguments.sh",no-port-forwarding,no-x11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3N...
      

      AuthorizedKeyEntry.getLoginOptions gives Map<String,String> with value

      command            ./an-executable-script-without-arguments.sh
      no-agent-forwarding            true
      no-port-forwarding            true
      no-pty            true
      no-x11-forwarding            true
      

      which is correct.

      But for forced commands with arguments

      command="./an-executable-script.sh arg1 arg2",no-port-forwarding,no-x11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3N...
      

      It gives

      command            "./an-executable-script.sh
      

      Which is wrong.

      It seems skip the blank space, so missed all following options. And it also didn't remove the quotation mark.

      Maybe there is some parsing error in here.

      Attachments

        1. ApacheMinaSshdTest.java
          2 kB
          Cong-Xin Qiu

        Activity

          People

            lgoldstein Lyor Goldstein
            ozooxo Cong-Xin Qiu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified