FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 07-24-2008, 08:46 PM
David Lutterkort
 
Default Fix Relax-NG pattern matching

On Thu, 2008-07-24 at 09:37 -0700, john.levon@sun.com wrote:
> # HG changeset patch
> # User john.levon@sun.com
> # Date 1216917462 25200
> # Node ID 4b889eda816bdb1b3bff21fd8a2a89029813a1a2
> # Parent cd648dc6a9492fe3b703e5ebc7f43d05bb03adeb
> Fix Relax-NG pattern matching
>
> Don't use unescaped meta-characters in the patterns.

Haven't checked myself, but are you sure that in the Relax-NG '.' and
'+' retain their special meaning inside character classes ? In some
regex syntaxes (e.g. extended POSIX) they are treated as ordinary
characters inside a character class - as an example, run
echo "a.b.c" | sed -r -e 's/[.]/:/g'

In any event, the '-' characters need to go at the very end of those
character classes - that's definitely broken.

David


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-24-2008, 09:11 PM
John Levon
 
Default Fix Relax-NG pattern matching

On Thu, Jul 24, 2008 at 01:46:32PM -0700, David Lutterkort wrote:

> Haven't checked myself, but are you sure that in the Relax-NG '.' and
> '+' retain their special meaning inside character classes ? In some

Yep:

xenbld:virt-convert $ grep '<name>' suse.hvm.virt-image.xml
<name>SUSE_Linux </name>
xenbld:virt-convert $ xmllint --relaxng doc/image.rng suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
xenbld:virt-convert $ vi doc/image.rng # . -> .
xenbld:virt-convert $ xmllint --relaxng doc/image.rng
suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
suse.hvm.virt-image.xml:3: element name: Relax-NG validity error : Error validating datatype string

> In any event, the '-' characters need to go at the very end of those
> character classes - that's definitely broken.

Are you sure about this?

<param name="pattern">[A-Za-z0-9_.+-:/]+</param>

...
58 X 59 Y 5A Z 5B [ 5C 5D ] 5E ^ 5F
...

$ grep '<name>' suse.hvm.virt-image.xml
<name>SUSE_Linux-^</name>
$ xmllint --relaxng doc/image.rng suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
suse.hvm.virt-image.xml:3: element name: Relax-NG validity error : Error validating datatype string

It doesn't seem to be treating it as a range to me.

regards
john

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-24-2008, 10:26 PM
David Lutterkort
 
Default Fix Relax-NG pattern matching

On Thu, 2008-07-24 at 22:11 +0100, John Levon wrote:
> On Thu, Jul 24, 2008 at 01:46:32PM -0700, David Lutterkort wrote:
>
> > Haven't checked myself, but are you sure that in the Relax-NG '.' and
> > '+' retain their special meaning inside character classes ? In some
>
> Yep:
>
> xenbld:virt-convert $ grep '<name>' suse.hvm.virt-image.xml
> <name>SUSE_Linux </name>
> xenbld:virt-convert $ xmllint --relaxng doc/image.rng suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
> xenbld:virt-convert $ vi doc/image.rng # . -> .
> xenbld:virt-convert $ xmllint --relaxng doc/image.rng
> suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
> suse.hvm.virt-image.xml:3: element name: Relax-NG validity error : Error validating datatype string

This is very weird. The image.rng that's upstream has genericName
<define name='genericName'>
<data type='string'>
<param name="pattern">[A-Za-z0-9_.:/+-]+</param>
</data>
</define>
When I run 'xmllint --relaxng image.rng --noout image.xml' I do get a
validation failure when I put '<name>my vm</name>' in there.

After playing with it some more, it seems that your patch does at the
very least not break anything - no idea where the observed differences
in xmllint behavior come from.

But anyway: ACK

David


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-24-2008, 11:30 PM
John Levon
 
Default Fix Relax-NG pattern matching

On Thu, Jul 24, 2008 at 03:26:21PM -0700, David Lutterkort wrote:

> > xenbld:virt-convert $ grep '<name>' suse.hvm.virt-image.xml
> > <name>SUSE_Linux </name>
> > xenbld:virt-convert $ xmllint --relaxng doc/image.rng suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
> > xenbld:virt-convert $ vi doc/image.rng # . -> .
> > xenbld:virt-convert $ xmllint --relaxng doc/image.rng
> > suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
> > suse.hvm.virt-image.xml:3: element name: Relax-NG validity error : Error validating datatype string
>
> This is very weird. The image.rng that's upstream has genericName
> <define name='genericName'>
> <data type='string'>
> <param name="pattern">[A-Za-z0-9_.:/+-]+</param>
> </data>
> </define>
> When I run 'xmllint --relaxng image.rng --noout image.xml' I do get a
> validation failure when I put '<name>my vm</name>' in there.

Weird.

$ xmllint --version
xmllint: using libxml version 20631
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1
FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv
ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug
Zlib

(on Solaris). What about you?

regards
john

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-25-2008, 04:15 PM
David Lutterkort
 
Default Fix Relax-NG pattern matching

On Fri, 2008-07-25 at 00:30 +0100, John Levon wrote:
> On Thu, Jul 24, 2008 at 03:26:21PM -0700, David Lutterkort wrote:
>
> > > xenbld:virt-convert $ grep '<name>' suse.hvm.virt-image.xml
> > > <name>SUSE_Linux </name>
> > > xenbld:virt-convert $ xmllint --relaxng doc/image.rng suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
> > > xenbld:virt-convert $ vi doc/image.rng # . -> .
> > > xenbld:virt-convert $ xmllint --relaxng doc/image.rng
> > > suse.hvm.virt-image.xml 2>&1 | grep 'Error validating'
> > > suse.hvm.virt-image.xml:3: element name: Relax-NG validity error : Error validating datatype string
> >
> > This is very weird. The image.rng that's upstream has genericName
> > <define name='genericName'>
> > <data type='string'>
> > <param name="pattern">[A-Za-z0-9_.:/+-]+</param>
> > </data>
> > </define>
> > When I run 'xmllint --relaxng image.rng --noout image.xml' I do get a
> > validation failure when I put '<name>my vm</name>' in there.
>
> Weird.
>
> $ xmllint --version
> xmllint: using libxml version 20631
> compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1
> FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv
> ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug
> Zlib

xmllint: using libxml version 20632
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1
FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv
ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug
Zlib

http://xmlsoft.org/news.html lists a bugfix for 2.6.32 about "regexp bug
with '.' (Andrew Tosh)". The full entry from the ChangeLog is

xmlregexp.c: apply patch from Andrew Tosh to fix behaviour
when '.' is used in a posCharGroup

That should explain the difference.

David


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-25-2008, 04:31 PM
John Levon
 
Default Fix Relax-NG pattern matching

On Fri, Jul 25, 2008 at 09:15:13AM -0700, David Lutterkort wrote:

> xmlregexp.c: apply patch from Andrew Tosh to fix behaviour
> when '.' is used in a posCharGroup
>
> That should explain the difference.

Hah, indeed. Of course we still want my patch for older libxml, I think.

regards
john

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-26-2008, 01:43 AM
David Lutterkort
 
Default Fix Relax-NG pattern matching

On Fri, 2008-07-25 at 17:31 +0100, John Levon wrote:
> On Fri, Jul 25, 2008 at 09:15:13AM -0700, David Lutterkort wrote:
>
> > xmlregexp.c: apply patch from Andrew Tosh to fix behaviour
> > when '.' is used in a posCharGroup
> >
> > That should explain the difference.
>
> Hah, indeed. Of course we still want my patch for older libxml, I think.

Agreed.

David


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-28-2008, 03:05 PM
Cole Robinson
 
Default Fix Relax-NG pattern matching

John Levon wrote:
> On Fri, Jul 25, 2008 at 09:15:13AM -0700, David Lutterkort wrote:
>
>> xmlregexp.c: apply patch from Andrew Tosh to fix behaviour
>> when '.' is used in a posCharGroup
>>
>> That should explain the difference.
>
> Hah, indeed. Of course we still want my patch for older libxml, I think.
>
> regards
> john
>

Seems like it can't hurt. Applied:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=2c0badd42d08

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 07:26 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org