mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-07-06 17:50:35 +02:00
Fix argument splitting for multi-word arguments
By just splitting at spaces, multi-word arguments are torn apart even if quoted. In case of custom ssh-cmd, this makes it practically impossible to set certian options through `ssh -o`. shlex splits arguments like a shell and e.g. respects quotes.
This commit is contained in:
committed by
Brian May
parent
c0c3612e6d
commit
0ed5ef9a97
@ -5,6 +5,7 @@ import socket
|
||||
import zlib
|
||||
import imp
|
||||
import subprocess as ssubprocess
|
||||
import shlex
|
||||
import sshuttle.helpers as helpers
|
||||
from sshuttle.helpers import debug2
|
||||
|
||||
@ -109,7 +110,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
|
||||
argv = [sys.executable, '-c', pyscript]
|
||||
else:
|
||||
if ssh_cmd:
|
||||
sshl = ssh_cmd.split(' ')
|
||||
sshl = shlex.split(ssh_cmd)
|
||||
else:
|
||||
sshl = ['ssh']
|
||||
if python:
|
||||
|
Reference in New Issue
Block a user