diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2012-11-05 17:18:48 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2012-11-05 17:18:48 -0800 |
commit | 270bb94a46d94298c2fbe3926578650e3f21ae5d (patch) | |
tree | 46607a3ef4c9412ab08a276e0529d023224f0b43 | |
parent | 928c06274816669a94753b80f493a2e4e1b9357a (diff) |
Fix ProxyCommand equals splitting.
Uses regex approach from @lndbrg
-rw-r--r-- | paramiko/config.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/paramiko/config.py b/paramiko/config.py index 458d5dd0..cf35cdc6 100644 --- a/paramiko/config.py +++ b/paramiko/config.py @@ -22,9 +22,12 @@ L{SSHConfig}. import fnmatch import os +import re import socket SSH_PORT=22 +proxy_re = re.compile(r"^(proxycommand)\s*=*\s*(.*)", re.I) + class SSHConfig (object): """ @@ -56,8 +59,13 @@ class SSHConfig (object): if (line == '') or (line[0] == '#'): continue if '=' in line: - key, value = line.split('=', 1) - key = key.strip().lower() + # Ensure ProxyCommand gets properly split + if line.lower().strip().startswith('proxycommand'): + match = proxy_re.match(line) + key, value = match.group(1).lower(), match.group(2) + else: + key, value = line.split('=', 1) + key = key.strip().lower() else: # find first whitespace, and split there i = 0 |