From: John Ferlan Date: Tue, 3 Oct 2017 11:14:04 +0000 (-0400) Subject: docs,rng: Adjust storage pool name grammar checks X-Git-Tag: CVE-2017-1000256~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d7659027fdc34a042af3094d3d02a0d823272c2;p=thirdparty%2Flibvirt.git docs,rng: Adjust storage pool name grammar checks https://bugzilla.redhat.com/show_bug.cgi?id=1475250 It's possible to define and start a pool with a '.' in the name; however, when trying to add a volume to a domain using the storage pool source with a '.' in the storage pool name, the domain RNG validation fails because RNG uses 'genericName' which does not allow a '.' in the name. Domain XML def parsing has a virXMLValidateAgainstSchema which generates the error. The Storage Pool XML def parsing has no call to virXMLValidateAgainstSchema. The only Storage Pool name validation occurs in virStoragePoolDefParseXML to ensure the name doesn't have a '/' in it and in storagePoolDefineXML to call virXMLCheckIllegalChars using the same parameter "\n" as qemuDomainDefineXMLFlags would check after the RNG check could be succesful. In order to resolve this, create a poolName definition in storagecommon.rng that will mimic the domain name regex that disallows a newline character, but add the "/" in the exclude list. Then modify the pool and volume source name definitions to key off that poolName. --- diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 66b3d70c66..4dbda6932d 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1674,7 +1674,7 @@ - + diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index 717f3c603a..edee1b0845 100644 --- a/docs/schemas/storagecommon.rng +++ b/docs/schemas/storagecommon.rng @@ -6,6 +6,14 @@ + + + + [^/ +]+ + + + diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index f0117bd69f..52b2044bef 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -209,7 +209,7 @@ - + @@ -223,7 +223,7 @@ - +