iptables: more resilient startup/cleanup.

Now the sudo iptables subprocess persists for the entire life of sshuttle.
The benefits of this are:

- no need to authenticate again at shutdown (failure of which could cause us
  to not clean up iptables)

- if the main process dies unexpectedly, iptables still gets cleaned up

- the password prompt can happen *before* starting the ssh/server process,
  which means it'll stand out and the password prompt won't be overwritten.
This commit is contained in:
Avery Pennarun
2010-05-02 19:29:03 -04:00
parent ca14231aae
commit a21e8c7a3c
4 changed files with 84 additions and 33 deletions

View File

@ -83,5 +83,6 @@ except Fatal, e:
log('fatal: %s\n' % e)
sys.exit(99)
except KeyboardInterrupt:
log('\nKeyboard interrupt: exiting.\n')
log('\n')
log('Keyboard interrupt: exiting.\n')
sys.exit(1)