Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No ssh_server_version_major created with OpenSSH 9.2 #358

Closed
virus2500 opened this issue Aug 1, 2023 · 0 comments · Fixed by #359
Closed

No ssh_server_version_major created with OpenSSH 9.2 #358

virus2500 opened this issue Aug 1, 2023 · 0 comments · Fixed by #359

Comments

@virus2500
Copy link
Contributor

Hello,

we use Debian 12 with OpenSSH 9.2

root@deg-debian12:~# sshd -V
OpenSSH_9.2, OpenSSL 3.0.9 30 May 2023

But this version syntax prevents ssh_server_version_major fact to be created.

In lib/facter/ssh_server_version.rb we changed the whole "case version" block from

    case version
    when %r{([0-9]+)\.([0-9]+)\.([0-9]+p[0-9]+)}
      # 6.6.1p1 style formatting
      version.gsub(%r{([0-9]+)\.([0-9]+)\.([0-9]+p[0-9]+)}, '\1')
    when %r{^([0-9]+)\.([0-9]+p[0-9]+)}
      # 7.2p2 style formatting
      version.gsub(%r{^([0-9]+)\.([0-9]+p[0-9]+)}, '\1')
    end

to

    version.gsub(%r{^([0-9]+)\..*$}, '\1')

This regex seems easier to understand and doesn't need any "when" statements.
Maybe we overlooked something here so please have a look if you also think it's better written this way.

Thanks and br
Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant