aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/msec/tools.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/msec/tools.py b/src/msec/tools.py
index c9be55d..f62c1bc 100755
--- a/src/msec/tools.py
+++ b/src/msec/tools.py
@@ -8,6 +8,7 @@ import stat
import sys
import time
import locale
+import subprocess
# localization
import gettext
@@ -25,7 +26,8 @@ def find_firewall_info(log):
# read firewall settings
firewall_entries = []
try:
- data = os.popen("iptables -S").readlines()
+ p = subprocess.run(["iptables", "-S"], capture_output=True)
+ data = p.stdout
for l in data:
if l[:3] == "-A ":
firewall_entries.append(l.strip())