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

ssh_config Host entry should support '!' pattern

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.1.0
    • 1.1.0
    • None
    • build

    Description

      During test I found the following exception:

      testFileSystem(org.apache.sshd.client.subsystem.sftp.SftpFileSystemTest) Time elapsed: 1.076 sec <<< ERROR!
      java.io.IOException: java.lang.IllegalArgumentException: Invalid host pattern char in !10.35.0.71
      at org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:138)
      at org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:127)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.toPattern(HostConfigEntry.java:1047)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.setHost(HostConfigEntry.java:166)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.duplicateConfiguration(HostConfigEntry.java:1318)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.updateEntriesList(HostConfigEntry.java:1288)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:1203)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:1136)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:1130)
      at org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:1112)
      at org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver.reloadHostConfigEntries(ConfigFileHostEntryResolver.java:99)

      This is caused by ssh_config entry:

      Host * !10.35.0.71

      Using '!' is legal, from ssh_config manual:

      A pattern entry may be negated by prefixing it with an exclamation mark (‘!’). If a negated entry is matched, then the Host entry is ignored, regardless of
      whether any other patterns on the line match. Negated matches are therefore useful to provide exceptions for wildcard matches.

      Attachments

        Activity

          People

            lgoldstein Lyor Goldstein
            alonbl Alon Bar-Lev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: