Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix splitting of multi-word arguments #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sshuttle/methods/pf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import socket
import struct
import subprocess as ssubprocess
import shlex
from fcntl import ioctl
from ctypes import c_char, c_uint8, c_uint16, c_uint32, Union, Structure, \
sizeof, addressof, memmove
Expand Down Expand Up @@ -323,7 +324,7 @@ def _get_natlook_port(self, xport):


def pfctl(args, stdin=None):
argv = ['pfctl'] + list(args.split(" "))
argv = ['pfctl'] + shlex.split(args)
debug1('>> %s\n' % ' '.join(argv))

p = ssubprocess.Popen(argv, stdin=ssubprocess.PIPE,
Expand Down
3 changes: 2 additions & 1 deletion sshuttle/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import zlib
import imp
import subprocess as ssubprocess
import shlex
import sshuttle.helpers as helpers
from sshuttle.helpers import debug2

Expand Down Expand Up @@ -102,7 +103,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
argv = [sys.argv[1], '-c', pyscript]
else:
if ssh_cmd:
sshl = ssh_cmd.split(' ')
sshl = shlex.split(ssh_cmd)
else:
sshl = ['ssh']
if python:
Expand Down