summaryrefslogtreecommitdiffstats
path: root/ssh.py
diff options
context:
space:
mode:
authorSaagar Jha <saagarjha@google.com>2023-05-04 13:50:00 -0700
committerSaagar Jha <saagarjha@google.com>2023-05-24 17:33:08 +0000
commit90f574f02e0b8432de2ad03951ea74df3464dc38 (patch)
tree3ab7f79695ce724adcaef52302b30ac1a8212858 /ssh.py
parent551285fa35ccd0836513e9cf64ee8d3372e5e3f4 (diff)
downloadgit-repo-90f574f02e0b8432de2ad03951ea74df3464dc38.tar.gz
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 <saagarjha@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'ssh.py')
-rw-r--r--ssh.py2
1 files changed, 1 insertions, 1 deletions
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):
42 """parse a ssh version string into a tuple""" 42 """parse a ssh version string into a tuple"""
43 if ver_str is None: 43 if ver_str is None:
44 ver_str = _run_ssh_version() 44 ver_str = _run_ssh_version()
45 m = re.match(r"^OpenSSH_([0-9.]+)(p[0-9]+)?\s", ver_str) 45 m = re.match(r"^OpenSSH_([0-9.]+)(p[0-9]+)?[\s,]", ver_str)
46 if m: 46 if m:
47 return tuple(int(x) for x in m.group(1).split(".")) 47 return tuple(int(x) for x in m.group(1).split("."))
48 else: 48 else: