Don't use Xtoken if not set

This commit is contained in:
Brian May 2015-12-05 14:12:57 +11:00
parent ed0a92e714
commit 50a6e87237

View File

@ -24,7 +24,7 @@ def pfctl(args, stdin=None):
return o
_pf_context = {'started_by_sshuttle': False, 'Xtoken': ''}
_pf_context = {'started_by_sshuttle': False, 'Xtoken': None}
# This are some classes and functions used to support pf in yosemite.
@ -227,7 +227,8 @@ class Method(BaseMethod):
else:
pfctl('-a sshuttle -F all')
if sys.platform == "darwin":
pfctl('-X %s' % _pf_context['Xtoken'])
if _pf_context['Xtoken'] is not None:
pfctl('-X %s' % _pf_context['Xtoken'])
elif _pf_context['started_by_sshuttle']:
pfctl('-d')