mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
conf: storage: pool: reject name containing '/'
Trying to define a pool name containing an embedded '/' will immediately fail when trying to write the XML to disk. This patch explicitly rejects names containing a '/' Besides our stateful driver, there are two other storage impls: esx and phyp. esx doesn't support pool creation, so this should doesn't apply. phyp does support pool creation, and the name is passed to the 'mksp' tool, which google doesn't reveal whether it accepts '/' or not. IMO the likeliness of this impacting any users is near zero
This commit is contained in:
parent
454f739f24
commit
20b52668dd
@ -853,6 +853,12 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strchr(ret->name, '/')) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
|
_("name %s cannot contain '/'"), ret->name);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
uuid = virXPathString("string(./uuid)", ctxt);
|
uuid = virXPathString("string(./uuid)", ctxt);
|
||||||
if (uuid == NULL) {
|
if (uuid == NULL) {
|
||||||
if (virUUIDGenerate(ret->uuid) < 0) {
|
if (virUUIDGenerate(ret->uuid) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user