diff options
author | vBlackOut <vladimir.souchet@cuby-hebergs.com> | 2020-03-28 07:44:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 17:44:28 +1100 |
commit | 580462156e49e905e371ae7de01e86a811ccdbbb (patch) | |
tree | 8176895d4c49ba30031bb58fc5eabcbbe60d1d48 | |
parent | 9e78abd2c20b4c11670f74a50215c4a000200ba7 (diff) |
# Fix 410 Issue Correcte syntax write for connect server (#411)
-rw-r--r-- | sshuttle/ssh.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sshuttle/ssh.py b/sshuttle/ssh.py index 67a5894..9f99ff7 100644 --- a/sshuttle/ssh.py +++ b/sshuttle/ssh.py @@ -64,6 +64,11 @@ def parse_hostport(rhostport): # default define variable port = "" username = re.split(r'\s*:', rhostport)[0] + + # Fix #410 bad username error detect + if "@" in username: + username = re.split(r'\s*@', rhostport)[0] + password = None host = None @@ -82,9 +87,12 @@ def parse_hostport(rhostport): if host is None: # split for ipv4 or ipv6 host = "{}".format(re.split(r'\s*@', rhostport)[1]) + # try if port define try: - port = re.split(r'\s*:', rhostport)[2].split('@')[0] + # Fix #410 detect host:port + port = re.split(r'\s*:', host)[1] + host = re.split(r'\s*:', host)[0] except IndexError: pass |