[libvirt] [PATCH] Fix parser checking of storage pool device

Eric Blake eblake at redhat.com
Wed Mar 3 18:57:03 UTC 2010


According to Daniel P. Berrange on 3/3/2010 11:48 AM:
> The storage backend implementations all presume that the XML parser
> is validating correctness of the source specification. The check for
> a source device was lost at some point. This allowed for a potential
> crash in the disk backend. Re-introduce the sanity check
> 
...
> +++ b/src/conf/storage_conf.c
> @@ -689,6 +689,15 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) {
>          }
>      }
>  
> +    /* If DEVICE is the only source type, then its required */

s/its/it's/

> +    if (options->flags == VIR_STORAGE_POOL_SOURCE_DEVICE) {
> +        if (!ret->source.ndevice) {
> +            virStorageReportError(VIR_ERR_XML_ERROR,
> +                                  "%s", _("missing storage pool source device name"));
> +            goto cleanup;
> +        }
> +    }

ACK.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 320 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100303/ee8239ef/attachment-0001.sig>


More information about the libvir-list mailing list