]> ToastFreeware Gitweb - toast/tdyndns.git/blobdiff - bin/tdyndns_update
Now using "call" with no shell.
[toast/tdyndns.git] / bin / tdyndns_update
index ce0b73a7510a7b0d163a8b1560b4988a6d07cbf0..45c42640bc9a0bf9e8b6c332a4f6359fb42c9903 100755 (executable)
@@ -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)