From 90f574f02e0b8432de2ad03951ea74df3464dc38 Mon Sep 17 00:00:00 2001 From: Saagar Jha Date: Thu, 4 May 2023 13:50:00 -0700 Subject: Parse OpenSSH versions with no SSH_EXTRAVERSION If the Debian banner is not used, then there won't be a space after the version number: it'll be followed directly by a comma. Bug: https://crbug.com/gerrit/16903 Change-Id: I12b873f32afc9424f42b772399c346f96ca95a96 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/372875 Tested-by: Saagar Jha Reviewed-by: Mike Frysinger --- ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ssh.py') diff --git a/ssh.py b/ssh.py index 1d7ebe32..bb89fa1f 100644 --- a/ssh.py +++ b/ssh.py @@ -42,7 +42,7 @@ def _parse_ssh_version(ver_str=None): """parse a ssh version string into a tuple""" if ver_str is None: ver_str = _run_ssh_version() - m = re.match(r"^OpenSSH_([0-9.]+)(p[0-9]+)?\s", ver_str) + m = re.match(r"^OpenSSH_([0-9.]+)(p[0-9]+)?[\s,]", ver_str) if m: return tuple(int(x) for x in m.group(1).split(".")) else: -- cgit v1.2.3-54-g00ecf