mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-01-19 04:18:23 +01: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,
|
||||
# sshuttle can launch us as early as possible (and get sudo password
|
||||
# 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:
|
||||
debug1('iptables manager: starting transproxy.\n')
|
||||
do_it(port, subnets)
|
||||
|
||||
sys.stdout.write('STARTED\n')
|
||||
if line:
|
||||
debug1('iptables manager: starting transproxy.\n')
|
||||
do_it(port, subnets)
|
||||
sys.stdout.write('STARTED\n')
|
||||
|
||||
try:
|
||||
sys.stdout.flush()
|
||||
|
Loading…
Reference in New Issue
Block a user