mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-20 01:08:40 +02:00
iptables: if client dies before sending GO, just quit.
If the server was having trouble starting, we would print a lot of unnecessary stuff from iptables. We shouldn't even have bothered *starting* iptables if the server was dead anyway.
This commit is contained in:
parent
ea6bb5c255
commit
a5fc93c841
14
iptables.py
14
iptables.py
@ -85,12 +85,16 @@ def main(port, subnets):
|
|||||||
# we wait until we get some input before creating the rules. That way,
|
# we wait until we get some input before creating the rules. That way,
|
||||||
# sshuttle can launch us as early as possible (and get sudo password
|
# sshuttle can launch us as early as possible (and get sudo password
|
||||||
# authentication as early in the startup process as possible).
|
# authentication as early in the startup process as possible).
|
||||||
sys.stdin.readline(128)
|
line = sys.stdin.readline(128)
|
||||||
|
if not line:
|
||||||
|
return # parent died; nothing to do
|
||||||
|
if line != 'GO\n':
|
||||||
|
raise Fatal('iptables: expected GO but got %r' % line)
|
||||||
try:
|
try:
|
||||||
debug1('iptables manager: starting transproxy.\n')
|
if line:
|
||||||
do_it(port, subnets)
|
debug1('iptables manager: starting transproxy.\n')
|
||||||
|
do_it(port, subnets)
|
||||||
sys.stdout.write('STARTED\n')
|
sys.stdout.write('STARTED\n')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
Loading…
Reference in New Issue
Block a user