mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
conf: sanitize tap and vhost paths
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
de31dcc89a
commit
c58e7e78ce
@ -7065,8 +7065,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
|
||||
if (virNetDevVlanParse(cur, ctxt, &def->vlan) < 0)
|
||||
goto error;
|
||||
} else if (xmlStrEqual(cur->name, BAD_CAST "backend")) {
|
||||
def->backend.tap = virXMLPropString(cur, "tap");
|
||||
def->backend.vhost = virXMLPropString(cur, "vhost");
|
||||
char *tmp = NULL;
|
||||
|
||||
if ((tmp = virXMLPropString(cur, "tap")))
|
||||
def->backend.tap = virFileSanitizePath(tmp);
|
||||
VIR_FREE(tmp);
|
||||
|
||||
if ((tmp = virXMLPropString(cur, "vhost")))
|
||||
def->backend.vhost = virFileSanitizePath(tmp);
|
||||
VIR_FREE(tmp);
|
||||
}
|
||||
}
|
||||
cur = cur->next;
|
||||
|
Loading…
Reference in New Issue
Block a user