On 09/27/2010 12:40 PM, Stefan Berger wrote:
Extend the nwfilter.rng schema to accept comment attributes for all protocol
types.

Signed-off-by: Stefan Berger <stef...@us.ibm.com>


+  <define name="comment-attribute">
+    <interleave>
+      <optional>
+        <attribute name="comment">
+          <ref name="comment-type"/>
+        </attribute>
+      </optional>
+    </interleave>
+  </define>

Maybe I'm not understanding rng, but what is being interleaved here? Do things still validate if "comment-attribute" does not contain an <interleave>?

+
+  <define name='comment-type'>
+    <data type="string">
+      <param name="pattern">[a-za-z0-9`~...@#$%\-_+=|\\:";,./ 
\(\)\[\]\{\}&quot;&amp;&lt;&gt;&apos;]*</param>

Since we are enforcing a maximum comment length of 256, would it make sense to use {0,256} rather than * (or is it \{0,256\} for this flavor of regular expression)? This explicitly leaves out tabs; I guess that's okay. It also leaves out 8-bit bytes - could that be a problem for i18n where people want comments with native-language accented characters? That is, are we being too strict here? Maybe a better pattern would be to reject specific non-printing ASCII bytes we want to avoid, assuing you can use escape sequences like [^\001]?

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to