Blame SOURCES/firewalld-0.3.9-RHBZ#994479.patch

3d17f4
diff -up firewalld-0.3.9/config/Makefile.am.RHBZ#994479 firewalld-0.3.9/config/Makefile.am
3d17f4
--- firewalld-0.3.9/config/Makefile.am.RHBZ#994479	2013-12-03 14:57:26.000000000 +0100
3d17f4
+++ firewalld-0.3.9/config/Makefile.am	2015-07-06 22:52:11.796675172 +0200
3d17f4
@@ -21,6 +21,10 @@ gsettings_in_file = org.fedoraproject.Fi
3d17f4
 	org.fedoraproject.FirewallConfig.gschema.xml.in
3d17f4
 gsettings_SCHEMAS = $(gsettings_in_file:.xml.in=.xml)
3d17f4
 
3d17f4
+xmlschemadir = $(prefixlibdir)/xmlschema
3d17f4
+dist_xmlschema_DATA = xmlschema/icmptype.xsd xmlschema/service.xsd xmlschema/zone.xsd
3d17f4
+dist_xmlschema_SCRIPTS = xmlschema/check.sh
3d17f4
+
3d17f4
 BUILT_SOURCES = \
3d17f4
 	$(desktop_DATA) \
3d17f4
 	$(applet_desktop_DATA) \
3d17f4
diff -up firewalld-0.3.9/config/xmlschema/check.sh.RHBZ#994479 firewalld-0.3.9/config/xmlschema/check.sh
3d17f4
--- firewalld-0.3.9/config/xmlschema/check.sh.RHBZ#994479	2015-07-06 22:53:44.286881231 +0200
3d17f4
+++ firewalld-0.3.9/config/xmlschema/check.sh	2015-07-06 19:17:33.315427513 +0200
3d17f4
@@ -0,0 +1,64 @@
3d17f4
+#!/bin/bash
3d17f4
+
3d17f4
+# requires libxml2 packages for xmllint
3d17f4
+XMLLINT=/usr/bin/xmllint
3d17f4
+PACKAGE=libxml2
3d17f4
+
3d17f4
+prog=$(basename $0)
3d17f4
+BASEDIR=$(realpath $(dirname $0))
3d17f4
+
3d17f4
+checkdir=$(pwd)
3d17f4
+while getopts "d:h" arg; do
3d17f4
+    case $arg in
3d17f4
+	d)
3d17f4
+	    checkdir=$OPTARG
3d17f4
+	    ;;
3d17f4
+	h)
3d17f4
+	    cat <
3d17f4
+Usage: $prog [options]
3d17f4
+
3d17f4
+Checks zone, service and icmptype firewalld config files to be valid.
3d17f4
+Use this script either in the directory containing the zones, services and
3d17f4
+icmptypes directories containing the files to be checked, or use the -d option
3d17f4
+to specify a directory.
3d17f4
+
3d17f4
+Options:
3d17f4
+  -h              Print this help
3d17f4
+  -d <directory>  Check files in this directory
3d17f4
+
3d17f4
+EOF
3d17f4
+	    exit 0
3d17f4
+	    ;;
3d17f4
+        \?)
3d17f4
+            echo "Invalid option: -$OPTARG" >&2
3d17f4
+            exit 1
3d17f4
+            ;;
3d17f4
+        :)
3d17f4
+            echo "Option -$OPTARG requires an argument." >&2
3d17f4
+            exit 1
3d17f4
+            ;;
3d17f4
+    esac
3d17f4
+done
3d17f4
+
3d17f4
+if [ ! -f "$XMLLINT" ]; then
3d17f4
+    echo "$XMLLINT is not installed, please install the $PACKAGE package."
3d17f4
+    exit -1
3d17f4
+fi
3d17f4
+
3d17f4
+if [ ! -d "$checkdir" ]; then
3d17f4
+    echo "Directory '${checkdir}' does not exist"
3d17f4
+    exit -2
3d17f4
+fi
3d17f4
+
3d17f4
+for keyword in zone service icmptype; do
3d17f4
+    if [ -d "${checkdir}/${keyword}s" ]; then
3d17f4
+	echo "Checking ${keyword}s"
3d17f4
+	cd "${checkdir}/${keyword}s"
3d17f4
+	ls -f *.xml 2>/dev/null | while read -r file; do
3d17f4
+	    echo -n "  "
3d17f4
+	    $XMLLINT --noout --schema "$BASEDIR"/${keyword}.xsd "${file}"
3d17f4
+	done
3d17f4
+    else
3d17f4
+	echo "Directory '${checkdir}/${keyword}s' does not exist"
3d17f4
+    fi
3d17f4
+done
3d17f4
diff -up firewalld-0.3.9/config/xmlschema/icmptype.xsd.RHBZ#994479 firewalld-0.3.9/config/xmlschema/icmptype.xsd
3d17f4
--- firewalld-0.3.9/config/xmlschema/icmptype.xsd.RHBZ#994479	2015-07-06 22:53:52.718900017 +0200
3d17f4
+++ firewalld-0.3.9/config/xmlschema/icmptype.xsd	2015-07-06 19:17:33.319427521 +0200
3d17f4
@@ -0,0 +1,29 @@
3d17f4
+
3d17f4
+
3d17f4
+elementFormDefault="qualified">
3d17f4
+
3d17f4
+<xs:element name="icmptype">
3d17f4
+  <xs:complexType>
3d17f4
+    <xs:choice maxOccurs="unbounded">
3d17f4
+      <xs:element name="short" type="xs:string" minOccurs="0"/>
3d17f4
+      <xs:element name="description" type="xs:string" minOccurs="0"/>
3d17f4
+      <xs:element name="destination" type="desttype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+    </xs:choice>
3d17f4
+    <xs:attribute name="version" type="xs:string"/>
3d17f4
+  </xs:complexType>
3d17f4
+</xs:element>
3d17f4
+
3d17f4
+<xs:complexType name="desttype">
3d17f4
+  <xs:attribute name="ipv4" type="booltype"/>
3d17f4
+  <xs:attribute name="ipv6" type="booltype"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="booltype">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="[Yy]es|[Nn]o|[Tt]rue|[Ff]alse"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+</xs:schema>
3d17f4
+
3d17f4
+
3d17f4
diff -up firewalld-0.3.9/config/xmlschema/service.xsd.RHBZ#994479 firewalld-0.3.9/config/xmlschema/service.xsd
3d17f4
--- firewalld-0.3.9/config/xmlschema/service.xsd.RHBZ#994479	2015-07-06 22:53:58.213912258 +0200
3d17f4
+++ firewalld-0.3.9/config/xmlschema/service.xsd	2015-07-06 19:17:33.319427521 +0200
3d17f4
@@ -0,0 +1,53 @@
3d17f4
+
3d17f4
+
3d17f4
+elementFormDefault="qualified">
3d17f4
+
3d17f4
+<xs:element name="service">
3d17f4
+  <xs:complexType>
3d17f4
+    <xs:choice maxOccurs="unbounded">
3d17f4
+      <xs:element name="short" type="xs:string" minOccurs="0"/>
3d17f4
+      <xs:element name="description" type="xs:string" minOccurs="0"/>
3d17f4
+      <xs:element name="port" type="porttype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="module" type="nametype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="destination" type="desttype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+    </xs:choice>
3d17f4
+    <xs:attribute name="version" type="xs:string"/>
3d17f4
+  </xs:complexType>
3d17f4
+</xs:element>
3d17f4
+
3d17f4
+<xs:complexType name="nametype">
3d17f4
+  <xs:attribute name="name" type="xs:string" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:complexType name="porttype">
3d17f4
+  <xs:attribute name="port" type="porttyperestrict" use="required"/>
3d17f4
+  <xs:attribute name="protocol" type="xs:string" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="porttyperestrict">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="([0-9]+(\-[0-9]+)?)?"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="desttype">
3d17f4
+  <xs:attribute name="ipv4" type="ipv4addrtype"/>
3d17f4
+  <xs:attribute name="ipv6" type="ipv6addrtype"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="ipv4addrtype">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="([0-9]{1,3}\.){3}[0-9]{1,3}(/[0-9]{1,2})?"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:simpleType name="ipv6addrtype">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    
3d17f4
+    <xs:pattern value="[0-9A-Fa-f:]{3,39}(/[0-9]{1,3})?"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+</xs:schema>
3d17f4
+
3d17f4
+
3d17f4
diff -up firewalld-0.3.9/config/xmlschema/zone.xsd.RHBZ#994479 firewalld-0.3.9/config/xmlschema/zone.xsd
3d17f4
--- firewalld-0.3.9/config/xmlschema/zone.xsd.RHBZ#994479	2015-07-06 22:54:05.453928390 +0200
3d17f4
+++ firewalld-0.3.9/config/xmlschema/zone.xsd	2015-07-06 19:17:33.320427524 +0200
3d17f4
@@ -0,0 +1,156 @@
3d17f4
+
3d17f4
+
3d17f4
+elementFormDefault="qualified">
3d17f4
+
3d17f4
+<xs:element name="zone">
3d17f4
+  <xs:complexType>
3d17f4
+    <xs:choice maxOccurs="unbounded">
3d17f4
+      <xs:element name="short" type="xs:string" minOccurs="0"/>
3d17f4
+      <xs:element name="description" type="xs:string" minOccurs="0"/>
3d17f4
+      <xs:element name="interface" type="nametype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="source" type="sourceaddresstype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="service" type="nametype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="port" type="porttype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="icmp-block" type="nametype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="masquerade" type="emptytype" minOccurs="0"/>
3d17f4
+      <xs:element name="forward-port" type="fwporttype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+      <xs:element name="rule" type="ruletype" minOccurs="0" maxOccurs="unbounded"/>
3d17f4
+    </xs:choice>
3d17f4
+    <xs:attribute name="version" type="xs:string"/>
3d17f4
+    <xs:attribute name="target" type="zonetargettype"/>
3d17f4
+  </xs:complexType>
3d17f4
+</xs:element>
3d17f4
+
3d17f4
+<xs:complexType name="nametype">
3d17f4
+  <xs:attribute name="name" type="xs:string" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:complexType name="sourceaddresstype">
3d17f4
+  <xs:attribute name="address" type="ipaddrtype" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="familyrestrict">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="ipv4|ipv6"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="porttype">
3d17f4
+  <xs:attribute name="port" type="porttyperestrict" use="required"/>
3d17f4
+  <xs:attribute name="protocol" type="xs:string" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="porttyperestrict">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="([0-9]+(\-[0-9]+)?)?"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="fwporttype">
3d17f4
+  <xs:attribute name="port" type="porttyperestrict" use="required"/>
3d17f4
+  <xs:attribute name="protocol" type="xs:string" use="required"/>
3d17f4
+  <xs:attribute name="to-port" type="porttyperestrict"/>
3d17f4
+  <xs:attribute name="to-addr" type="ipaddrtype"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="ipaddrtype">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    
3d17f4
+    <xs:pattern value="([0-9]{1,3}\.){3}[0-9]{1,3}(/[0-9]{1,2})?|[0-9A-Fa-f:]{3,39}(/[0-9]{1,3})?"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:simpleType name="zonetargettype">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="ACCEPT|DROP|%%REJECT%%"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="emptytype">
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:complexType name="ruletype">
3d17f4
+  <xs:choice maxOccurs="unbounded">
3d17f4
+    <xs:element name="source" type="sourcetype" minOccurs="0"/>
3d17f4
+    <xs:element name="destination" type="sourcetype" minOccurs="0"/>
3d17f4
+    <xs:choice>
3d17f4
+      <xs:element name="protocol" type="protocoltype"/>
3d17f4
+      <xs:element name="service" type="nametype"/>
3d17f4
+      <xs:element name="port" type="porttype"/>
3d17f4
+      <xs:element name="icmp-block" type="nametype"/>
3d17f4
+      <xs:element name="masquerade" type="emptytype"/>
3d17f4
+      <xs:element name="forward-port" type="fwporttype"/>
3d17f4
+    </xs:choice>
3d17f4
+    <xs:element name="log" type="logtype" minOccurs="0"/>
3d17f4
+    <xs:element name="audit" type="targettype" minOccurs="0"/>
3d17f4
+    <xs:choice>
3d17f4
+      <xs:element name="accept" type="targettype"/>
3d17f4
+      <xs:element name="drop" type="targettype"/>
3d17f4
+      <xs:element name="reject" type="rejecttype"/>
3d17f4
+      <xs:sequence></xs:sequence>
3d17f4
+    </xs:choice>
3d17f4
+  </xs:choice>
3d17f4
+  <xs:attribute name="family" type="familyrestrict"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:complexType name="sourcetype">
3d17f4
+  <xs:attribute name="address" type="ipaddrtype" use="required"/>
3d17f4
+  <xs:attribute name="invert" type="booltype"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="booltype">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="[Yy]es|[Nn]o|[Tt]rue|[Ff]alse"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="protocoltype">
3d17f4
+  <xs:attribute name="value" type="xs:string" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:complexType name="logtype">
3d17f4
+  <xs:sequence>
3d17f4
+    <xs:element name="limit" type="limittype" minOccurs="0"/>
3d17f4
+  </xs:sequence>
3d17f4
+  <xs:attribute name="prefix" type="xs:string"/>
3d17f4
+  <xs:attribute name="level" type="logtypelevelrestrict"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="logtypelevelrestrict">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="emerg|alert|crit|error|warning|notice|info|debug"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:simpleType name="audittyperestrict">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="ACCEPT|DROP|REJECT"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="targettype">
3d17f4
+  <xs:sequence>
3d17f4
+    <xs:element name="limit" type="limittype" minOccurs="0"/>
3d17f4
+  </xs:sequence>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:complexType name="limittype">
3d17f4
+  <xs:attribute name="value" type="limitvaluerestrict" use="required"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+<xs:simpleType name="limitvaluerestrict">
3d17f4
+  <xs:restriction base="xs:string">
3d17f4
+    <xs:pattern value="[0-9]+/[a-z]+"/>
3d17f4
+  </xs:restriction>
3d17f4
+</xs:simpleType>
3d17f4
+
3d17f4
+<xs:complexType name="rejecttype">
3d17f4
+  <xs:sequence>
3d17f4
+    <xs:element name="limit" type="limittype" minOccurs="0"/>
3d17f4
+  </xs:sequence>
3d17f4
+  <xs:attribute name="type" type="xs:string"/>
3d17f4
+</xs:complexType>
3d17f4
+
3d17f4
+</xs:schema>
3d17f4
+
3d17f4
+