Re: [PATCH v2 3/5] Extend nwfilter schema to accept comment attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <stefanb@xxxxxxxxxx>


+  <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   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]