Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
6e32d144
Commit
6e32d144
authored
Mar 22, 2015
by
Sean Zeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add -e/-d support
parent
bdad253e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
firewall.py
src/firewall.py
+13
-4
No files found.
src/firewall.py
View file @
6e32d144
...
@@ -470,7 +470,7 @@ def do_ipfw(port, dnsport, family, subnets, udp):
...
@@ -470,7 +470,7 @@ def do_ipfw(port, dnsport, family, subnets, udp):
def
pfctl
(
args
,
stdin
=
None
):
def
pfctl
(
args
,
stdin
=
None
):
argv
=
[
'pfctl'
]
+
list
(
args
.
split
(
" "
))
argv
=
[
'pfctl'
]
+
list
(
args
.
split
(
" "
))
debug1
(
'>>
%
s'
%
' '
.
join
(
argv
))
debug1
(
'>>
%
s
\n
'
%
' '
.
join
(
argv
))
p
=
ssubprocess
.
Popen
(
argv
,
stdin
=
ssubprocess
.
PIPE
,
p
=
ssubprocess
.
Popen
(
argv
,
stdin
=
ssubprocess
.
PIPE
,
stdout
=
ssubprocess
.
PIPE
,
stdout
=
ssubprocess
.
PIPE
,
...
@@ -515,10 +515,19 @@ def do_pf(port, dnsport, family, subnets, udp):
...
@@ -515,10 +515,19 @@ def do_pf(port, dnsport, family, subnets, udp):
if
not
'
\n
anchor "sshuttle" all
\n
'
in
pf_status
:
if
not
'
\n
anchor "sshuttle" all
\n
'
in
pf_status
:
pf_add_anchor_rule
(
PF_PASS
,
"sshuttle"
)
pf_add_anchor_rule
(
PF_PASS
,
"sshuttle"
)
o
=
pfctl
(
'-a sshuttle -f /dev/stdin -E'
,
rules
)
pfctl
(
'-a sshuttle -f /dev/stdin'
,
rules
)
if
sys
.
platform
==
"darwin"
:
o
=
pfctl
(
'-E'
)
_pf_context
[
'Xtoken'
]
=
re
.
search
(
r'Token : (.+)'
,
o
[
1
])
.
group
(
1
)
_pf_context
[
'Xtoken'
]
=
re
.
search
(
r'Token : (.+)'
,
o
[
1
])
.
group
(
1
)
elif
'INFO:
\n
Status: Disabled'
in
pf_status
:
pfctl
(
'-e'
)
_pf_context
[
'started_by_sshuttle'
]
=
True
else
:
else
:
pfctl
(
'-a sshuttle -F all -X
%
s'
%
_pf_context
[
'Xtoken'
])
pfctl
(
'-a sshuttle -F all'
)
if
sys
.
platform
==
"darwin"
:
pfctl
(
'-X
%
s'
%
_pf_context
[
'Xtoken'
])
elif
_pf_context
[
'started_by_sshuttle'
]:
pfctl
(
'-d'
)
def
program_exists
(
name
):
def
program_exists
(
name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment