Blame SOURCES/firewalld-0.3.9-RHBZ#1127706_add.patch

06cdf6
diff -up firewalld-0.3.9/src/firewall/client.py.RHBZ#1127706_add firewalld-0.3.9/src/firewall/client.py
06cdf6
--- firewalld-0.3.9/src/firewall/client.py.RHBZ#1127706_add	2014-10-20 21:34:59.494457458 +0200
06cdf6
+++ firewalld-0.3.9/src/firewall/client.py	2014-10-20 21:34:59.507457303 +0200
06cdf6
@@ -462,7 +462,7 @@ class FirewallClientConfigZone(object):
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
     def setMasquerade(self, masquerade):
06cdf6
-        self.fw_zone.setMasquerades(masquerade)
06cdf6
+        self.fw_zone.setMasquerade(masquerade)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
@@ -494,16 +494,28 @@ class FirewallClientConfigZone(object):
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
     def addForwardPort(self, port, protocol, toport, toaddr):
06cdf6
+        if toport is None:
06cdf6
+            toport = ''
06cdf6
+        if toaddr is None:
06cdf6
+            toaddr = ''
06cdf6
         self.fw_zone.addForwardPort(port, protocol, toport, toaddr)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
     def removeForwardPort(self, port, protocol, toport, toaddr):
06cdf6
+        if toport is None:
06cdf6
+            toport = ''
06cdf6
+        if toaddr is None:
06cdf6
+            toaddr = ''
06cdf6
         self.fw_zone.removeForwardPort(port, protocol, toport, toaddr)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
     def queryForwardPort(self, port, protocol, toport, toaddr):
06cdf6
+        if toport is None:
06cdf6
+            toport = ''
06cdf6
+        if toaddr is None:
06cdf6
+            toaddr = ''
06cdf6
         return self.fw_zone.queryForwardPort(port, protocol, toport, toaddr)
06cdf6
 
06cdf6
     # interface
06cdf6
@@ -809,18 +821,18 @@ class FirewallClientConfigService(object
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
-    def addModule(self, module, protocol):
06cdf6
-        self.fw_service.addModule(module, protocol)
06cdf6
+    def addModule(self, module):
06cdf6
+        self.fw_service.addModule(module)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
-    def removeModule(self, module, protocol):
06cdf6
-        self.fw_service.removeModule(module, protocol)
06cdf6
+    def removeModule(self, module):
06cdf6
+        self.fw_service.removeModule(module)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
-    def queryModule(self, module, protocol):
06cdf6
-        return self.fw_service.queryModule(module, protocol)
06cdf6
+    def queryModule(self, module):
06cdf6
+        return self.fw_service.queryModule(module)
06cdf6
 
06cdf6
     # destination
06cdf6
 
06cdf6
@@ -846,7 +858,7 @@ class FirewallClientConfigService(object
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
-    def removeDestination(self, destination):
06cdf6
+    def removeDestination(self, destination, address):
06cdf6
         self.fw_service.removeDestination(destination, address)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
@@ -1021,18 +1033,18 @@ class FirewallClientConfigIcmpType(objec
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
-    def addDestination(self, destination, address):
06cdf6
-        self.fw_icmptype.addDestination(destination, address)
06cdf6
+    def addDestination(self, destination):
06cdf6
+        self.fw_icmptype.addDestination(destination)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
     def removeDestination(self, destination):
06cdf6
-        self.fw_icmptype.removeDestination(destination, address)
06cdf6
+        self.fw_icmptype.removeDestination(destination)
06cdf6
 
06cdf6
     @slip.dbus.polkit.enable_proxy
06cdf6
     @handle_exceptions
06cdf6
-    def queryDestination(self, destination, address):
06cdf6
-        return self.fw_icmptype.queryDestination(destination, address)
06cdf6
+    def queryDestination(self, destination):
06cdf6
+        return self.fw_icmptype.queryDestination(destination)
06cdf6
 
06cdf6
 
06cdf6
 # config.policies lockdown whitelist
06cdf6
diff -up firewalld-0.3.9/src/firewall/server/config_icmptype.py.RHBZ#1127706_add firewalld-0.3.9/src/firewall/server/config_icmptype.py
06cdf6
--- firewalld-0.3.9/src/firewall/server/config_icmptype.py.RHBZ#1127706_add	2014-10-20 21:34:59.495457446 +0200
06cdf6
+++ firewalld-0.3.9/src/firewall/server/config_icmptype.py	2014-10-20 21:34:59.507457303 +0200
06cdf6
@@ -315,9 +315,15 @@ class FirewallDConfigIcmpType(slip.dbus.
06cdf6
                    destination)
06cdf6
         self.parent.accessCheck(sender)
06cdf6
         settings = list(self.getSettings())
06cdf6
-        if destination not in settings[3]:
06cdf6
-            raise FirewallError(NOT_ENABLED, destination)
06cdf6
-        settings[3].remove(destination)
06cdf6
+        if settings[3]:
06cdf6
+            if destination not in settings[3]:
06cdf6
+                raise FirewallError(NOT_ENABLED, destination)
06cdf6
+            else:
06cdf6
+                settings[3].remove(destination)
06cdf6
+        else:  # empty means all
06cdf6
+            settings[3] = list(set(['ipv4', 'ipv6']) -
06cdf6
+                               set([destination]))
06cdf6
+        print "settings[3]:", settings[3]
06cdf6
         self.update(settings)
06cdf6
 
06cdf6
     @dbus_service_method(DBUS_INTERFACE_CONFIG_ICMPTYPE, in_signature='s',
06cdf6
@@ -328,4 +334,6 @@ class FirewallDConfigIcmpType(slip.dbus.
06cdf6
         log.debug1("config.icmptype.%d.queryDestination('%s')", self.id,
06cdf6
                    destination)
06cdf6
         settings = self.getSettings()
06cdf6
-        return (destination in self.settings[3])
06cdf6
+        # empty means all
06cdf6
+        return (not settings[3] or
06cdf6
+                destination in settings[3])
06cdf6
diff -up firewalld-0.3.9/src/firewall/server/config_service.py.RHBZ#1127706_add firewalld-0.3.9/src/firewall/server/config_service.py
06cdf6
--- firewalld-0.3.9/src/firewall/server/config_service.py.RHBZ#1127706_add	2014-10-20 21:34:59.496457434 +0200
06cdf6
+++ firewalld-0.3.9/src/firewall/server/config_service.py	2014-10-20 21:34:59.508457291 +0200
06cdf6
@@ -398,12 +398,12 @@ class FirewallDConfigService(slip.dbus.s
06cdf6
         log.debug1("config.service.%d.getDestinations()", self.id)
06cdf6
         return self.getSettings()[5]
06cdf6
 
06cdf6
-    @dbus_service_method(DBUS_INTERFACE_CONFIG_SERVICE, in_signature='as')
06cdf6
+    @dbus_service_method(DBUS_INTERFACE_CONFIG_SERVICE, in_signature='a{ss}')
06cdf6
     @dbus_handle_exceptions
06cdf6
     def setDestinations(self, destinations, sender=None):
06cdf6
-        destinations = dbus_to_python(destinations, list)
06cdf6
-        log.debug1("config.service.%d.setDestinations('[%s]')", self.id,
06cdf6
-                   ",".join(destinations))
06cdf6
+        destinations = dbus_to_python(destinations, dict)
06cdf6
+        log.debug1("config.service.%d.setDestinations({ipv4:'%s', ipv6:'%s'})",
06cdf6
+                   self.id, destinations.get('ipv4'), destinations.get('ipv6'))
06cdf6
         self.parent.accessCheck(sender)
06cdf6
         settings = list(self.getSettings())
06cdf6
         settings[5] = destinations
06cdf6
@@ -458,5 +458,5 @@ class FirewallDConfigService(slip.dbus.s
06cdf6
         log.debug1("config.service.%d.queryDestination('%s', '%s')", self.id,
06cdf6
                    destination, address)
06cdf6
         settings = self.getSettings()
06cdf6
-        return (destination in self.settings[5] and \
06cdf6
-                address == self.settings[5][destination])
06cdf6
+        return (destination in settings[5] and
06cdf6
+                address == settings[5][destination])