mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-26 01:43:29 +01:00
Allow remote hosts with colons in the username
This commit is contained in:
parent
5e90491344
commit
abce18cfc2
@ -63,7 +63,7 @@ def empackage(z, name, data=None):
|
|||||||
def connect(ssh_cmd, rhostport, python, stderr, options):
|
def connect(ssh_cmd, rhostport, python, stderr, options):
|
||||||
portl = []
|
portl = []
|
||||||
|
|
||||||
if (rhostport or '').count(':') > 1:
|
if re.sub(r'.*@', '', rhostport or '').count(':') > 1:
|
||||||
if rhostport.count(']') or rhostport.count('['):
|
if rhostport.count(']') or rhostport.count('['):
|
||||||
result = rhostport.split(']')
|
result = rhostport.split(']')
|
||||||
rhost = result[0].strip('[')
|
rhost = result[0].strip('[')
|
||||||
@ -76,7 +76,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
|
|||||||
else:
|
else:
|
||||||
rhost = rhostport
|
rhost = rhostport
|
||||||
else: # IPv4
|
else: # IPv4
|
||||||
l = (rhostport or '').split(':', 1)
|
l = (rhostport or '').rsplit(':', 1)
|
||||||
rhost = l[0]
|
rhost = l[0]
|
||||||
if len(l) > 1:
|
if len(l) > 1:
|
||||||
portl = ['-p', str(int(l[1]))]
|
portl = ['-p', str(int(l[1]))]
|
||||||
|
Loading…
Reference in New Issue
Block a user