mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: network: reject name containing '/'
Trying to define a network name containing an embedded '/' will immediately fail when trying to write the XML to disk. This patch explicitly rejects names containing a '/' Besides the network bridge driver, the only other network implementation is a very thin one for virtualbox, which seems to use the network name as a host interface name, which won't accept '/' anyways, so I think this is fine to do unconitionally. https://bugzilla.redhat.com/show_bug.cgi?id=787604
This commit is contained in:
parent
b1fc6a7b73
commit
454f739f24
@ -2070,6 +2070,12 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (strchr(def->name, '/')) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("name %s cannot contain '/'"), def->name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Extract network uuid */
|
||||
tmp = virXPathString("string(./uuid[1])", ctxt);
|
||||
if (!tmp) {
|
||||
|
Loading…
Reference in New Issue
Block a user