Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6417

Regex of ssh_authorized_keys can't match lines with multi spaces as field separator

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.8.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Previously, the ssh_authorized_key resource type would not match entries which had multiple spaces between fields - this is now fixed.

      Description

      Regex for authorized_keys can't match lines with multi spaces as field separator. The regex in type ssh_authorized_keys is:

      REGEX = /^(?:(.+) )?(ssh-dss|ssh-ed25519|ssh-rsa|ecdsa-sha2-nistp256|ecdsa-sha2-nistp384|ecdsa-sha2-nistp521) ([^ ]+) ?(.*)$/
      

      This regext can't match lines with multi spaces as field separator like:

      $ cat ~/.ssh/authorized_keys
      ssh-rsa    PUBLIC_KEY_CONTENT    COMMENT    # This line is separated by multi spaces
      

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                kylo Kylo Ginsberg
                Reporter:
                liaopenghui Liao Penghui
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: