mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-24 13:41:14 -05:00
fix iptables rule removal
tails_close_port should remove the previously added ACCEPT rule, rather than inserting an explicit REJECT rule. This ensures the firewall is restored to its original state, which may not necessarily have had a REJECT rule on that port.
This commit is contained in:
parent
1036ae68ff
commit
7317d929bf
@ -159,7 +159,7 @@ def tails_open_port(port):
|
||||
def tails_close_port(port):
|
||||
if get_platform() == 'Tails':
|
||||
print translated("closing_hole")
|
||||
subprocess.call(['/sbin/iptables', '-I', 'OUTPUT', '-o', 'lo', '-p', 'tcp', '--dport', str(port), '-j', 'REJECT'])
|
||||
subprocess.call(['/sbin/iptables', '-D', 'OUTPUT', '-o', 'lo', '-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT'])
|
||||
|
||||
def load_strings(default="en"):
|
||||
global strings
|
||||
|
Loading…
Reference in New Issue
Block a user