From: Philipp Spitzer Date: Wed, 27 Jul 2016 18:46:06 +0000 (+0200) Subject: Now using "call" with no shell. X-Git-Url: https://git.toastfreeware.priv.at/toast/tdyndns.git/commitdiff_plain/8693ac19b712eeece371d48c4e2af3325386eb1b Now using "call" with no shell. --- 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)