From 8693ac19b712eeece371d48c4e2af3325386eb1b Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Wed, 27 Jul 2016 20:46:06 +0200 Subject: [PATCH] Now using "call" with no shell. --- bin/tdyndns_update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tdyndns_update b/bin/tdyndns_update index ce0b73a..45c4264 100755 --- a/bin/tdyndns_update +++ b/bin/tdyndns_update @@ -55,8 +55,8 @@ def blockip_whitelist_add(ip): """ :param ip: ipv4 address :raises a BlockipError in case of errors.""" - command = "iptables -I blockip -s {ip} -j ACCEPT".format(ip=ip) - p = call(command, shell=True) + command = ['iptables', '-I', 'blockip', '-s', str(ip), '-j', 'ACCEPT'] + p = call(command) if p != 0: raise BlockipError(p) @@ -65,8 +65,8 @@ def blockip_whitelist_delete(ip): """ :param ip: ipv4 address :raises a BlockipError in case of errors.""" - command = "iptables -D blockip -s {ip} -j ACCEPT".format(ip=ip) - p = call(command, shell=True) + command = ['iptables', '-D', 'blockip', '-s', str(ip), '-j', 'ACCEPT'] + p = call(command) if p != 0: raise BlockipError(p) -- 2.30.2