sshuttle
sshuttle copied to clipboard
Fix splitting of multi-word arguments
I tried setting a multi-word SSH option through ssh -o and sshuttle -e. This didn't work because regardless of the quoting, sshuttle always split the option into multiple arguments and made the quotes become a literal part of the args.
The problem turned out to be caused by shuttle always splitting the arguments at spaces, which makes it practically impossible to have multi-word arguments.
This patch solves the issue by using Python's shlex module, which splits arguments like a shell and e.g. respects quotes. I found one more similar line in the sshuttle code and fixed that one as well.