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
41b8ad4c
Commit
41b8ad4c
authored
Nov 11, 2015
by
Brian May
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25 from vieira/ns-hosts
Import resolvconf_nameservers, fix wrong types
parents
0fb71489
a82224c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
client.py
src/client.py
+8
-9
main.py
src/main.py
+1
-1
No files found.
src/client.py
View file @
41b8ad4c
...
...
@@ -11,7 +11,8 @@ import ssh
import
ssyslog
import
sys
from
ssnet
import
SockWrapper
,
Handler
,
Proxy
,
Mux
,
MuxWrapper
from
helpers
import
log
,
debug1
,
debug2
,
debug3
,
Fatal
,
islocal
from
helpers
import
log
,
debug1
,
debug2
,
debug3
,
Fatal
,
islocal
,
\
resolvconf_nameservers
recvmsg
=
None
try
:
...
...
@@ -277,18 +278,17 @@ class MultiListener:
class
FirewallClient
:
def
__init__
(
self
,
port_v6
,
port_v4
,
subnets_include
,
subnets_exclude
,
dnsport_v6
,
dnsport_v4
,
ns
_hosts
,
method
,
udp
):
dnsport_v6
,
dnsport_v4
,
ns
list
,
method
,
udp
):
self
.
auto_nets
=
[]
self
.
subnets_include
=
subnets_include
self
.
subnets_exclude
=
subnets_exclude
self
.
ns_hosts
=
ns_hosts
argvbase
=
([
sys
.
argv
[
1
],
sys
.
argv
[
0
],
sys
.
argv
[
1
]]
+
[
'-v'
]
*
(
helpers
.
verbose
or
0
)
+
[
'--firewall'
,
str
(
port_v6
),
str
(
port_v4
),
str
(
dnsport_v6
),
str
(
dnsport_v4
),
method
,
str
(
int
(
udp
))])
if
dnsport_v4
or
dnsport_v6
:
argvbase
+=
[
'--ns-hosts'
,
ns_hosts
]
argvbase
+=
[
'--ns-hosts'
,
' '
.
join
([
ip
for
_
,
ip
in
nslist
])
]
if
ssyslog
.
_p
:
argvbase
+=
[
'--syslog'
]
argv_tries
=
[
...
...
@@ -602,7 +602,7 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
def
main
(
listenip_v6
,
listenip_v4
,
ssh_cmd
,
remotename
,
python
,
latency_control
,
dns
,
ns
_hosts
,
ssh_cmd
,
remotename
,
python
,
latency_control
,
dns
,
ns
list
,
method
,
seed_hosts
,
auto_nets
,
subnets_include
,
subnets_exclude
,
syslog
,
daemon
,
pidfile
):
...
...
@@ -698,9 +698,9 @@ def main(listenip_v6, listenip_v4,
udp_listener
.
print_listening
(
"UDP redirector"
)
bound
=
False
if
dns
or
ns
_hosts
:
if
dns
or
ns
list
:
if
dns
:
ns
_hosts
+=
resolvconf_nameservers
()
ns
list
+=
resolvconf_nameservers
()
# search for spare port for DNS
debug2
(
'Binding DNS:'
)
ports
=
xrange
(
12300
,
9000
,
-
1
)
...
...
@@ -740,10 +740,9 @@ def main(listenip_v6, listenip_v4,
dnsport_v6
=
0
dnsport_v4
=
0
dns_listener
=
None
ns_hosts
=
[]
fw
=
FirewallClient
(
redirectport_v6
,
redirectport_v4
,
subnets_include
,
subnets_exclude
,
dnsport_v6
,
dnsport_v4
,
ns
_hosts
,
subnets_exclude
,
dnsport_v6
,
dnsport_v4
,
ns
list
,
method
,
udp
)
if
fw
.
method
==
"tproxy"
:
...
...
src/main.py
View file @
41b8ad4c
...
...
@@ -215,7 +215,7 @@ try:
opt
.
python
,
opt
.
latency_control
,
opt
.
dns
,
opt
.
ns_hosts
,
nslist
,
method
,
sh
,
opt
.
auto_nets
,
...
...
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